使用 pom 文件从目标目录中删除或删除资源文件 [英] Remove or delete resource files from target directory using pom file
本文介绍了使用 pom 文件从目标目录中删除或删除资源文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在 pom.xml 中有两个配置文件,我有一些资源文件已添加到目标资源目录中: ${project.build.outputDirectory}/resources
在第一个配置文件执行期间.我需要做的是在执行第二个配置文件期间删除这些资源文件.有没有办法从目标目录中删除或删除现有文件?
I have two profiles in pom.xml, and I have some resource files which I have added into target resource directory: ${project.build.outputDirectory}/resources
during execution of the first profile. What I need to do is remove those resource files during execution of the second profile.
Is there any way to remove or delete existing files from target directory?
推荐答案
我得到了解决方案..!!
I got the solution..!!
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<phase>test</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<delete>
<fileset dir="${project.build.outputDirectory}/resources" includes="*.xml" />
</delete>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
供参考 - http://maven.apache.org/guides/mini/guide-building-for-different-environments.html
这篇关于使用 pom 文件从目标目录中删除或删除资源文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文