To Jason:
If we take the "simple" example of a self-contained web application with just a single WAR artifact, I think that requiring a multi-module build is kind of overkill. (In an enterprise scenario, I can see separating out the tests, especially if there is a client generated from the single WAR artifact, as is the case with Web Services...)
Hypothetically, let's look at a multi-module with the first module building the WAR file, and a second module to test the WAR file. What stops a developer from going down to the first module and just building/deploying that artifact? Now, the artifact is uploaded to whatever internal repository without being tested.
One of the things I really cherish about the Maven lifecycle is how it enforces that tests must pass before the artifact makes out of the local box...
To John:
I do think these phases are important, for all the same reasons they are important before the (unit) tests. And, much like what I said above, I think it is very important to test before it gets out of the current developer's workspace. You are right, we probably won't have many people typing "mvn process-integration-test-resources" (other than the build developers who want to test up to that point...), but we sure will have people typing "mvn install". And in my opinion, having the integration tests do their thing before that 'install' point is muy importante...
Also, there is already provision for doing post-processing for cleanup, it's the "post-integration-test"... And if you are talking about using the (unit) test functionality for doing the post-processing stuff in a multi-module build, that is why I added the "post-test" phase in my submitted patch...
To No One In Particular:
I believe the two parallel cycles of 'test' and 'integration-test' are important for robust artifacts. The (unit) tests serve to test as a white-box, co-locate type of environment, and the integration tests serve to test the artifact like a black-box, separate client.
I am attaching the patch(es) that I've made to address this.
Here's my description:
, and b) I have found a need for those phases in the past.
1) I added the five phases above.
2) I have also added a "pre-test" and "post-test" around the standard "test" target. This is for two reasons: a) it's appeals to my sense of symmetry
3) I added comments to a method that assumes the phase names across different lifecycles are unique.
4) I added some tests of the model objects that get created.
5) I added a couple of tests that enforce unique phase names.
6) I added the documentation of these build phases to the "The Build Lifecycle" mini-guide.
I was able to get the "site" documentation to build successfully. Though I was able to get the "maven-lifecycle" to build successfully, I was not able to get all the "components" to build successfully. So, I downloaded a fresh copy, and the failure happened in the same place. ("BuildPlan" is missing in the "maven-core" component?) I figured that if "maven-lifecycle" build correctly, and the "components" failed in the same place as a fresh pull-down, I have "done no harm", and am fairly confident that my changes will work as expected.
I did the changes against the main-line, though this JIRA seems to indicate I should have done it against 2.0.X...? I think my changes should still fit in well...
After this, I will continue looking into the compile and surefire plugins...