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         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       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         

        
    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 <mailto: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 <mailto: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 <mailto: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 <mailto: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 <mailto:predato...@gmail.com>
See my LinkedIn profile at:
http://www.linkedin.com/in/rjeffreyvincent
I ♥ DropBox <http://db.tt/9O6LfBX> !!

Reply via email to