• Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Major Major
    • core
    • None
    • Windows XP, Red Hat Enterprise Linux 5

      The global properties system is not working as (I) expected. Tried using the Hudson release plugin, Tasks plugin, Ant build, can't pass any property.

      Steps:
      1. Enter Manage Hudson -> Configure system -> Global properties.
      2. Define a new global property: ABC, value 123.
      3. Try to access it from a task, from the release plugin, from an Ant build (via command line), using the documented syntax:
      $ABC or ${ABC}.
      4. Result - no replacement.

      This is pretty serious for us since we have lots of jobs. For example several plugins use system tools: Maven 2, SVN, ... We've already configured the paths to these tools, several versions even, in the global Hudson configuration.
      However, because of this bug, we have to replicate them for every job. Error prone and added complexity.

          [JENKINS-5312] Global properties not being replaced

          Costin Caraivan created issue -
          Costin Caraivan made changes -
          Affects Version/s New: current [ 10162 ]
          Summary Original: Global properties New: Global properties not being replaced

          mdonohue added a comment -

          What version of Hudson are you using? Did this ever work in a previous version, or did you just expect it to work and were surprised to find that it does not?

          mdonohue added a comment - What version of Hudson are you using? Did this ever work in a previous version, or did you just expect it to work and were surprised to find that it does not?

          Latest version, 1.341. Tried in older versions, didn't work either.

          Decided to finally report it since I saw no bug report about this - and those that were saying something like this were scattered and not really linking to the main problem.

          I was expecting this to work, since:
          http://issues.jenkins-ci.org/browse/JENKINS-247
          says that Ant specific properties are superseded by "Global properties" => "Global properties" are more general and do the same job.

          Also, the feature help says, quote:
          "These key-value pairs apply for every build on every node. They can be used in Hudson's configuration (as $key or ${key}) and will be added to the environment for processes launched from the build."

          Or does the wording mean "Hudson's global configuration"? Even if so, it says that they are added to the environment for processes launched - i.e. I should be able to access them from the process itself.

          Maybe I'm using the wrong syntax? But if I'm launching a shell, accessing environment variables is done with $VARIABLE. Do I need to use System.getenv("variable")?

          Costin Caraivan added a comment - Latest version, 1.341. Tried in older versions, didn't work either. Decided to finally report it since I saw no bug report about this - and those that were saying something like this were scattered and not really linking to the main problem. I was expecting this to work, since: http://issues.jenkins-ci.org/browse/JENKINS-247 says that Ant specific properties are superseded by "Global properties" => "Global properties" are more general and do the same job. Also, the feature help says, quote: "These key-value pairs apply for every build on every node. They can be used in Hudson's configuration (as $key or ${key}) and will be added to the environment for processes launched from the build." Or does the wording mean "Hudson's global configuration"? Even if so, it says that they are added to the environment for processes launched - i.e. I should be able to access them from the process itself. Maybe I'm using the wrong syntax? But if I'm launching a shell, accessing environment variables is done with $VARIABLE. Do I need to use System.getenv("variable")?
          Costin Caraivan made changes -
          Description Original: The global properties system is not working. Tried using the Hudson release plugin, Tasks plugin, Ant build, can't pass any property.

          Steps:
          1. Enter Manage Hudson -> Configure system -> Global properties.
          2. Define a new global property: ABC, value 123.
          3. Try to access it from a task, from the release plugin, from an Ant build (via command line), using the documented syntax:
          $ABC or ${ABC}.
          4. Result - no replacement.

          This is pretty serious for us since we have lots of jobs. For example several plugins use system tools: Maven 2, SVN, ... We've already configured the paths to these tools, several versions even, in the global Hudson configuration.
          However, because of this bug, we have to replicate them for every job. Error prone and added complexity.
          New: The global properties system is not working as (I) expected. Tried using the Hudson release plugin, Tasks plugin, Ant build, can't pass any property.

          Steps:
          1. Enter Manage Hudson -> Configure system -> Global properties.
          2. Define a new global property: ABC, value 123.
          3. Try to access it from a task, from the release plugin, from an Ant build (via command line), using the documented syntax:
          $ABC or ${ABC}.
          4. Result - no replacement.

          This is pretty serious for us since we have lots of jobs. For example several plugins use system tools: Maven 2, SVN, ... We've already configured the paths to these tools, several versions even, in the global Hudson configuration.
          However, because of this bug, we have to replicate them for every job. Error prone and added complexity.

          akusuma added a comment -

          I have also tried this feature but does not work well.
          I set up a global variable ("Manage Hudson" - "Configure System" - "Global Properties" - "Environment variables") for my subversion repository so that I can refer to in the jobs that I have.
          Unfortunately, the variable is never set (tried $VARIABLE_NAME and ${VARIABLE_NAME} syntax).

          akusuma added a comment - I have also tried this feature but does not work well. I set up a global variable ("Manage Hudson" - "Configure System" - "Global Properties" - "Environment variables") for my subversion repository so that I can refer to in the jobs that I have. Unfortunately, the variable is never set (tried $VARIABLE_NAME and ${VARIABLE_NAME} syntax).

          dmichonneau added a comment -

          not working as well for shell commands and P4 plugin configuration

          dmichonneau added a comment - not working as well for shell commands and P4 plugin configuration

          sdashottar added a comment -

          Has there been any resolution on this issue. I am facing similar issue.
          I set an environment variable in global configure page and can access it in email notifications but modifications to the variable are not been reflected

          sdashottar added a comment - Has there been any resolution on this issue. I am facing similar issue. I set an environment variable in global configure page and can access it in email notifications but modifications to the variable are not been reflected

          mattbilson added a comment -

          I'm experiencing the same issue.

          Is there a workaround/different way to set a global ant property?

          mattbilson added a comment - I'm experiencing the same issue. Is there a workaround/different way to set a global ant property?

          Thomas McMurray added a comment - - edited

          I've got the same issue, running 1.515. More info. If the env variable is set before you start Jenkins, any changes you make on Configure System Global Properties are ignored. However, if you use the envinject plugin for the job, they are respected.

          Thomas McMurray added a comment - - edited I've got the same issue, running 1.515. More info. If the env variable is set before you start Jenkins, any changes you make on Configure System Global Properties are ignored. However, if you use the envinject plugin for the job, they are respected.

            ccaraivan Costin Caraivan
            ccaraivan Costin Caraivan
            Votes:
            13 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved: