I am afraid that what you want is impossible . I could not find a way to directly call the same path to exec-maven-plugin ( mvn exec:java ) with various configurations in the .pom file.
It is said that you can have several exec-maven-plugin executions . The fact is that you cannot directly name goals. You must use several executions and bind them to specific build steps.
You can also use the following solution that fits me . You can still directly name one target as your configuration in .pom:
<plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <version>1.3.2</version> <executions> <execution> <id>Acceptance Tests</id> <phase>integration-test</phase> <goals> <goal>exec</goal> </goals> <configuration> <executable>pybot</executable> <arguments> </arguments> </configuration> </execution> </executions> <configuration> <mainClass>pt.jandias.someapp.persistence.SchemaGenerator</mainClass> <arguments> </arguments> </configuration> </plugin>
You can use mvn exec:java and mvn integration-test as desired.
José Andias Sep 11 '14 at 2:57 a.m. 2014-09-11 14:57
source share