So it's now working with no changes that I can tell other than possibly restarting Jenkins.
I went to install the Setenv plugin, found it was deprecated in favor of the "Environment Inject" plugin then noticed a new version of Jenkins (1.495) so I installed the Environment Inject plugin, downloaded and deployed the new Jenkins version and amongst the changes ended up restarting Jenkins. When I went to configure the EnvInject plugin, I remembered the maven command "help:system" that dumps the current environment so I added that to the maven command line to verify the current settings and noticed that JAVA_HOME was pointing to the correct JDK and the build succeeded. I then removed the EnvInject plugin, restarted Jenkins and the build still worked. I noticed that the difference between the failed build and the good build included this line: BAD BUILD: [MyService (trunk)] $ *java* -Xmx512m -XX:MaxPermSize=128m -cp /home/adminuser/.jenkins-slave/maven3-agent.jar:/home/adminuser/.jenkins-slave/tools/Maven/Maven_3.0.4/boot/plexus-classworlds-2.4.jar org.jvnet.hudson.maven3.agent.Maven3Main /home/adminuser/.jenkins-slave/tools/Maven/Maven_3.0.4 /home/adminuser/.jenkins-slave/slave.jar /home/adminuser/.jenkins-slave/maven3-interceptor.jar 39025 GOOD BUILD: [MyService (trunk)] $ */home/adminuser/.jenkins-slave/tools/hudson.model.JDK/Sun_JDK_6u37/bin/java* -Xmx512m -XX:MaxPermSize=128m -cp /home/adminuser/.jenkins-slave/maven3-agent.jar:/home/adminuser/.jenkins-slave/tools/hudson.tasks.Maven_MavenInstallation/Maven_3.0.4/boot/plexus-classworlds-2.4.jar org.jvnet.hudson.maven3.agent.Maven3Main /home/adminuser/.jenkins-slave/tools/hudson.tasks.Maven_MavenInstallation/Maven_3.0.4 /home/adminuser/.jenkins-slave/slave.jar /home/adminuser/.jenkins-slave/maven3-interceptor.jar 52348 I don't understand why it started using the right JDK other than the restart (or update) forced something. Thanks for the help. Next time I'll restart Jenkins before freaking out! :-) On Fri, Dec 28, 2012 at 11:37 AM, Eric Pyle <eric.p...@cd-adapco.com> wrote: > Looks like you need the Setenv plugin to get that option. > > > On 12/28/2012 1:26 PM, Jeff wrote: > > I can't find anything in the "Build Environment" section that allows this. > The check boxes I see are: > > Build Environment > Delete workspace before build starts Copy files into the job's > workspace before building [image: Help for feature: Copy files into the > job's workspace before > building]<http://10.9.3.9/jenkins/job/AncestryDnaService%20%28trunk%29/configure#> > > > Execute shell script on remote host using ssh [image: Help for feature: > Execute shell script on remote host using > ssh]<http://10.9.3.9/jenkins/job/AncestryDnaService%20%28trunk%29/configure#> > > > Maven release build VMware Server VIX Virtual Machine Activation VMware > Server VIX Virtual Machine Activation > > > In the "Build" section, I can set MAVEN_OPTS but by this time, the "mvn" > command would have already been launched using whatever the default java > install is, or am I missing something? > > I do have the "JDK" set to the correct value (Sun JDK 6u37) for this > job. > > > JDK (Default) Sun JDK 6u37 Sun JDK 7u9 > > JDK to be used for this project > > > Why isn't the job using it? Isn't that what it's for? > > > On Fri, Dec 28, 2012 at 11:04 AM, Eric Pyle <eric.p...@cd-adapco.com>wrote: > >> Your first question is a Maven issue - I could only speculate about it. >> For the second question - yes, in the Build Environment section of the job >> configuration you can set environment variables for the job. >> >> Eric >> >> >> On 12/28/2012 12:51 PM, Jeff wrote: >> >> Won't that will just cause clutter in the POM that will affect every >> developer and every environment? >> >> Seems like it would be cleaner to just allow me to tell Jenkins to run >> the job using the correct JDK that was specifically defined in the job. >> >> My questions: >> >> - Why doesn't job execution honor the JDK setting? >> - Is there a way to force a new value for JAVA_HOME for a specific >> job? >> >> >> >> >> On Fri, Dec 28, 2012 at 10:40 AM, Eric Pyle <eric.p...@cd-adapco.com>wrote: >> >>> You can do this using the Maven Compiler plugin. See >>> http://maven.apache.org/plugins/maven-compiler-plugin/examples/compile-using-different-jdk.html >>> . >>> >>> Eric >>> >>> >>> On 12/28/2012 12:25 PM, Jeff wrote: >>> >>> I have a brand new Jenkins master + slave running on top of the latest >>> JDK 1.7.0_u10. >>> >>> I've configured multiple JDK versions in Jenkins (with auto installers >>> from Oracle), including JDK 1.6.0_u37. >>> >>> I have one Maven job that uses the wsgen/wsimport commands to generate >>> WSDL and client files that works fine when running in JDK 1.6, but fails >>> with JDK 1.7. >>> >>> I have set the job to use JDK 1.6, but it still executes the maven >>> command against the default JDK 1.7. >>> >>> I thought that by configuring the job with a specific JDK, that is what >>> it would use, but that doesn't seem to be the case. >>> >>> How do I force the job (maven command) to run using the correct JDK? >>> >>> -- >>> Jeff Vincent >>> predato...@gmail.com >>> See my LinkedIn profile at: >>> http://www.linkedin.com/in/rjeffreyvincent >>> I ♥ DropBox <http://db.tt/9O6LfBX> !! >>> >>> >>> >> >> >> -- >> Jeff Vincent >> predato...@gmail.com >> See my LinkedIn profile at: >> http://www.linkedin.com/in/rjeffreyvincent >> I ♥ DropBox <http://db.tt/9O6LfBX> !! >> >> >> > > > -- > Jeff Vincent > predato...@gmail.com > See my LinkedIn profile at: > http://www.linkedin.com/in/rjeffreyvincent > I ♥ DropBox <http://db.tt/9O6LfBX> !! > > > -- Jeff Vincent predato...@gmail.com See my LinkedIn profile at: http://www.linkedin.com/in/rjeffreyvincent I ♥ DropBox <http://db.tt/9O6LfBX> !!