[英]How to fix Micronaut maven build failure
I'm trying to mvn clean install, but it fails with the message: There are test failures.我正在尝试 mvn 全新安装,但失败并显示以下消息:存在测试失败。 When I run all tests using IDE they pass and I need to skip tests.当我使用 IDE 运行所有测试时,它们都通过了,我需要跳过测试。
Annotation processors it's enable as described here Configuring IntelliJ IDEA注释处理器,如配置 IntelliJ IDEA 中所述启用
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running dev.renansouza.document.DocumentFlowTest
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.011 sec
Running dev.renansouza.document.DocumentControllerTest
Tests run: 6, Failures: 6, Errors: 0, Skipped: 0, Time elapsed: 0.058 sec <<< FAILURE!
dev.renansouza.document.DocumentControllerTest.testInvoiceFailed() Time elapsed: 0.039 sec <<< FAILURE!
java.lang.NullPointerException
at dev.renansouza.document.DocumentControllerTest.testInvoiceFailed(DocumentControllerTest.java:35)
dev.renansouza.document.DocumentControllerTest.testInvoiceSuccess() Time elapsed: 0.002 sec <<< FAILURE!
java.lang.NullPointerException
at dev.renansouza.document.DocumentControllerTest.testInvoiceSuccess(DocumentControllerTest.java:45)
dev.renansouza.document.DocumentControllerTest.testSendZipFile() Time elapsed: 0.001 sec <<< FAILURE!
java.lang.NullPointerException
at dev.renansouza.document.DocumentControllerTest.testSendZipFile(DocumentControllerTest.java:57)
dev.renansouza.document.DocumentControllerTest.testSendYmlFile() Time elapsed: 0.001 sec <<< FAILURE!
java.lang.NullPointerException
at dev.renansouza.document.DocumentControllerTest.testSendYmlFile(DocumentControllerTest.java:80)
dev.renansouza.document.DocumentControllerTest.testInvoiceSuccessJWTToken() Time elapsed: 0.002 sec <<< FAILURE!
java.lang.NullPointerException
at dev.renansouza.document.DocumentControllerTest.testInvoiceSuccessJWTToken(DocumentControllerTest.java:102)
dev.renansouza.document.DocumentControllerTest.testJWTTokenRefresh() Time elapsed: 0.001 sec <<< FAILURE!
java.lang.NullPointerException
at dev.renansouza.document.DocumentControllerTest.testJWTTokenRefresh(DocumentControllerTest.java:115)
Running dev.renansouza.document.DocumentEnvironmentTest
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.019 sec
Results :
Failed tests: dev.renansouza.document.DocumentControllerTest.testInvoiceFailed()
dev.renansouza.document.DocumentControllerTest.testInvoiceSuccess()
dev.renansouza.document.DocumentControllerTest.testSendZipFile()
dev.renansouza.document.DocumentControllerTest.testSendYmlFile()
dev.renansouza.document.DocumentControllerTest.testInvoiceSuccessJWTToken()
dev.renansouza.document.DocumentControllerTest.testJWTTokenRefresh()
Tests run: 6, Failures: 6, Errors: 0, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 22.813 s
[INFO] Finished at: 2019-07-09T11:04:27-03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project invoice-unpack: There are test failures.
[ERROR]
[ERROR] Please refer to /Users/renan/git/document-unpack/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
The code can be found here: https://github.com/renansouza-dev/document-unpack代码可以在这里找到: https : //github.com/renansouza-dev/document-unpack
You have not configured the surefire plugin.您尚未配置surefire插件。 This requirement is described at https://micronaut-projects.github.io/micronaut-test/latest/guide/index.html#junit5 .此要求在https://micronaut-projects.github.io/micronaut-test/latest/guide/index.html#junit5 中有所描述。
You want something like https://github.com/jeffbrown/document-unpack/commit/724bac324130bd73a06e05f9129cae7e8e8eb1b4 .你想要类似https://github.com/jeffbrown/document-unpack/commit/724bac324130bd73a06e05f9129cae7e8e8eb1b4 的东西。
I have submitted a PR at https://github.com/renansouza-dev/document-unpack/pull/4 .我已经在https://github.com/renansouza-dev/document-unpack/pull/4提交了 PR。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.