maven编译时出现There are test failures

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.10:test (default-test) on project web_nanchang: There are test failures.

[ERROR]

[ERROR] Please refer to E:\maven\web_nanchang\target\surefire-reports for the individual test results.

解决方法:

这是因为测试代码时遇到错误,它会停止编译。只需要在pom.xml的<project>里添加以下配置,使得测试出错不影响项目的编译。

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
                <testFailureIgnore>true</testFailureIgnore>            </configuration>
        </plugin>
    </plugins>
</build>


参考文件:http://cache.baiducontent.com/c?m=9d78d513d99c12eb0fb1837f7d01d7100e55f0227b9787027ea4c713d3334c403771e3cd302360468d82293c5db8482cfdf14565367320a09ab89f4aaaac93582c8c3035000b873205d269e99c0763d620e14de9de0ee6caa665c7fd958d994352ba44050c97f1fb1c57558c78f06526e3d78e4965024caded4127bf042f7ece6557b636a3b364335ac3e1dc2c5bc35cc76061c6f26aef634ea212d4081a5753a03df752063277a01128a5027b4685ea2efa37291e7ee35fb3ce90f7bd149bdc9d6dcfbcd6f17ecf77e1b1bba56c113014a174e0fca0e46a221659878bc31cc432bbfceab0&p=8560d50788904ead0fbd9b7e0c1183&newp=81769a47889c1eed11bd9b7e0c1198231610db2151d3d51e218bcc0ada&user=baidu&fm=sc&query=maven-surefire-plugin%3A2.16%3Atest+%28default-test%29+on+project+hadoop-common%3A+There+are+test+failures&qid=&p1=1

你可能感兴趣的:(test,are,There,failures.)