This weekend I’ve given a try to see how difficult would it be to extract from Maven everything that has to do with the compilation of client-side files ( CofeeScript, JS, CSS, etc ), while keeping the rest of the build in Maven.
- Live-reload client-side source files in Apache Sling w/o Maven, as soon as source files change.
- Compile CoffeeScript files with GruntJS, b/c it’s faster than compiling with Maven, and then deploy the compiled files into JCR.
- First Step: configure a Grunt JS script that watches for CoffeeScript files, compiling them in the same
targetfolder with Maven. In my case that was
- Once compiled, deploy JS files in Apache Sling, in the right JCR path.
- Use grunt-contrib-watch plugin to update the page in Sling automatically.
- Integrate Grunt JS back into the Maven build
Source code from Gist.