I have a plugin (antrun) with an execution configured which has an id and is not bound to any phase. Can I execute this execution directly from the command line?
<plugin> <artifactId>maven-antrun-plugin</artifactId> <executions> <execution> <id>my-execution</id> ... </execution> </executions> </plugin>
An run it with something like:
mvn my-execution
or at least
mvn magicplugin:execute -DexecutionId=my-execution
To build a Maven project via the command line, you use the mvn command from the command line. The command must be executed in the directory which contains the relevant pom file. You pass the build life cycle, phase or goal as parameter to this command.
Build plugins They execute during the build process and should be configured in the <build/> element of pom. xml.
This functionality has been implemented as MNG-5768, and is available in Maven 3.3.1.
The change will:
extend direct plugin invocation syntax to allow optional @execution-id parameter, e.g., org.apache.maven.plugins:maven-remote-resources-plugin:1.0:process@executionId.
So, in your case:
mvn antrun:run
uses the default-cli
execution ID, and:
mvn antrun:run@my-execution
uses the execution configured in your pom.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With