美文网首页
2019-08-12 Maven__ERROR__target/

2019-08-12 Maven__ERROR__target/

作者: guyuetftb | 来源:发表于2019-08-12 15:31 被阅读0次

编译开源工程时,报以下错误,google得知是因为编译测试代码出错,导致整个工程编译停止。

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project flink-sql-core: There are test failures.
[ERROR]
[ERROR] Please refer to /Users/guyue/workspace_test/flink-sql/flink-sql-core/target/surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :flink-sql-core

解决办法一: 在POM.xml文件里增加跳过测试配置

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

解决办法二: 使用命令编译工程时, 指定跳过测试代码的语句

mvn clean package -Dmaven.test.skip -DskipTests=true

相关文章

网友评论

      本文标题:2019-08-12 Maven__ERROR__target/

      本文链接:https://www.haomeiwen.com/subject/sbeujctx.html