Reputation: 129
A multi module maven project.
Project ABC -- Module A -- Module B -- Module C
Module B has Module A dependency.
Want to run test cases of only Module B. But build all modules.
Note :I need a mvn command which builds dependent module A first(no test case of this module should run).. then run test case of module B only.. mvn command from parent..
Update ::
I tried this command
mvn test -am -DfailIfNoTests=false -pl B
Problem is its running module A test cases also. but i don't want to run module A test case. I want only module B test case to be running.
Upvotes: 7
Views: 3982
Reputation: 2480
Build and execute a specific test from a specific sub module:
mvn test -DfailIfNoTests=false -Dtest=test-class-name -pl submodule
As your submodule depends on other submodule you need -DfailIfNoTests=false
Upvotes: 4