I have a project configured to build and run with Maven. The project depends on platform specific native libraries, and I\'m using the strategy found here to manage those d
I managed to find a reasonably elegant solution to my problem using Maven environment variables.
The default values are defined as properties in the pom, and added to the exec plugin as arguments:
...
defaultA
defaultB
...
org.codehaus.mojo
exec-maven-plugin
1.2.1
java
-Djava.library.path=${project.build.directory}/lib
-classpath
com.example.app.MainClass
-a
${argumentA}
-b
${argumentB}
...
Now I can run with default parameters exactly as I did before:
mvn exec:exec
And I can easily override the defaults for each argument at the command line using:
mvn exec:exec -DargumentA=alternateA -DargumentB=alternateB