Невозможно создать проект maven с помощью командной строки - PullRequest
1 голос
/ 07 августа 2020

Я пытаюсь создать проект 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

Я использую maven C: \ apache -maven-3.6.3 использовать C: \ Program Files \ Java \ jdk-13.0.1

1 Ответ

0 голосов
/ 07 августа 2020

Проблема в том, что модульные тесты не пройдены. Модульный тест AppTest.testShouldBeFailed не прошел, поэтому сборка не пройдет.

Быстрое исправление, вы можете просто изменить assertTrue(false); на assertTrue(true);

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...