How to Incorporate Front End Builds into OSGi Bundles

Published on by Dan KlcoPicture of Me Dan Klco

The Sling Content Loader allows for creating OSGi bundles which contain content loaded into the Sling Repository. This works well for static content but doesn't work so well for dynamic content. This includes when using modern Front End development tools to compile and minify Sass / JS, especially when integrating with the Maven build process. Among the challenges are:   Invoking the Front End Build as a part of the Maven Build Excluding node_modules from License Checks Including Generated Content in the Bundle   Invoking the Front End Build in the Maven Build   Luckily, this is a solved problem. The frontend-maven-plugin is made to coordinate the build of Front End build technologies, including Gulp, Bower, NPM and Grunt through a plugin in your Maven build. To add this plugin into a Maven build, add a snippet like this into the relevant pom.xml:   <properties> <>target/frontend</></properties>[...]<plugin> <groupId>com.github.eirslett</groupId> <artifactId>frontend-maven-plugin</artifactId> <version>1.4</version> <configuration> <installDirectory>${}</installDirectory> <workingDirectory>${}</workingDirectory> </configuration> <executions> <execution> <id>install node and npm</id> <goals>...