Issue
I tried build locally:
mvn -B verify
All works fine.
.gitlab-ci.yml :
image: maven:latest
verify-job:
script:
- mvn -B verify
After checked several modules maven. I get error:
[INFO] Tree 1.0-0 ......................................... FAILURE [ 7.587 s]
... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:35 min
[INFO] Finished at: 2018-12-25T13:51:57Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project Tree: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test failed: The forked VM terminated without saying properly goodbye. VM crash or System.exit called ? -> [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
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :Tree
ERROR: Job failed: exit code 1
no module uses dependency org.apache.maven.plugins:maven-surefire-plugin I checked another answers on SO with the same error, no one is related with CI GitLab integration. I can guess it's related to ktlint, but why local builds are successful?
Solution
I find a solution: just add to pom.xml
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M1</version>
</plugin>
Answered By - Dmitry Sokolov
Answer Checked By - Clifford M. (JavaFixing Volunteer)