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

Multiple Shared Objects Groovy scripts cannot modify the same environment variable

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major Major
    • shared-objects-plugin
    • None

      I have some legacy builds which require different versions of maven and grails to be set on the PATH.

      I have setup some profiles for each version of maven

      PATH =  "MVN_221_DIR/bin:" + build.environment.PATH;
      map.put("PATH", PATH);
      

      and profiles to set the version of grails

      PATH =  "GRAILS_136_DIR/bin:" + build.environment.PATH;
      map.put("PATH", PATH);
      

      What I would like is a final PATH which contains both changes.
      "GRAILS_136_DIR/bin:MVN_221_DIR/bin:original_path"

      Actual result is just:
      "GRAILS_136_DIR/bin:original_path"

      It looks like the results of the steps are not added until the very end of the process, so modifications and new env variables added by step 1 are not available to step 2.

            gbois Gregory Boissinot
            gcummings Geoff Cummings
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: