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

Tool installations injected by SharedObjects plugin cannot be used by EnvInject

    XMLWordPrintable

Details

    Description

      Jenkins has various tools configured, e.g. Maven 2.2.1. This is injected by the SHaredObjects plugin under the environment variable Maven_2.2.1. This variable is set and present.

      This variable can not be used by the EnvInject plugin when setting other variables. I have tried this in the Job and Build sections of the configuration. In both cases the variable referencing ${Maven_2.2.1} was unresolved.

      Setting the following property under Job:

      MAVEN_BIN=${Maven_2.2.1}/bin
      

      results in

      [EnvInject] - Loading node environment variables.
      [EnvInject] - Preparing an environment for the build.
      [EnvInject] - Keep Jenkins system variables.
      [EnvInject] - Keep Jenkins build variables.
      [EnvInject] - Injecting as environment variables the properties content 
      CMAKE_HOME=${CBE_TOOLS}/cmake
      MAVEN_BIN=${Maven_2.2.1}/bin
      
      [EnvInject] - Variables injected successfully.
      [SharedObjects] - Injecting tool installations as environment variables
      [EnvInject] - Unset unresolved 'MAVEN_BIN' variable.
      

      Setting the property under the Build section results in:

      [EnvInject] - Loading node environment variables.
      [EnvInject] - Preparing an environment for the build.
      [EnvInject] - Keep Jenkins system variables.
      [EnvInject] - Keep Jenkins build variables.
      [SharedObjects] - Injecting tool installations as environment variables
      Building on master in workspace /data/sourcecode/codec/trunk/hourly/arch/amd64/os/linux
      [EnvInject] - Executing scripts and injecting environment variables after the SCM step.
      [EnvInject] - Injecting as environment variables the properties content 
      CMAKE_HOME=${CBE_TOOLS}/cmake
      MAVEN_BIN=${Maven_2.2.1}/bin
      
      [EnvInject] - Variables injected successfully.
      [EnvInject] - Unset unresolved 'MAVEN_BIN' variable.
      

      Attachments

        Activity

          f_zschocke Florian Zschocke created issue -
          gbois Gregory Boissinot made changes -
          Field Original Value New Value
          Component/s shared-objects [ 16525 ]
          Component/s envinject [ 15893 ]
          gbois Gregory Boissinot made changes -
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Resolved [ 5 ]
          f_zschocke Florian Zschocke made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          rtyler R. Tyler Croy made changes -
          Workflow JNJira [ 144140 ] JNJira + In-Review [ 205840 ]

          People

            gbois Gregory Boissinot
            f_zschocke Florian Zschocke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: