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

Version 1.77 injects all *environment* variables into ANT command line (-D)

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • envinject-plugin
    • None

      Since I installed the update of the EnvInject plugin (1.76 -> 1.77), all build steps that use ANT (MVN not tested) now add all injected environment variables as -D parameters into the ANT command line.

      E.g. (in 1.76, correct):

      [Lucene-Solr-trunk-Linux] $ /var/lib/jenkins/tools/hudson.tasks.Ant_AntInstallation/ANT_1.8.2/bin/ant "-Dargs=-client -XX:+UseG1GC" -Dtests.multiplier=3 -Dtests.jvms=2 jenkins-hourly
      

      Now in 1.77 it looks like that:

      [Lucene-Solr-trunk-Linux] $ /var/lib/jenkins/tools/hudson.tasks.Ant_AntInstallation/ANT_1.8.2/bin/ant -DTERM=linux -DJENKINS_HOME=/var/lib/jenkins -DSHLVL=1 -DJAVA_HOME=/var/lib/jenkins/tools/java/32bit/jdk1.6.0_37 -DNODE_LABELS=master -DXFILESEARCHPATH=/usr/dt/app-defaults/%L/Dt "-DTEST_JVM_ARGS=-client -XX:+UseSerialGC" -DJAVA=32bit/jdk1.6.0_37 -DHUDSON_URL=http://jenkins.sd-datasolutions.de/ -DMAIL=/var/mail/jenkins -DXDG_SESSION_COOKIE=1293b92236e8d1cf996f5d354d67bc6d-1356708916.634490-420301248 -DJOB_URL=http://jenkins.sd-datasolutions.de/job/Lucene-Solr-trunk-Linux/ -DPWD=/var/lib/jenkins -DBUILD_ID=2012-12-28_15-35-59 -DBUILD_CAUSE=USERIDCAUSE -DPATH+JDK=/var/lib/jenkins/tools/java/32bit/jdk1.6.0_37/bin -DLOGNAME=jenkins -DBUILD_TAG=jenkins-Lucene-Solr-trunk-Linux-3469 -DBUILD_URL=http://jenkins.sd-datasolutions.de/job/Lucene-Solr-trunk-Linux/3469/ -D_=/usr/bin/daemon -DNODE_NAME=master -DBUILD_CAUSE_USERIDCAUSE=true -DNLSPATH=/usr/dt/lib/nls/msg/%L/%N.cat -DBUILD_NUMBER=3469 -DLD_LIBRARY_PATH=/usr/lib/jvm/j2sdk1.6-sun/jre/lib/amd64/server:/usr/lib/jvm/j2sdk1.6-sun/jre/lib/amd64:/usr/lib/jvm/j2sdk1.6-sun/jre/../lib/amd64 -DEXECUTOR_NUMBER=0 "-DJAVA_DESC=32bit/jdk1.6.0_37 -client -XX:+UseSerialGC" -DSHELL=/bin/bash -DJENKINS_SERVER_COOKIE=3208f2ffb2a3f912a43f43559f64a355 -DLANGUAGE=en_US -DWORKSPACE=/var/lib/jenkins/workspace/Lucene-Solr-trunk-Linux -DPATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games -DJENKINS_URL=http://jenkins.sd-datasolutions.de/ -DUSER=jenkins -DHOME=/var/lib/jenkins -DJOB_NAME=Lucene-Solr-trunk-Linux -DHUDSON_SERVER_COOKIE=3208f2ffb2a3f912a43f43559f64a355 -DHUDSON_HOME=/var/lib/jenkins "-DHISTTIMEFORMAT=[%Y-%m-%d %T] " -DLANG=en_US.UTF-8 "-Dargs=-client -XX:+UseSerialGC" -Dtests.multiplier=3 -Dtests.jvms=2 jenkins-hourly
      

      You see, all the stuff from the environment is passed in the command line -> and this should not happen! It looks like this is related to the fix for JENKINS-14437.

      In all cases there must be an option not to do this. The only params that should be submitted to ANT should be the ones configured inside the ANT build step not those completely unrelated.

          [JENKINS-16219] Version 1.77 injects all *environment* variables into ANT command line (-D)

          Uwe Schindler added a comment -

          I reverted for now to the previous version and the issue went away.

          Uwe Schindler added a comment - I reverted for now to the previous version and the issue went away.

          Uwe Schindler added a comment -

          It looks like the plugin injects the variables now into the wrong Map? I looked at the changes made in the last relaese, but I have no idea what happens and why the variables now appear as ANT -D parameters.

          Uwe Schindler added a comment - It looks like the plugin injects the variables now into the wrong Map? I looked at the changes made in the last relaese, but I have no idea what happens and why the variables now appear as ANT -D parameters.

          Code changed in jenkins
          User: Gregory Boissinot
          Path:
          src/main/java/org/jenkinsci/plugins/envinject/EnvInjectBuildVariableContributor.java
          http://jenkins-ci.org/commit/envinject-plugin/368ba74a6ed995e89013f860827a47920e9668c7
          Log:
          Fix JENKINS-16219

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Gregory Boissinot Path: src/main/java/org/jenkinsci/plugins/envinject/EnvInjectBuildVariableContributor.java http://jenkins-ci.org/commit/envinject-plugin/368ba74a6ed995e89013f860827a47920e9668c7 Log: Fix JENKINS-16219

          Thanks for your comments.
          Here, we have design issues between Jenkins core and EnvInject plugin. I provided a fix but it is not perfect.
          Please upgrade to EnvInject 1.78 and let me know.

          Gregory Boissinot added a comment - Thanks for your comments. Here, we have design issues between Jenkins core and EnvInject plugin. I provided a fix but it is not perfect. Please upgrade to EnvInject 1.78 and let me know.

          Uwe Schindler added a comment -

          OK, will do once it is available for update from within Jenkins!

          Uwe Schindler added a comment - OK, will do once it is available for update from within Jenkins!

          Uwe Schindler added a comment -

          Hi,
          after the update to 1.78, all is fine again. Thanks for the quick help!
          Uwe

          Uwe Schindler added a comment - Hi, after the update to 1.78, all is fine again. Thanks for the quick help! Uwe

            gbois Gregory Boissinot
            thetaphi Uwe Schindler
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: