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

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

XMLWordPrintable

    • 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.

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

              Created:
              Updated: