maven - 带有 mvn 测试的错误 Maven
问题描述
我是第一次使用这个工具,我无法正确构建项目。
当我尝试生命周期命令时,它通过干净的验证和编译成功构建。但是当我尝试 mvn test 时,它给了我这个错误:
[INFO] ---------------------------------------------------------------------
---
[INFO] BUILD FAILURE
[INFO] ---------------------------------------------------------------------
---
[INFO] Total time: 4.410 s
[INFO] Finished at: 2018-05-25T11:33:07+02:00
[INFO] ---------------------------------------------------------------------
---
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-
plugin:2.20.1:test (default-test) on project gdp: Execution default-test of
goal org.apache.maven.plugins:maven-surefire-plugin:2.20.1:test failed.
:NullPointerException
-> [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/PluginExecutionException
mvn -v 3.5.3 我正在使用代理,我确实配置了 settings.xml 文件请帮助。谢谢你
解决方案
通过以下方式更改 maven-surefire-plugin 的版本:
<project>
.
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.21.0</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
推荐阅读
- keras - Keras 密集层尺寸问题
- php - Laravel is not sending emails even configuration is right
- swiftui - SwiftUI ForEach 'identified(by:)' is deprecated. Use ForEach(_:id:) or List(_:id:)
- c++ - SAP Netweaver。C++ 错误:无法读取内存
- oracle - 无效字符 - 输入参数的美元符号未解码
- angular - Angular 8 - How to resolve 'ExpressionChangedAfterItHasBeenCheckedError'
- javascript - Code execution not happening in asyn function
- react-native - How to query graphQL with variables from React-Native?
- java - 如何为来自服务器的文件添加静态资源位置,但与应用程序所在的服务器不同
- google-bigquery - Legacy SQL - 此查询如何编译?