0

For my build job I am trying to exclude some projects from my multi module projects. Sometimes the build going good by excluding them but sometimes it is trying build those by taking project packages. Following are the trace that I took from Jenkins success and fail build consoles.

Command I am using to build in Jenkins :

mvn clean install -DcreateChecksum=true -pl "!test-batchproject,!test-testapps/test-restws,!test-testapps/test-webdes,!test-testapps/test-testRest,!test-testapps/test-dashboard,!test-webEAR" -Dmaven.test.skip

Success build console :

<===[JENKINS REMOTING CAPACITY]===>channel started
Executing Maven:  -B -f C:\git\test\pom.xml -s C:\Users\sampuser\.m2\settings.xml 
clean install -DcreateChecksum=true -pl !test-batchproject,!test-testapps/test-restws,!test-testapps/test-webdes,!test-testapps/test-testRest,!test-testapps/test-dashboard,!test-webEAR -Dmaven.test.skip
[INFO] Scanning for projects...

Failed build console :

 <===[JENKINS REMOTING CAPACITY]===>channel started
Executing Maven:  -B -f C:\git\test\pom.xml -s C:\Users\sampuser\.m2\settings.xml -amd -pl com.inc.test:test-predep,com.inc.test:test-batchproject,com.inc.test:test-restws,com.inc.test:test-webdes,com.inc.test:test-testRest,com.inc.test:test-dashboard,com.inc.test:fold,com.inc.test:test-tools clean install -DcreateChecksum=true -pl !test-batchproject,!test-testapps/test-restws,!test-testapps/test-webdes,
!test-testapps/test-testRest,!test-testapps/test-dashboard,!test-webEAR -Dmaven.test.skip
[INFO] Scanning for projects...

I am not getting why it is reading projects that I want to exclude and it is happening only sometimes.

Your help is really appreciated.

User 0234
  • 95
  • 8
  • Is the same job running on the same Jenkins agent all the time or running on a different agent? -pl was introduced on Maven version 3.2.1 so make sure your maven version is the same across all the agents in Jenkins, otherwise, it will not work. A helpful stack overflow discussion can be found [here](https://stackoverflow.com/questions/8304110/skip-a-submodule-during-a-maven-build) – Samit Kumar Patel Jan 20 '21 at 13:27

0 Answers0