web-dev-qa-db-fra.com

Une erreur Maven s'est produite au démarrage du fork, vérifiez la sortie dans le journal

J'utilise Maven, docker-maven-plugin et Spring Boot. En ce moment, je rencontre le problème suivant:

[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 03:08 min
[INFO] Finished at: 2018-03-30T20:31:08+03:00
[INFO] Final Memory: 76M/1162M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.Apache.maven.plugins:maven-failsafe-plugin:2.20.1:verify (default) on project domain: There are test failures.
[ERROR]
[ERROR] Please refer to D:\Projects\decisionwanted\domain\target\failsafe-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date]-jvmRun[N].dump, [date].dumpstream and [date]-jvmRun[N].dumpstream.
[ERROR] org.Apache.maven.surefire.booter.SurefireBooterForkException: The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
[ERROR] Command was cmd.exe /X /C "c:\Java\jdk1.8.0_162\jre\bin\Java -jar C:\Users\ALEXAN~1\AppData\Local\Temp\surefire7684467242957210997\surefirebooter6934205730694228299.jar C:\Users\Alexander\AppData\Local\Temp\surefire7684467242957210997 2018-03-30T20-28-03_824-jvmRun1 surefire8708053899862809316tmp surefire_06397887630134904290tmp"
[ERROR] Error occurred in starting fork, check output in log
[ERROR] Process Exit Code: 1
[ERROR] Crashed tests:
[ERROR] com.decisionwanted.domain.DecisionCharacteristicIT
[ERROR]         at org.Apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.Java:686)
[ERROR]         at org.Apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.Java:535)
[ERROR]         at org.Apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.Java:280)
[ERROR]         at org.Apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.Java:245)
[ERROR]         at org.Apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.Java:1124)
[ERROR]         at org.Apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.Java:954)
[ERROR]         at org.Apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.Java:832)
[ERROR]         at org.Apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.Java:134)
[ERROR]         at org.Apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.Java:208)
[ERROR]         at org.Apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.Java:154)
[ERROR]         at org.Apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.Java:146)
[ERROR]         at org.Apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.Java:117)
[ERROR]         at org.Apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.Java:81)
[ERROR]         at org.Apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.Java:51)
[ERROR]         at org.Apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.Java:128)
[ERROR]         at org.Apache.maven.DefaultMaven.doExecute(DefaultMaven.Java:309)
[ERROR]         at org.Apache.maven.DefaultMaven.doExecute(DefaultMaven.Java:194)
[ERROR]         at org.Apache.maven.DefaultMaven.execute(DefaultMaven.Java:107)
[ERROR]         at org.Apache.maven.cli.MavenCli.execute(MavenCli.Java:993)
[ERROR]         at org.Apache.maven.cli.MavenCli.doMain(MavenCli.Java:345)
[ERROR]         at org.Apache.maven.cli.MavenCli.main(MavenCli.Java:191)
[ERROR]         at Sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR]         at Sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.Java:62)
[ERROR]         at Sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.Java:43)
[ERROR]         at Java.lang.reflect.Method.invoke(Method.Java:498)
[ERROR]         at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.Java:289)
[ERROR]         at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.Java:229)
[ERROR]         at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.Java:415)
[ERROR]         at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.Java:356)
[ERROR] -> [Help 1]

J'ai lu que ce problème peut être potentiellement lié à maven-surefire-plugin, j'ai donc ajouté à mon parent pom:

<pluginManagement>
    <plugins>
        <plugin>
            <groupId>org.Apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
                <forkCount>0</forkCount>
            </configuration>
        </plugin>
    <plugins>
</pluginManagement>

et aux poms hérités:

<plugins>
    <plugin>
        <groupId>org.Apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
    </plugin>
</plugins>

mais ça n'aide pas.

Comment résoudre ce problème?

8
alexanoid

J'étais confronté au même problème, l'ajout ci-dessous a fonctionné pour moi: la version 3.0.0-M3 résout le problème

<plugin>
                <groupId>org.Apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.0.0-M3</version>
        <configuration>
            <forkCount>0</forkCount>
            <testFailureIgnore>true</testFailureIgnore>
        </configuration>
</plugin>
2
Xpert

Définissez useSystemClassloader sur false:

<plugin>
    <groupId>org.Apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <configuration>
        <useSystemClassLoader>false</useSystemClassLoader>
    </configuration>
</plugin>
1

J'étais également confronté au même problème.

[ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
[ERROR] org.Apache.maven.surefire.booter.SurefireBooterForkException: Error occurred in starting fork, check output in log

Dans mon contexte, je construisais une application Spring Boot. Tous les tests étaient ok, MAIS, l'application ne s'est pas fermée correctement en raison d'un problème dans le processus d'arrêt du code de l'application. Je suppose que le processus ne renvoyait pas un code de sortie égal à 0.

Une fois que nous avons résolu ce problème d'arrêt, cette exception de plugin infaillible ne s'est plus produite.

Cela peut être un indice de votre problème.

0
aure_bobo

J'ai eu une erreur similaire parce que j'avais un tiret - dans mon nom de branche, et Jenkins a échoué.

[ERROR] Error occurred in starting fork, check output in log 
[ERROR] Process Exit Code: 1 
[ERROR] org.Apache.maven.surefire.booter.SurefireBooterForkException: The forked VM terminated without properly saying goodbye. VM crash or System.exit called? ... 
[ERROR] Error occurred in starting fork, check output in log [ERROR] Process Exit Code: 1 
[ERROR] at org.Apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.Java:671) 
[ERROR] at org.Apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.Java:533) 
[ERROR] at org.Apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.Java:278) 
[ERROR] at org.Apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.Java:244) 
[ERROR] at org.Apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.Java:1149) 
[ERROR] at org.Apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.Java:978) 
[ERROR] at org.Apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.Java:854)

Après avoir fait une branche identique avec un autre nom, j'ai retravaillé.

0
RotS