如果某个文件已经存在,如何禁用 antrun?
当某些文件已经存在时,如何禁用 maven-antrun-plugin 执行? :
[...]
<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>
[...]
执行需要一些时间,我不想每次当 file.txt
已经存在时都重复执行。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
检查独立 Ant 文件中是否存在该文件。例子:
Check for the presence of the file in your standalone Ant file. Example:
使用仅在
file.txt
不存在时才处于活动状态的
:参考:
Use a
<profile>
that's only active iffile.txt
doesn't exist:Reference: