I have separated a Java EE project in the following submodules:
- project-war
- project-ejb
- project-ear
- project-test
I also have a root pom which includes the above modules. Since I have tests in a separate project, theres no point in running the test phases in the 3 first modules, as theres no point in compiling or packaging the last module since it only contains tests for the other 3 modules. My question is : How can I remove the test phases from the first 3 modules and how can I remove the other phases from the test project?
You can do that by setting up different profiles: http://maven.apache.org/guides/introduction/introduction-to-profiles.html
exp:
Which you would call the deploywar profile in a cli with
mvn -Pdeploywar -Denv=dev clean install