I have a package with several classes (each one encapsulating an executable program, i.e. with a main() method), i.e.:
com.myorg.examples.classA
com.myorg.examples.classB
etc.
All the classes belong to the same package (com.myorg.examples
).
I know I can use maven to run one of such classes, eg:
mvn exec:java -D"exec.mainClass"="com.myorg.examples.classA"
I also know I can configure exec-maven-plugin in order to do the same using a shorter command, eg:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>com.myorg.examples.classA</mainClass>
</configuration>
</plugin>
then use:
mvn exec:java
However, I wonder if it would be possible:
To use the exec-maven-plugin (or antoher one) to configure the several executions and do something like this
mvn exec:classA # or, mvn exec:java classA
so classA is run, but using a shorter syntax than plain exec:java. Looking to the XML structure it seems only one class can be set, so I'm not sure how to achieve that.
To execute all the classes, in sequence, eg:mvn exec-all
in order to run classA, next classB, and so on.
Any help or link about these topics will be highly welcomed. Thanks!
EDIT: second part of the question has been spined off to this other post.