【发布时间】:2016-02-01 06:53:55
【问题描述】:
编辑:已解决 我在我的 pom 中配置了两次..
我正在 Maven 中设置生产配置文件。为了复制正确的 production.properties-files 并删除标准文件,我使用的是 maven-antrun-plugin。
但我不想运行任何测试。出于某种原因,这个插件试图运行一些不工作的 canoo-web-tests(并且不应该工作,因为它们从未被使用过)。
关于如何让 antrun 插件只复制文件有什么想法吗?
这是antrun代码:
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<delete file="${project.build.outputDirectory}/properties/externalResources.properties"/>
<delete file="${project.build.outputDirectory}/properties/externalResources.prod.properties"/>
<copy file="src/main/resources/properties/externalResources.prod.properties"
tofile="${project.build.outputDirectory}/properties/externalResources.properties"/>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
这是显示它尝试进行一些测试的错误:
[INFO] Executing tasks
[delete] Deleting: C:\xxx\target\classes\properties\externalResources.properties
[delete] Deleting: C:\xxx\target\classes\properties\externalResources.prod.properties
[copy] Copying 1 file to C:\xxx\target\classes\properties
Trying to override old definition of task retry
[echo] Testing 'XXX-1.2.0' with
[echo] locale 'no'
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
然后是一个堆栈跟踪,显示它尝试读取 web-tests.xml,并且由于该文件有错误,因此构建失败。
【问题讨论】:
-
我想通了。我之前已经将它配置为进行测试..愚蠢的我..