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

          The error is due to an issue between environment variables with dot (.) and Jenkins.
          In the last shared-objects Jenkins plugin, environment variables from tool names replaces a space, a dash or a dot to by a underscore.
          You just have to update your job configurations and replace dot with underscore.

          gbois Gregory Boissinot added a comment - The error is due to an issue between environment variables with dot (.) and Jenkins. In the last shared-objects Jenkins plugin, environment variables from tool names replaces a space, a dash or a dot to by a underscore. You just have to update your job configurations and replace dot with underscore.

          Code changed in jenkins
          User: Gregory Boissinot
          Path:
          src/main/resources/org/jenkinsci/plugins/sharedobjects/ToolInstallationJobProperty/help-populateToolInstallation.html
          http://jenkins-ci.org/commit/shared-objects-plugin/16d206e3694442989b7d1644084f2321e7ecf6c7
          Log:
          Fix JENKINS-13673

          Compare: https://github.com/jenkinsci/shared-objects-plugin/compare/2bec41a...16d206e

          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Gregory Boissinot Path: src/main/resources/org/jenkinsci/plugins/sharedobjects/ToolInstallationJobProperty/help-populateToolInstallation.html http://jenkins-ci.org/commit/shared-objects-plugin/16d206e3694442989b7d1644084f2321e7ecf6c7 Log: Fix JENKINS-13673 Compare: https://github.com/jenkinsci/shared-objects-plugin/compare/2bec41a...16d206e

          Code changed in jenkins
          User: Gregory Boissinot
          Path:
          src/main/java/org/jenkinsci/plugins/sharedobjects/ToolInstallationJobProperty.java
          http://jenkins-ci.org/commit/shared-objects-plugin/94cbd90d9e6513938907fb5c594253ca516bac5e
          Log:
          Fix JENKINS-13673

          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Gregory Boissinot Path: src/main/java/org/jenkinsci/plugins/sharedobjects/ToolInstallationJobProperty.java http://jenkins-ci.org/commit/shared-objects-plugin/94cbd90d9e6513938907fb5c594253ca516bac5e Log: Fix JENKINS-13673

          It is a shared-objects component issue

          gbois Gregory Boissinot added a comment - It is a shared-objects component issue

          People

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

            Dates

              Created:
              Updated:
              Resolved: