Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Tests for a specific module under a project in Jenkins through maven?

I use Jenkins to build my project which has multiple modules. This project has a root pom.xml which build all the modules under that project. I specify this pom.xml as the root POM.

Now I want to run tests as a "post-build step". But, I don't want to run all the tests under all modules. I want to run tests only under a specific module.

I tried using the shell command to change the directory to the module for which tests has to be run and then trigger maven. I also tried using the -f switch to specify the pom.xml for that particular module. Both of these steps are not working.

Please help me guys in resolving this problem.

Thanks

like image 224
user1522820 Avatar asked Nov 29 '12 08:11

user1522820


1 Answers

Just run from the root path:

mvn -pl :submodule test

protip: mvn --help

like image 86
khmarbaise Avatar answered Oct 17 '22 00:10

khmarbaise