In my POM.xml file for my android project I have created six profiles. I run these from the command line like mvn clean install -P mdpi. This works fine. Now I am using jenkins for my CI. I want the user to be presented with a drop down list of all profiles and then use mvn clean install -P ${selected-profile}
so the ${selected-profile}
variable contains the profile for the build. How can i do this?
I suggest you to install the parametrized build plugin which will allow you to display a list of options to your job user. To enable it you'll have to check 'this build is parametrized' option and then define option.
To be able to define list option you'll then have to install extended choice parameter plugin that extends the first one by adding list option (and other parameter types).
You'll then be able to define a PROFILE list option. The selected option name will be stored in the parameter name.
The maven cmdline: 'mvn clean install -P${PROFILE}' will then work as you expect.
I hope this helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With