Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to Build in Jenkins with Maven Build Profile

I am trying to build a maven project in Jenkins with Build Profile ID of pom.xml. But Jenkins is only building with dev profile and not catching any of other profiles. with the same pom.xml.

I've tried building on command prompt and it's working fine, I just cannot do it in Jenkins.

like image 340
Diwakar Avatar asked Jan 23 '26 21:01

Diwakar


1 Answers

I am having similar issue running maven 3.3.9 from Jenkins ver. 2.138. So far, with time consuming trial and error, I have found that Jenkins does not tolerate a space between the -P and the profile name AND it can only handle a single profile. So you should be able to get something like this to work:

mvn groupId:artifactId:goal -Pprofile-1-only

like image 102
Dr. Java Avatar answered Jan 26 '26 17:01

Dr. Java