mojohaus / mojohaus/exec-maven-plugin
how to pass command line arguments to exec:java as pom.xml variable/ parameter?
Open
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 191
- Forks
- 111
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 4
Description
how to pass command line arguments to exec:java as pom.xml variable/ parameter?
mvn clean install exec:java -Dexec.args="d"
mvn clean install exec:java -Dexec.args="s"
and then <mainClass>${mainClass.${args1}}</mainClass> can refer to ${mainClass.d}, ${mainClass.s} separately?
<properties>
<mainClass.d>io.DumpBatch</mainClass.d>
<mainClass.s>io.Stream</mainClass.s>
</properties>
...
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<mainClass>${mainClass}</mainClass>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
<mainClass>${mainClass}</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the exec:java configuration and Maven command examples in the issue, then check the plugin documentation and Maven property-handling guidance. Confirm whether command-line values can select the configured main class, and document the supported approach or limitation with a working example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- build-system
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100