Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-19267

Jenkins 1.527 and latter does not use JDK5 defined at job - compile phase still use JDK6

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Blocker
    • Resolution: Not A Defect
    • Component/s: maven-plugin
    • Labels:
    • Environment:
      Centos 6; Jenkins runs on Oracle JDK 6, patch 43; affected jobs have defined Oracle Java 5, patch 22;
      Maven 2.2.1
    • Similar Issues:

      Description

      Hello,
      according to suggestion at ticket JENKINS-18403 I am opening this new ticket. I did some things, which were recommended to do (from ticket JENKINS-18403; by Jesse Glick) and result is:
      ad 1. - I run job with Maven option -X and found this (some content is removed because contains sensitive data ...):

      for resources (Configuring mojo 'org.apache.maven.plugins:maven-resources-plugin:2.3:resources'):

      env.PATH=/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven_2.2.1/bin:/var/lib/jenkins/tools/hudson.model.JDK/Java_1.5_v22/bin:/sbin:/usr/sbin:/bin:/usr/bin, env.HUDSON_URL=..., env.JENKINS_URL=..., maven.compiler.fork=true, java.class.version=50.0, env.SHLVL=3, env.LD_LIBRARY_PATH=/usr/lib/jvm/jdk1.6.0_45/jre/lib/amd64/server:/usr/lib/jvm/jdk1.6.0_45/jre/lib/amd64:/usr/lib/jvm/jdk1.6.0_45/jre/../lib/amd64, JOB_URL=..., sonar.jdbc.url=..., env.JENKINS_HOME=/var/lib/jenkins, JENKINS_HOME=/var/lib/jenkins, maven.test.skip=true, BUILD_ID=2013-08-20_08-33-45, sun.boot.library.path=/usr/lib/jvm/jdk1.6.0_45/jre/lib/amd64, sun.management.compiler=HotSpot 64-Bit Tiered Compilers, build.singleton=false, java.awt.graphicsenv=sun.awt.X11GraphicsEnvironment, env.USER=jenkins, HUDSON_HOME=/var/lib/jenkins, PATH+MAVEN=/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven_2.2.1/bin, NLSPATH=/usr/dt/lib/nls/msg/%L/%N.cat, java.vm.specification.version=1.0, JAVA_HOME=/var/lib/jenkins/tools/hudson.model.JDK/Java_1.5_v22, build.env=DEV1, SHELL=/bin/bash, env.NLSPATH=/usr/dt/lib/nls/msg/%L/%N.cat, NODE_LABELS=master, env.MAVEN_HOME=/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven_2.2.1, sun.cpu.isalist=, java.ext.dirs=/usr/lib/jvm/jdk1.6.0_45/jre/lib/ext:/usr/java/packages/lib/ext, os.version=2.6.32-358.14.1.el6.x86_64, user.home=/var/lib/jenkins, _=/etc/alternatives/java, java.vm.vendor=Sun Microsystems Inc., env.JAVA_HOME=/var/lib/jenkins/tools/hudson.model.JDK/Java_1.5_v22, user.dir=/var/lib/jenkins/jobs/..., sonar.jdbc.username=..., SVN_URL=..., env.XFILESEARCHPATH=/usr/dt/app-defaults/%L/Dt, env.PWD=/, sun.cpu.endian=little, env.SVN_URL=..., sonar.jdbc.driver=com.mysql.jdbc.Driver, java.vm.version=20.45-b01, java.class.path=/var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven-agent-1.4.jar:/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven_2.2.1/boot/classworlds-1.1.jar, MAVEN_OPTS=-Xms512m -Xmx768m, os.arch=amd64, WORKSPACE=/var/lib/jenkins/jobs/.../workspace, sun.java.launcher=SUN_STANDARD, LANG=en_US.UTF-8, env.BUILD_ID=2013-08-20_08-33-45, java.vm.specification.vendor=Sun Microsystems Inc., file.separator=/, java.runtime.version=1.6.0_45-b06, sun.boot.class.path=/usr/lib/jvm/jdk1.6.0_45/jre/lib/resources.jar:/usr/lib/jvm/jdk1.6.0_45/jre/lib/rt.jar:/usr/lib/jvm/jdk1.6.0_45/jre/lib/sunrsasign.jar:/usr/lib/jvm/jdk1.6.0_45/jre/lib/jsse.jar:/usr/lib/jvm/jdk1.6.0_45/jre/lib/jce.jar:/usr/lib/jvm/jdk1.6.0_45/jre/lib/charsets.jar:/usr/lib/jvm/jdk1.6.0_45/jre/lib/modules/jdk.boot.jar:/usr/lib/jvm/jdk1.6.0_45/jre/classes, LD_LIBRARY_PATH=/usr/lib/jvm/jdk1.6.0_45/jre/lib/amd64/server:/usr/lib/jvm/jdk1.6.0_45/jre/lib/amd64:/usr/lib/jvm/jdk1.6.0_45/jre/../lib/amd64, env.WORKSPACE=/var/lib/jenkins/jobs/.../workspace, SVN_URL_1=..., PATH+JDK=/var/lib/jenkins/tools/hudson.model.JDK/Java_1.5_v22/bin, user.country=US, env.EXECUTOR_NUMBER=0, maven.home=/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven_2.2.1, env.SHELL=/bin/bash, HOME=/var/lib/jenkins, java.vendor=Sun Microsystems Inc., env.SVN_URL_1=..., env.HUDSON_COOKIE=e553e31a-529b-4ded-8e3c-2b92954a94db, java.specification.version=1.6, maven.compiler.executable=/var/lib/jenkins/tools/hudson.model.JDK/Java_1.5_v22/bin/javac, sun.arch.data.model=64}
      

      for compilation phase by Maven

      ...
      DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile' -->
      [DEBUG]   (f) basedir = /var/lib/jenkins/jobs/...
      [DEBUG]   (f) buildDirectory = /var/lib/jenkins/jobs/...
      [DEBUG]   (f) classpathElements = /var/lib/jenkins/.m2/repository/...]
      [DEBUG]   (f) compileSourceRoots = [/var/lib/jenkins/jobs/...]
      [DEBUG]   (f) compilerId = javac
      [DEBUG]   (f) debug = true
      [DEBUG]   (f) encoding = UTF-8
      [DEBUG]   (f) executable = /var/lib/jenkins/tools/hudson.model.JDK/Java_1.5_v22/bin/javac
      [DEBUG]   (f) failOnError = true
      [DEBUG]   (f) fork = false
      [DEBUG]   (f) optimize = true
      [DEBUG]   (f) outputDirectory = /var/lib/jenkins/jobs/.../target/classes
      [DEBUG]   (f) outputFileName = ...
      [DEBUG]   (f) projectArtifact = ...
      [DEBUG]   (f) showDeprecation = false
      [DEBUG]   (f) showWarnings = false
      [DEBUG]   (f) source = 1.5
      [DEBUG]   (f) staleMillis = 0
      [DEBUG]   (f) target = 1.5
      [DEBUG]   (f) verbose = false
      [DEBUG] -- end configuration --
      ...
      

      What is interesting that:

      • maven.compiler.fork=true
      • maven.compiler.executable=/var/lib/jenkins/tools/hudson.model.JDK/Java_1.5_v22/bin/javac
        but
      • java.specification.version=1.6 - it is strange that I expected to be 1.5 and suspect that this could cause our troubles ...

      ad 2. - it is not possible to do upgrades, because this is "production" code (build) and updates have to be done in specific approved process ...

      ad 3. - build is done only on master (we don't use slaves)

      ad remark with API - yes, we implement some specific logic for JDBC API, which is different at JDK 5 and 6.

      Best regards,
      Pavel C.

        Attachments

          Issue Links

            Activity

            cervenkap Pavel Cervenka created issue -
            cervenkap Pavel Cervenka made changes -
            Field Original Value New Value
            Link This issue is related to JENKINS-18403 [ JENKINS-18403 ]
            Hide
            jglick Jesse Glick added a comment -

            fork = false despite maven.compiler.fork=true is what is wrong. You are using an ancient version of the compiler plugin. You need at least 2.1 to get the fix of http://jira.codehaus.org/browse/MCOMPILER-111.

            Show
            jglick Jesse Glick added a comment - fork = false despite maven.compiler.fork=true is what is wrong. You are using an ancient version of the compiler plugin. You need at least 2.1 to get the fix of http://jira.codehaus.org/browse/MCOMPILER-111 .
            jglick Jesse Glick made changes -
            Status Open [ 1 ] Resolved [ 5 ]
            Resolution Not A Defect [ 7 ]
            jglick Jesse Glick made changes -
            Labels java5 jenkins maven2 plugin java5 maven2
            ircbot Jenkins IRC Bot made changes -
            Component/s maven-plugin [ 16033 ]
            Component/s maven2 [ 15487 ]
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 150715 ] JNJira + In-Review [ 193641 ]

              People

              • Assignee:
                Unassigned
                Reporter:
                cervenkap Pavel Cervenka
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: