I\'m trying to execute grunt tasks from within maven without needing to install Node.js or anything. This is because I wan\'t my artifact to be packaged by Jenkins and I can\'t
Can be done with exec-maven-plugin.
Define a script and dependency to grunt-cli in your package.json:
...
"scripts": {
"build": "./node_modules/.bin/grunt install"
},
"devDependencies": {
"grunt-cli": "^1.2.0",
...
In your pom, add the commands to run:
org.codehaus.mojo
exec-maven-plugin
X.Y.Z
exec-npm-install
generate-sources
${project.basedir}
npm
install
exec
exec-grunt-install
generate-sources
${project.basedir}
npm
run
build
exec
It will now run on mvn package