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

Environment variables not set early enough (or at all?)

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      JENKINS-15962 broke this functionality with this commit.

      We are using an environment variable set by this plugin in the Maven command line. Ever since that commit these variables are not set anymore.

      The problem is that ConfigFileBuildWrapper doesn't return an Environment anymore but registers an action instead which then in turn should register the environment variables. Unfortunately MavenModuleSetBuild only takes the returned Environments from BuildWrapper into account but not those from actions registered by them.

      I can fix this by reverting part of the commit mentioned above. This is the first time I've ever dug into Jenkins' code so there might be a simpler solution or this might even be a bug in Jenkins itself. I'm not sure.

      I'll attach this simplistic patch but I'm happy to try to work on a better one if given instructions.

        Attachments

          Issue Links

            Activity

            Hide
            hawky4s Christian Lipphardt added a comment - - edited

            I am also affected by this bug. I am using the plugin to inject a config file and then link the location of it via a variable as a parameter in a maven 2/3 job. It is not resolved.

            Show
            hawky4s Christian Lipphardt added a comment - - edited I am also affected by this bug. I am using the plugin to inject a config file and then link the location of it via a variable as a parameter in a maven 2/3 job. It is not resolved.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: imod
            Path:
            src/main/java/org/jenkinsci/plugins/configfiles/buildwrapper/ConfigFileBuildWrapper.java
            http://jenkins-ci.org/commit/config-file-provider-plugin/33e74abf95fa6134767dbcf72daa685cfbd89714
            Log:
            [FIXED JENKINS-17555] make env variables created by the ConfigFileBuildWrapper available for Maven projects again

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: imod Path: src/main/java/org/jenkinsci/plugins/configfiles/buildwrapper/ConfigFileBuildWrapper.java http://jenkins-ci.org/commit/config-file-provider-plugin/33e74abf95fa6134767dbcf72daa685cfbd89714 Log: [FIXED JENKINS-17555] make env variables created by the ConfigFileBuildWrapper available for Maven projects again
            Hide
            domi Dominik Bartholdi added a comment -

            although this is fixed in the plugin for now, the actual problem is the 'MavenModuleSetBuild' not taking the 'EnvironmentContributingAction's into account.
            Therefore I also post a fix for this.

            https://github.com/jenkinsci/jenkins/pull/799

            Show
            domi Dominik Bartholdi added a comment - although this is fixed in the plugin for now, the actual problem is the 'MavenModuleSetBuild' not taking the 'EnvironmentContributingAction's into account. Therefore I also post a fix for this. https://github.com/jenkinsci/jenkins/pull/799
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: imod
            Path:
            maven-plugin/src/main/java/hudson/maven/MavenModuleSetBuild.java
            test/src/test/java/hudson/maven/MavenEnvironmentContributingActionTest.java
            http://jenkins-ci.org/commit/jenkins/32b53335c6cdb9971f880db126f763ecbdc46e45
            Log:
            [FIXED JENKINS-17555] maven should take EnvironmentContributingAction into account to resolve variables

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: imod Path: maven-plugin/src/main/java/hudson/maven/MavenModuleSetBuild.java test/src/test/java/hudson/maven/MavenEnvironmentContributingActionTest.java http://jenkins-ci.org/commit/jenkins/32b53335c6cdb9971f880db126f763ecbdc46e45 Log: [FIXED JENKINS-17555] maven should take EnvironmentContributingAction into account to resolve variables
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Oliver Gondža
            Path:
            maven-plugin/src/main/java/hudson/maven/MavenModuleSetBuild.java
            test/src/test/java/hudson/maven/MavenEnvironmentContributingActionTest.java
            http://jenkins-ci.org/commit/jenkins/7e1fc28c8892244e39ab0cdf7078ab632d939e23
            Log:
            Merge pull request #799 from imod/JENKINS-17555

            Compare: https://github.com/jenkinsci/jenkins/compare/3a52e3c7aff2...7e1fc28c8892

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oliver Gondža Path: maven-plugin/src/main/java/hudson/maven/MavenModuleSetBuild.java test/src/test/java/hudson/maven/MavenEnvironmentContributingActionTest.java http://jenkins-ci.org/commit/jenkins/7e1fc28c8892244e39ab0cdf7078ab632d939e23 Log: Merge pull request #799 from imod/ JENKINS-17555 Compare: https://github.com/jenkinsci/jenkins/compare/3a52e3c7aff2...7e1fc28c8892
            Hide
            dogfood dogfood added a comment -

            Integrated in jenkins_main_trunk #2906
            [FIXED JENKINS-17555] maven should take EnvironmentContributingAction into account to resolve variables (Revision 32b53335c6cdb9971f880db126f763ecbdc46e45)

            Result = SUCCESS
            imod : 32b53335c6cdb9971f880db126f763ecbdc46e45
            Files :

            • test/src/test/java/hudson/maven/MavenEnvironmentContributingActionTest.java
            • maven-plugin/src/main/java/hudson/maven/MavenModuleSetBuild.java
            Show
            dogfood dogfood added a comment - Integrated in jenkins_main_trunk #2906 [FIXED JENKINS-17555] maven should take EnvironmentContributingAction into account to resolve variables (Revision 32b53335c6cdb9971f880db126f763ecbdc46e45) Result = SUCCESS imod : 32b53335c6cdb9971f880db126f763ecbdc46e45 Files : test/src/test/java/hudson/maven/MavenEnvironmentContributingActionTest.java maven-plugin/src/main/java/hudson/maven/MavenModuleSetBuild.java
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: imod
            Path:
            src/main/java/hudson/maven/MavenModuleSetBuild.java
            http://jenkins-ci.org/commit/maven-plugin/ff2c294577d4327a375fcd4f76dff22a9b730ea0
            Log:
            [FIXED JENKINS-17555] maven should take EnvironmentContributingAction into account to resolve variables

            Originally-Committed-As: 32b53335c6cdb9971f880db126f763ecbdc46e45

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: imod Path: src/main/java/hudson/maven/MavenModuleSetBuild.java http://jenkins-ci.org/commit/maven-plugin/ff2c294577d4327a375fcd4f76dff22a9b730ea0 Log: [FIXED JENKINS-17555] maven should take EnvironmentContributingAction into account to resolve variables Originally-Committed-As: 32b53335c6cdb9971f880db126f763ecbdc46e45
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Oliver Gondža
            Path:
            src/main/java/hudson/maven/MavenModuleSetBuild.java
            http://jenkins-ci.org/commit/maven-plugin/509e9ad166e088efbae3f47a31901d2e15da8235
            Log:
            Merge pull request #799 from imod/JENKINS-17555

            Originally-Committed-As: 7e1fc28c8892244e39ab0cdf7078ab632d939e23

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oliver Gondža Path: src/main/java/hudson/maven/MavenModuleSetBuild.java http://jenkins-ci.org/commit/maven-plugin/509e9ad166e088efbae3f47a31901d2e15da8235 Log: Merge pull request #799 from imod/ JENKINS-17555 Originally-Committed-As: 7e1fc28c8892244e39ab0cdf7078ab632d939e23

              People

              • Assignee:
                domi Dominik Bartholdi
                Reporter:
                lars_francke Lars Francke
              • Votes:
                1 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: