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

EnvInject doesn't pass variables defined in prebuild step if maven project is used

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Labels:
      None
    • Environment:
      Windows
      Jenkins 1.467
      EnvInject 1.55

      Description

      To reproduce:
      Create maven2 project
      Add prebuild step: Inject environment variables, add to property content field: "VAR123=Value123"
      Set maven goals: "clean -Dparam=$

      {VAR123}"
      Build project

      Logs:
      Executing Maven: -B -f C:\Jenkins\jobs(Temp)\workspace\pom.xml clean -Dparam=${VAR123}

      Update: The bug is reproducible with Jenkins 1.471

        Issue Links

          Activity

          Hide
          kabhal Hugo de Paix de Coeur added a comment -

          Workaround : The older Envfile plugin is working (Jenkins 1.574) with Maven goal and options field.

          Show
          kabhal Hugo de Paix de Coeur added a comment - Workaround : The older Envfile plugin is working (Jenkins 1.574) with Maven goal and options field.
          Hide
          doronshai Doron Shai added a comment -

          Any estimation if this issue will be fixed and when? it is quite an annoying bug

          Show
          doronshai Doron Shai added a comment - Any estimation if this issue will be fixed and when? it is quite an annoying bug
          Hide
          integer Kanstantsin Shautsou added a comment -

          Hi, i think this not EnvInject plugin issue, because i injected env and parameter variables with groovy and they are not available in Maven build step. #JENKINS-20884 seems the root of this issue.

          Show
          integer Kanstantsin Shautsou added a comment - Hi, i think this not EnvInject plugin issue, because i injected env and parameter variables with groovy and they are not available in Maven build step. # JENKINS-20884 seems the root of this issue.
          Hide
          danielbeck Daniel Beck added a comment -

          This one can easily be reproduced using any maven-based project (you need a pom.xml) and the goal help:system. The environment variables defined in "Inject Environment Variables" Pre Step are not defined in the context of the maven build of the maven project, only those from Build Environment "Inject environment variables to the build process" are.

          Show
          danielbeck Daniel Beck added a comment - This one can easily be reproduced using any maven-based project (you need a pom.xml) and the goal help:system . The environment variables defined in "Inject Environment Variables" Pre Step are not defined in the context of the maven build of the maven project, only those from Build Environment "Inject environment variables to the build process" are.
          Hide
          integer Kanstantsin Shautsou added a comment - - edited

          Fixed in 2.7 maven-plugin version. Details: JENKINS-20884
          2.7 will appear in update center when INFRA-178 will be resolved.
          Markus Meisterernst, if it solves your issue you may donate based on this info https://wiki.jenkins-ci.org/display/JENKINS/Donation

          Show
          integer Kanstantsin Shautsou added a comment - - edited Fixed in 2.7 maven-plugin version. Details: JENKINS-20884 2.7 will appear in update center when INFRA-178 will be resolved. Markus Meisterernst, if it solves your issue you may donate based on this info https://wiki.jenkins-ci.org/display/JENKINS/Donation

            People

            • Assignee:
              gbois Gregory Boissinot
              Reporter:
              romchick Roman Milyuchikhin
            • Votes:
              8 Vote for this issue
              Watchers:
              20 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: