Working with the Jenkins Matrix with Commas

I am trying to complete a jenkins task that uses the Configuration Matrix to create several versions of my application using different maven profiles. My initial idea was to create a set of configurations under the guise of a profile such as:

XXX, YYY, ZZZ

XXX, YYY, AAA

then use the build command: Profile mvn -P $

To get all the different builds.

Unfortunately, this does not work, Jenkins is confused, apparently, with the help of commas in the matrix of configurations. I tried to see if URL encoding worked (this happened later, but the actual maven command failed because it included the encoded version with commas, which confused maven).

I understand that I can put a meaningless character that is allowed, and then in the script replace it with a comma, but this does not seem correct. There must be a better way. Any ideas?

+7
source share
2 answers

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

My configuration is as follows:

enter image description here

Maven team

Maven Team

+1
source

Have you tried spaces instead of commas?

In the help link Values assigned to variables. Multiple values are separated by whitespace or newlines. Use shell quoting syntax for a value that contains whitespace. Values assigned to variables. Multiple values are separated by whitespace or newlines. Use shell quoting syntax for a value that contains whitespace.

Screenshot from Jenkins matrix configuration

0
source

All Articles