I have node, npm and grunt installed on my jenkins box. I am able to successfully run the below commands using execute shell in pre steps in Jenkins.
PATH=$PATH:/sev/installed/node-v0.10.31/bin
rm -rf node_modules
rm -rf bower_components
npm install --python=/sev/installed/Python-2.7.3/bin/python
npm update --python=/sev/installed/Python-2.7.3/bin/python
bower install
bower update
As the next step when I call mvn clean package, Build fails with the error
./usr/bin/env: node: No such file or directory
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.973s
[INFO] Finished at: Tue Aug 26 23:51:16 GMT+00:00 2014
[INFO] Final Memory: 17M/438M
[INFO] ------------------------------------------------------------------------
Waiting for Jenkins to finish collecting data
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (default) on project TestUI: Command execution failed. Process exited with an error: 127 (Exit value: 127) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
I don't have root access on this Linux box. Maven exec plugin, is failing the build. Plugin definition in pom below.
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<goals>
<goal>exec</goal>
</goals>
<phase>prepare-package</phase>
</execution>
</executions>
<configuration>
<executable>${project.basedir}/node_modules/grunt-cli/bin/grunt</executable>
<workingDirectory>${project.basedir}</workingDirectory>
</configuration>
</plugin
I cant do a symlink to point node installation to /usr/bin. Any work around to solve this issue?