I execute the following code using mvn exec:java com.mycompany.FooServer.
I would like to add another server which I can execute like mvn exec:java co
For me including configuration in the execution block didn't work and maven complained about main class not being set. But inspired by Dario's answer I'd answer this question as follows:
foo
org.codehaus.mojo
exec-maven-plugin
1.3.2
com.mycompany.FooServer
bar
org.codehaus.mojo
exec-maven-plugin
1.3.2
com.mycompany.BarServer
Which then allows you to run one or the other server using:
mvn exec:java -Pfoo
or
mvn exec:java -Pbar
Cheers,