Skip to content

Instantly share code, notes, and snippets.

@eeroan
Last active December 11, 2015 16:19
Show Gist options
  • Save eeroan/4626759 to your computer and use it in GitHub Desktop.
Save eeroan/4626759 to your computer and use it in GitHub Desktop.
Working solution for bundling require.js project using maven Rhino version (js.jar) is from require.js site
<properties>
<bundle.rhinoJar>${project.basedir}/lib/js.jar</bundle.rhinoJar>
<bundle.rhinoMainClass>org.mozilla.javascript.tools.shell.Main</bundle.rhinoMainClass>
<bundle.rJsPath>${webappPath}/vendor/r-2.1.2.js</bundle.rJsPath>
</properties>
<profile>
<id>bundle-js-assets</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>bundle-js-assets</id>
<goals>
<goal>run</goal>
</goals>
<phase>compile</phase>
<configuration>
<target>
<java classname="${bundle.rhinoMainClass}" classpath="${bundle.rhinoJar}" failonerror="yes">
<arg value="${bundle.rJsPath}" />
<arg value="-o" />
<arg value="${webappPath}/build.js" />
</java>
<java classname="${bundle.rhinoMainClass}" classpath="${bundle.rhinoJar}" failonerror="yes">
<arg value="${bundle.rJsPath}" />
<arg value="-o" />
<arg value="${webappPath}/otherBuild.js" />
</java>
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment