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

Can not use jenkins Environment variable to parameterize maven Profile via -P option

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • maven-plugin
    • None

      Jenkins exposes the ability to use Jenkins Environment variables to pass parameters to a maven builds in the "goals and options" field of the jenkins job definition..

      Specification of "-P ${myProfile}" in the "goals and options" field of a maven build will not cause the ${myProfile} slave variable to be substituted in the job invocation. Trace message says

      "The requested profile "${myProfile}" could not be activated because it does not exist.

      which of course is a true statement, becuase ${myProfile} "should" have been substituted for the valid ${myProfile} value specified on the slave the job was invoked on.

      Not using a jenkins variable for the profile value does work (for example -P profileName) does activate the specified profile.

          [JENKINS-10382] Can not use jenkins Environment variable to parameterize maven Profile via -P option

          Scott MacDonald created issue -
          Scott MacDonald made changes -
          Description Original: Jenkins exposes the ability to use Jenkins Environment varibales to parameterize a builds in the "goals and options" field of a maven build..

          Specification of "-P ${myProfile}" in the "goals and options" field of a maven build will not caisse the ${myProfile} slave varibale to be substituted in the job invocation. Trace message says

          "The requested profile "${myProfile}" could not be activated because it does not exist.

          which of course is a true statement, becuase ${myProfile} "should" have been substituted for the valid ${myProfile} value specified on the slave the job was invoked on.

          Not using a jenkins variable for the profile value does work (for example -P profileName) does activate the specified profile.

          New: Jenkins exposes the ability to use Jenkins Environment variables to pass parameters to a maven builds in the "goals and options" field of the jenkins job definition..

          Specification of "-P ${myProfile}" in the "goals and options" field of a maven build will not cause the ${myProfile} slave variable to be substituted in the job invocation. Trace message says

          "The requested profile "${myProfile}" could not be activated because it does not exist.

          which of course is a true statement, becuase ${myProfile} "should" have been substituted for the valid ${myProfile} value specified on the slave the job was invoked on.

          Not using a jenkins variable for the profile value does work (for example -P profileName) does activate the specified profile.

          Summary Original: Can not use jenkins Enviroment variable to parameterize maven Profile via -P option New: Can not use jenkins Environment variable to parameterize maven Profile via -P option
          Jenkins IRC Bot made changes -
          Component/s New: maven-plugin [ 16033 ]
          Component/s Original: maven2 [ 15487 ]

          Martin Meyer added a comment -

          Any update on this? This was created in 2011 and still not working.

          Note: Obviously, this affects all env variable substitution in the maven build step, not just to specify a profile...

          Martin Meyer added a comment - Any update on this? This was created in 2011 and still not working. Note: Obviously, this affects all env variable substitution in the maven build step, not just to specify a profile...

          Mirko Raner added a comment -

          Yeah, I'm surprised, too... this seems to be pretty basic functionality... is there a trick to using build parameters and environment variables on the Maven command line?

          Mirko Raner added a comment - Yeah, I'm surprised, too... this seems to be pretty basic functionality... is there a trick to using build parameters and environment variables on the Maven command line?

          Mirko Raner added a comment -

          Still appears to be broken as of Jenkins 1.586

          Mirko Raner added a comment - Still appears to be broken as of Jenkins 1.586
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 140574 ] New: JNJira + In-Review [ 175308 ]

            Unassigned Unassigned
            scanguskhan Scott MacDonald
            Votes:
            7 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated: