无法使用命令行生成maven项目

无法使用命令行生成maven项目,maven,Maven,我正在尝试使用命令行构建maven项目 c:\data\maven-demo\maven-test-project\Java>mvn test 我在c:\data\maven demo\maven test project\Java中拥有什么 我有这样的错误: 在这里输入代码 [WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependen

我正在尝试使用命令行构建maven项目

c:\data\maven-demo\maven-test-project\Java>mvn test

我在c:\data\maven demo\maven test project\Java中拥有什么

我有这样的错误:

在这里输入代码


[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 1 source file to c:\data\maven-demo\maven-test-project\Java\target\test-classes
[INFO]
[INFO] --- maven-surefire-plugin:3.0.0-M1:test (default-test) @ hello-ci ---
[INFO]
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running com.github.vitalliuss.helloci.AppTest
[ERROR] Tests run: 5, Failures: 1, Errors: 0, Skipped: 1, Time elapsed: 0.031 s <<< FAILURE! - in com.github.vitalliuss.helloci.AppTest
[ERROR] testShouldBeFailed(com.github.vitalliuss.helloci.AppTest)  Time elapsed: 0.006 s  <<< FAILURE!
java.lang.AssertionError
        at com.github.vitalliuss.helloci.AppTest.testShouldBeFailed(AppTest.java:21)

[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR]   AppTest.testShouldBeFailed:21
[INFO]
[ERROR] Tests run: 5, Failures: 1, Errors: 0, Skipped: 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  2.382 s
[INFO] Finished at: 2020-08-06T16:40:02+03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M1:test (default-test) on project hello-ci: There are test failures.
[ERROR]
[ERROR] Please refer to c:\data\maven-demo\maven-test-project\Java\target\surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
[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

[警告]尚未使用平台编码Cp1252设置文件编码,即生成依赖于平台!
[信息]正在将1个源文件编译为c:\data\maven demo\maven test project\Java\target\test classes
[信息]
[信息]---maven surefire插件:3.0.0-M1:test(默认测试)@hello ci---
[信息]
[信息]-------------------------------------------------------
[信息]
[信息]-------------------------------------------------------
[信息]正在运行com.github.vitalliuss.helloci.AppTest

[错误]测试运行:5,失败:1,错误:0,跳过:1,经过的时间:0.031s问题在于单元测试失败。单元测试
AppTest.testshouldbeailed
失败,因此生成无法通过


快速修复,您只需更改
assertTrue(false)带有
资产true(true)

问题在于单元测试失败。单元测试
AppTest.testshouldbeailed
失败,因此生成无法通过


快速修复,您只需更改
assertTrue(false)带有
资产true(true)

或者(如果只是构建目标),运行
mvn compile
或者
mvn install-DskipTests
是的,这很有帮助。Thanksor(如果只是构建是目标),运行
mvn compile
mvn install-DskipTests
Yes它很有帮助。谢谢