New page: If your Bck2Brwsr application uses some popular library you may decide to pre-compile it, rather than spend time compiling it everytime. If you are building your library and co...
New page
If your [[Bck2Brwsr]] application uses some popular [[library]] you may decide to pre-compile it, rather than spend time compiling it everytime. If you are building your [[library]] and control its pom.xml, you can just include:
<source lang="xml">
<plugin>
<groupId>org.apidesign.bck2brwsr</groupId>
<artifactId>bck2brwsr-maven-plugin</artifactId>
<version>${bck2brwsr.version}</version>
<executions>
<execution>
<goals>
<goal>library</goal>
</goals>
</execution>
</executions>
</plugin>
</source>
in your pom.xml and additional artifact with classifier ''bck2brwsr'' will be generated for you. In other pom.xml where, you compile your final application, you just reference this new artifact and pre-compiled [[JavaScript]] file with [[Bck2Brwsr]] [[library]] will be used:
<source lang="xml">
<dependency>
<groupId>your.library.group</groupId>
<artifactId>your.library.name</artifactId>
<classifier>bck2brwsr</classifier>org.apidesign.bck2brwsr
<scope>provided</scope>
<type>jar</type>
<dependency>
</source>
Of course, sometimes people don't control their [[library]]'s pom.xml and want to do additional modifications to it (like adding [[OSGiWrapper|OSGi headers]]). Even with such [[libraries]] one can use ahead-of-time compilation. Just use ''aotDeps'' element and pre-compile your dependencies too:
<source lang="xml">
<plugin>
<groupId>org.apidesign.bck2brwsr</groupId>
<artifactId>bck2brwsr-maven-plugin</artifactId>
<version>${bck2brwsr.version}</version>
<executions>
<execution>
<goals>
<goal>library</goal>
</goals>
</execution>
</executions>
<configuration>
<aotDeps>
<!-- compiles whole group HTML/Java libraries from NetBeans -->
<aotDep>org.netbeans.html:*</aotDep>
</aotDeps>
<!-- does not compile the main project artifact -->
<minified>false</minified>
<debug>false</debug>
</configuration>
</plugin>
</source>
With support like that you can significantly speed up compilation of your [[Bck2Brwsr]] projects.