Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 369496

Summary: Hudson build JVM settings seems to be ignored by Maven
Product: Community Reporter: Steffen Pingel <steffen.pingel>
Component: CI-JenkinsAssignee: Eclipse Webmaster <webmaster>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Bug Depends on:    
Bug Blocks: 367238    

Description Steffen Pingel CLA 2012-01-24 06:41:46 EST
I have set the JVM to "Java 1.7" in the configuration of this job: https://hudson.eclipse.org/hudson/job/mylyn-builds-nightly/configure 

When the job executes Maven is spawned with Java 1.6 regardless:

[INFO] Using bundled Maven 3 installation
[INFO] Checking Maven 3 installation environment
[workspace] $ /opt/users/hudsonbuild/.hudson/maven/slavebundle/bundled-maven/bin/mvn --help
[INFO] Checking Maven 3 installation version
[workspace] $ /opt/users/hudsonbuild/.hudson/maven/slavebundle/bundled-maven/bin/mvn --version
[INFO] Detected Maven 3 installation version: 3.0.3
[workspace] $ /opt/users/hudsonbuild/.hudson/maven/slavebundle/bundled-maven/bin/mvn clean verify -V -e -Danalysis.skip=false -Dmaven.ext.class.path=/opt/users/hudsonbuild/.hudson/maven/slavebundle/resources:/opt/users/hudsonbuild/.hudson/maven/slavebundle/lib/maven3-eventspy-3.0.jar:/opt/users/hudsonbuild/.hudson/war/WEB-INF/lib/hudson-remoting-2.1.2.jar -Dhudson.eventspy.port=49683 -Dmaven.repo.local=/opt/users/hudsonbuild/.hudson/jobs/mylyn-builds-nightly/workspace/.maven/repo -f pom.xml -fae
[DEBUG] Waiting for connection on port: 49683
Apache Maven 3.0.3 (r1075438; 2011-02-28 12:31:09-0500)
Maven home: /opt/users/hudsonbuild/.hudson/maven/slavebundle/bundled-maven
Java version: 1.6.0_21, vendor: Sun Microsystems Inc.
Java home: /opt/public/common/sun-jdk1.6.0_21_x64/jre

If I add a shell call that invokes Java directly I get this:

+ java -version
java version "1.7.0"
Java(TM) SE Runtime Environment (build 1.7.0-b147)
Java HotSpot(TM) 64-Bit Server VM (build 21.0-b17, mixed mode)

But $JAVA_HOME still seems to point to a JDK 1.6:

+ echo /shared/common/sun-jdk1.6.0_21_x64
/shared/common/sun-jdk1.6.0_21_x64

I get the same results when running on master or a slave. 

Any ideas how to force Java 7 for the build?
Comment 1 Steffen Pingel CLA 2012-01-24 06:44:32 EST
This thread is possibly related but I don't know if it still applies to Hudson 2.1: http://stackoverflow.com/questions/747878/how-can-i-configure-a-hudson-job-to-use-a-specific-jdk
Comment 2 Eclipse Webmaster CLA 2013-03-14 10:17:11 EDT
Is this still an issue?

-M.
Comment 3 Steffen Pingel CLA 2013-05-03 03:36:43 EDT
Thanks! I can confirm that the proxy environment settings are present now.