I have read here about unit testing with the Surefire plugin and integration testing with the Failsafe plugin, but I am still unclear about how the POMs should look in a Maven project that consists of a parent and multiple child modules, each with their own POM file.
Questions:
- Has anyone implemented integration tests and unit tests in each of their modules?
- If so, would you be so kind as to show your POMs so I have an example of a good working configuration?
See my answer to question: How can I switch between two test suites in Maven 2?
I prefer maven module – very easy to implement and you do not need knowledge about other plugin.
If you using testng you can just define in your parent pom (one place only):
Annotate all integration tests by:
If you use junit see Category
You run normal test by:
mvn clean installintegration tests bymvn -Pintegration clean install