Using Maven to manage a large project has it’s advantages, until you need to do something that doesn’t fit into the Maven’s defined context. Tools based on composability provide components that can be combined in various ways to accomplish needed tasks. Maven—a contextual tool—provides a lot of functionality out of the box, but ultimately requires users to conform to Maven’s way of doing things, not allowing the user to simple string together commands to perform custom tasks.
I messed around with having Maven run external node.js scripts for a while, but it was ugly. I decided to give mcheely’s requirejs-maven-plugin a try. His plugin takes the r.js optimizer and shoves it into Maven’s context. And you know what? It works pretty well.
Configuration can be as simple as: ```xml
By using this plugin (and a few others like the minify-maven-plugin) here at work we’ve successfully eliminated our dependency on Node.js for builds, which makes development environments easier to setup for everybody and means less things for Java developers to have to learn. I have nothing against Node.js here—I really like it, but the existence of plugins like this make life with Maven (and other devs) a little easier.