I have a maven-project where "need" to start a program with antrun (the need isn't reflected by the example below). By default antrun should be disabled as the example shows.
<execution>
<id>default-cli</id>
<phase>test</phase>
<configuration>
<skip>true</skip>
<tasks>
<delete dir="target/dependencies" />
<copy todir="target/dependencies" flatten="true">
</tasks>
</execution>
But in some of the automated environments we would like to enable it again. So I expected
mvn test -Dmaven.antrun.skip=false
to do the trick but that maven.antrun.skip only seems to work to disable the task and not to enable it again. The log just says "Skipping Antrun execution".
I also tried to run the task with
mvn antrun:run@default-cli
but the message stays the same.
So, how to disable antrun as default to be able to run it ad-hoc when needed?
Java8, Maven3.6, Antrun1.8
Define your own property in properties like
<properties>
<skip-default-cli>true</skip-default-cli>
</properties
Then, inside the execution, set <skip>${skip-default-cli}</skip>
.
On command line, you add -Dskip-default-cli=false
to activate the run.