0
EDIT停止Maven的antrun-插件:解决 我曾在我的POM两次配置吧..如何从运行测试
我设立在行家生产瞩目。为了复制正确的production.properties文件并删除标准文件,我使用了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>
,这里是错误显示它试图做一些测试:是一个堆栈跟踪显示,它试图读取Web的
[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] ------------------------------------------------------------------------
然后tests.xml,并且由于该文件有错误,构建失败。
也许跳过测试将有助于:http://maven.apache.org/plugins/maven-surefire-plugin/examples/skipping-test.html – 2012-04-20 12:21:02
我想通了。我已经配置它在早些时候测试..愚蠢的我.. – user829237 2012-04-20 12:30:45