Child pages
  • dojo.compressor-maven-plugin

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Application of the dojo-compressor-maven-plugin

Add clazzes.org as plugin repository

Add the following to your project's pom.xml file:

Code Block
  <pluginRepositories>
    <pluginRepository>
      <id>org.clazzes</id>
      <name>Clazzes.org repository.</name>
      <url>http://maven.clazzes.org</url>
    </pluginRepository>
  </pluginRepositories>

Define an xDojoPackage variable

This step is needed in order to resolve the dojo package IDs of your own project. If your project is a very simple webapp project, which only uses foreign modules, this step may be skipped.

Code Block
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <xDojoPackage>dcm;version=${project.version};location=OSGI-INF/webapp/dojo-config-manager/js</xDojoPackage>
  </properties>

Configure the maven plugins

As above, X-Dojo-Package may be optional for small toplevel webapp projects.

Please note, that entryPointsToAssemble is not needed for library projects.

Code Block
  <build>
    <plugins>
	  <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <extensions>true</extensions>
        <configuration>
          <remoteOBR>clazzes.org-dojo-dist</remoteOBR>
          <prefixUrl>http://maven.clazzes.org</prefixUrl>
          <instructions>
            <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
            <Private-Package>
                ....
            </Private-Package>
            <Import-Package>*</Import-Package>
            <X-Dojo-Package>${xDojoPackage}</X-Dojo-Package>
          </instructions>
        </configuration>
      </plugin>
      <plugin>
       <groupId>org.clazzes.dojo</groupId>
       <artifactId>dojo-compressor-maven-plugin</artifactId>
       <version>0.3.1</version>
       <executions>
         <execution>
           <phase>generate-resources</phase>
           <configuration>
             <entryPointsToAssemble>dcm-web\.js</entryPointsToAssemble>
             <xDojoPackage>${xDojoPackage}</xDojoPackage>
      	     <munge>true</munge>
      	     <addNorefHack>true</addNorefHack>
           </configuration>
           <goals>
             <goal>compress</goal>
           </goals>
         </execution>
       </executions>
      </plugin>
    </plugins>
  </build>