vegemite4me
vegemite4me

Reputation: 6856

Jenkins - During a Maven release how can the user select the profile to use?

I have two profiles in my Maven project (foo and bar) and I need the user to select a profile when they perform a release in Jenkins.

How can I force the user to select a Maven profile during the release?

To be clear, I am only talking about the Perform Maven Release. I do not need the parameter when building.

Ideally this would be on the same page where the user has to enter the versions for the release.

I have tried ticking Configure release build (in the section titled Build Environment), and adding a Choice Parameter, but I am never prompted when I click on Perform Maven Release.

enter image description here

enter image description here

Upvotes: 1

Views: 398

Answers (1)

Jens
Jens

Reputation: 69440

Use a parametrized build and add a Parameter activeProfile, which can have the values foo and bar. Then you add -P${activeProfile} to the release command line

Upvotes: 3

Related Questions