I have a Maven POM file with a plugin that runs on the test phase. What command line arguments do I have to pass mvn in order to execute just that plugin rather than all of the plugins for that phase? I am also trying to execute a specific ant-run plugin, that looks like the following:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-antrun-plugin</artifactId> <version>1.3</version> <dependencies> <dependency> <groupId>com.googlecode.jslint4java</groupId> <artifactId>jslint4java-ant</artifactId> <version>1.3.3</version> </dependency> </dependencies> <executions> <execution> <id>jslint</id> <phase>test</phase> <goals> <goal>run</goal> </goals> <configuration> <tasks> <ant antfile="${basedir}/jslint.xml"> <property name="root" location="${basedir}" /> <target name="jslint" /> </ant> </tasks> </configuration> </execution> </executions> </plugin>
Thanks.
Best Answer
Specify the fully-qualified goal in the form of:
For example:
EDIT: I'm modifying my answer to cover the update of the initial question and a comment from the OP.
I won't cover all the details but, it the particular case of the antrun plugin, you could just run:
But now that you've updated the question, I understand that things are a bit more complicated than what I thought initially and I don't think that this will actually work. I mean, invoking
mvn antrun:run
won't fail but it won't pick up theconfiguration
of theexecution
bound to thetest
phase.The only (ugly) solution I can think of would be to add another maven-antrun-plugin configuration in a specific profile, something like this:
And to use this profile when calling
antrun:run
: