Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins Matrix job with commas

Tags:

maven

jenkins

I am trying to make a jenkins job that uses a Configuration Matrix in order to build multiple versions of my application using different maven profiles. My initial idea was to create a bunch of configurations under the guise of a profile like:

XXX,YYY,ZZZ

XXX,YYY,AAA

then as the build command use: mvn -P $profile

To get all the different builds.

Sadly this does not seem to work, Jenkins gets confused seemingly by the use of commas in the configuartion matrix. I tried seeing if url encoding worked (it got further but the actual maven command failed because it contained the url encoded version of commas which confused maven).

I realise I could put in a pointless character that is allowed and then in a script replace it with a comma, but that doesn't seem correct. There has to be a better way. Any ideas?

like image 967
Paul Harris Avatar asked Nov 27 '12 16:11

Paul Harris


1 Answers

You can specify multiple Maven profiles without using commas with -Pprofile1 -Pprofile2 and use quotes to escape the spaces.

My configuration matrix looks like this:

enter image description here

The maven command is

Maven Command

like image 154
AAudibert Avatar answered Oct 10 '22 11:10

AAudibert