How do I execute a program using Maven?
- by Will
I would like to have a Maven goal trigger the execution of a java class. I'm trying to migrate over a Makefile with the lines:
neotest:
mvn exec:java -Dexec.mainClass="org.dhappy.test.NeoTraverse"
And I would like mvn neotest to produce what make neotest does currently.
Neither the exec plugin documentation nor the Maven Ant tasks pages had any sort of straightforward example.
Currently, I'm at:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.1</version>
<executions><execution>
<goals><goal>java</goal></goals>
</execution></executions>
<configuration>
<mainClass>org.dhappy.test.NeoTraverse</mainClass>
</configuration>
</plugin>
I don't know how to trigger the plugin from the command line, though.