Let's say that my standard configration in Maven is:
- compile, test and package - do their normal thing
- pre-integration-test:
- Generate DB schema scripts (maven-antrun-plugin with concat)
- Run those scripts on DB (sql-maven-plugin)
- Run a custom Java program to populate DB with data (exec or antrun)
- Start server from jar (maven-antrun-plugin, because exec wouldn't fork)
- integration-test: run tests using the server running from jar
- post-integration-test: stop the server (exec)
With normal execution path it works just fine (modulo bugs in Maven plugin ordering, besides the point).
Now, I would like to have a single command to only generate and execute the DB schema scripts, and another command to only run the Java program to populate database.
So far I figured I could put install-schema, populate-db and start-jetty in their own profiles, then:
mvn pre-integration-test -Pinstall-schema
This is bad, because it still would run all the preceding phases, and I really don't want to compile, test and package for it.
Is it possible to somehow run those "things" (several plugin executions, a profile) in isolation, ignoring the lifecycle or skipping compile-test-package?