-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
build agent: centos 7.2
default JDK: 1.7
The maven.run uses the system default JAVA instead of the JAVA_HOME configured in the pipeline.
env.JAVA_HOME = tool name: 'JAVA8', type: 'jdk' env.PATH = "${env.JAVA_HOME}/bin:${env.PATH}" def rtMaven = Artifactory.newMavenBuild() rtMaven.tool = 'mvn' rtMaven.run pom: 'pom.xml', goals: ' -Dmaven.repo.local=.repository install javadoc:jar source:jar'
The build fails with error:
Fatal error compiling: invalid target release: 1.8 as the java command used is the system default 1.7
[JENKINS-40282] JAVA_HOME from pipeline not respected in artifactory maven run
Description |
Original:
The maven.run uses the system default JAVA instead of the JAVA_HOME configured in the pipeline. env.JAVA_HOME = tool name: 'JAVA8', type: 'jdk' env.PATH = "${env.JAVA_HOME}/bin:${env.PATH}" def rtMaven = Artifactory.newMavenBuild() rtMaven.tool = 'mvn' rtMaven.run pom: 'pom.xml', goals: ' -Dmaven.repo.local=.repository install javadoc:jar source:jar' The build fails with error Fatal error compiling: invalid target release: 1.8 as the java command used is the system default 1.7 |
New:
The maven.run uses the system default JAVA instead of the JAVA_HOME configured in the pipeline.
{code:language=Groovy} env.JAVA_HOME = tool name: 'JAVA8', type: 'jdk' env.PATH = "${env.JAVA_HOME}/bin:${env.PATH}" def rtMaven = Artifactory.newMavenBuild() rtMaven.tool = 'mvn' rtMaven.run pom: 'pom.xml', goals: ' -Dmaven.repo.local=.repository install javadoc:jar source:jar' {code} The build fails with error: bq. Fatal error compiling: invalid target release: 1.8 as the java command used is the system default 1.7 |