Małe przypomnienie faz:
- validate - validate the project is correct and all necessary information is available
- compile - compile the source code of the project
- test - test the compiled source code using a suitable unit testing framework. These tests should not require the code be packaged or deployed
- package - take the compiled code and package it in its distributable format, such as a JAR.
-
integration-test - process and deploy the package if necessary into an environment where integration tests can be run
- verify - run any checks to verify the package is valid and meets quality criteria
- install - install the package into the local repository, for use as a dependency in other projects locally
- deploy - done in an integration or release environment, copies the final package to the remote repository for sharing with other developers and projects.
W fazie pre-integration-test powinieneś przygotować środowisko (serwer, przegrać ear/war/jar).
W fazie integration-test wykonają się testy, a w fazie post-integration-test należy posprzątać.
Najlepiej wykonywać od razu mvn verify.
Można to zrobić na kilka sposobów:
http://jakarta.apache.org/cactus/integration/maven2/index.html
http://docs.codehaus.org/display/MAVENUSER/Maven+and+Integration+Testing
P.S.
Nawet jeżeli chcesz kopiować pliki, to nie musisz do tego tworzyć własnego plugina.
Wystarczyło użyć maven-antrun-plugin z zadaniem Copy (http://maven.apache.org/plugins/maven-antrun-plugin/usage.html)
albo maven-resources-plugin (http://maven.apache.org/plugins/maven-resources-plugin/examples/copy-resources.html).