I see a lot of newer Maven plugins for JavaScript require NodeJS to be installed on the machine where the build takes place (both local and CI servers). For example: yeoman-maven-plugin, npm-maven-plugin, etc.
The question is: Does it make sense to check for existence of NodeJS and install it if missing via Maven as a dependency?
Bonus question: If you think this is a good idea, how would you accomplish this task?
The frontend-maven-plugin defines goals for specific tools like grunt, gulp, karma, whereas the nodejs-maven-plugin has just one generic run goals that lets you execute any Node. js-based tool.
Maven is the most popular build and dependency resolution tool for Java, just like NPM is for JS. But it's not just the same tool for a different language. There are obviously huge differences between Java and JS builds, and these differences are directly visible in the way Maven operates.
This plugin downloads/installs Node and NPM locally for your project, runs npm install , and then any combination of Bower, Grunt, Gulp, Jspm, Karma, or Webpack. It's supposed to work on Windows, OS X and Linux.
You could try the frontend-maven-plugin (via https://stackoverflow.com/a/19600777/1024571). According the docs:
This plugin downloads/installs Node and NPM locally for your project, runs NPM install, Grunt and/or Karma
Basically it allows you to use Node as part of your build process without requiring it to be installed globally on the build machine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With