Using a script from the plugin demo tailored for my environment, but get a JAVA_HOME error...
Running: Install a tool
Running: Dev
Entering stage Dev
Proceeding
Running: Shell Script
[WPG-TOOLS-WORKFLOW] Running shell script
+ mvn -o clean package
which: no javac in (/opt/jenkins/slave/tools/Maven/apache-maven-3.2.5/bin:/usr/local/bin:/bin:/usr/bin)
which: no java in (/opt/jenkins/slave/tools/Maven/apache-maven-3.2.5/bin:/usr/local/bin:/bin:/usr/bin)
Error: JAVA_HOME is not defined correctly.
We cannot execute
Running: Allocate node : Body : End
Running: Allocate node : End
Running: End of Workflow
ERROR: script returned exit code 1
Finished: FAILURE
My workflow script is very simple...
node('slave') {
git url: '***********************'
env.PATH="${tool 'Maven 3.2.5'}/bin:${env.PATH}"
stage 'Dev'
sh 'mvn -o clean package'
stage 'QA'
parallel(SonarQube: {
})
}
input message: "Does http://localhost:8080/staging/ look good?"
try {
checkpoint('Before production')
} catch (NoSuchMethodError _) {
echo 'Checkpoint feature available in Jenkins Enterprise by CloudBees.'
}
My existing Maven jobs work well, but they use Jenkins to define the JDK.
Does this mean that for the Workflow plugin I need to know where Java is installed?