I want to skip executing a plugin when a certain file does not exist. Is there a way to do it?
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<id>add-test-source</id>
<phase>generate-test-sources</phase>
<goals>
<goal>add-test-source</goal>
</goals>
<configuration>
<sources>
<source>${customFolder}</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
Surround the plugin definition with profile.
Profiles can be activated depending on the existence/non-existence of a file.
https://maven.apache.org/guides/introduction/introduction-to-profiles.html
I want the above plugin to execute only when cuts file is present so how do I surround it with profile. I'm getting error when I place profile.
Sorry, there is nothing "below". Please edit the question and add the information there.
1. Please don't paste XML into comments, instead edit the question. 2. Please wrap it in a profile. If this does not work, report the exact error message.
Thanks for the feedback.
So, what happens when you wrap it into a profile?