Question

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?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top