How can I disable maven-antrun-plugin execution when certain file already exists?:
[...]
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<phase>test</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<!-- do something really complex in order to create file.txt -->
</target>
</configuration>
</execution>
</executions>
</build>
[...]
The execution takes some time and I don't want to repeat it every time when file.txt
is already there.
Check for the presence of the file in your standalone Ant file. Example:
<target name="check-file">
<available file="foo.bar" property="fileExists" />
</target>
<target name="time-consuming" depends="check-file" unless="fileExists">
...
</target>
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