当某个文件不存在时,我想跳过执行插件。有办法吗?
<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>
用配置文件包围插件定义。
可以根据文件的存在/不存在来激活配置文件。
https://maven.apache.org/guides/introduction/introduction-to-profiles.html
我希望上面的插件仅在存在剪切文件时才执行,因此如何用配置文件将其包围。放置个人资料时出现错误。
抱歉,“下方”没有任何内容。请编辑问题并在此处添加信息。
1.请不要将XML粘贴到注释中,而要编辑问题。2.请把它包装在一个配置文件中。如果这不起作用,请报告确切的错误消息。
感谢您的反馈。
那么,将其包装到配置文件中会发生什么?