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
I'm afraid that what you want is not possible. I could not find a way to call the same exec-maven-plugin goal directly (mvn exec:java) with different configurations in .pom file.
Said that, you can however have multiple executions of exec-maven-plugin. The thing is you can not call the goals directly. You have to use multiple executions and bind them to particular build phases.
You could also make use of the following solution that fitted me. You can still call one goal directly with it's configuration in the .pom:
org.codehaus.mojo
exec-maven-plugin
1.3.2
Acceptance Tests
integration-test
exec
pybot
pt.jandias.someapp.persistence.SchemaGenerator
One could than use mvn exec:java and mvn integration-test at will.