You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Pavel_K (JIRA)" <ji...@apache.org> on 2018/09/13 12:29:00 UTC

[jira] [Created] (SUREFIRE-1568) Versions 2.21 and higher doesn't work with with junit-platform for Java 9 module

Pavel_K created SUREFIRE-1568:
---------------------------------

             Summary: Versions 2.21 and higher doesn't work with with junit-platform for Java 9 module
                 Key: SUREFIRE-1568
                 URL: https://issues.apache.org/jira/browse/SUREFIRE-1568
             Project: Maven Surefire
          Issue Type: Bug
          Components: Maven Surefire Plugin
    Affects Versions: 2.21.0
         Environment: Ubuntu
            Reporter: Pavel_K


I have a simple JPMS module. When I use the maven-surefire-plugin 2.20.1 everything is ok - my tests are executed:
{code:java}
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.20.1</version>
                    <dependencies>
                        <dependency>
                            <groupId>org.junit.platform</groupId>
                            <artifactId>junit-platform-surefire-provider</artifactId>
                            <version>1.3.0</version>
                        </dependency>
                    </dependencies>
            </plugin>{code}
However, when I want to use newer versions of surefire (2.21.0 or 2.22.0) I get the following:
{code:java}
    Please refer to dump files (if any exist) [date]-jvmRun[N].dump, [date].dumpstream and [date]-jvmRun[N].dumpstream.
    The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
    Command was /bin/sh -c cd "/home/project" && /opt/jdk-9/bin/java '@/home/project/target/surefire/surefireargs4438382394951202560' '/home/project/target/surefire' 2018-09-13T13-42-05_435-jvmRun1 surefire4870497011802680670tmp surefire_015850140770716473411tmp
    Error occurred in starting fork, check output in log
    Process Exit Code: 1
    org.apache.maven.surefire.booter.SurefireBooterForkException: The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
    Command was /bin/sh -c cd "/home/project" && /opt/jdk-9/bin/java '@/home/project/target/surefire/surefireargs4438382394951202560' '/home/project/target/surefire' 2018-09-13T13-42-05_435-jvmRun1 surefire4870497011802680670tmp surefire_015850140770716473411tmp
    Error occurred in starting fork, check output in log
    Process Exit Code: 1
    at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:671)
    at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:533)
    at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:278)
    at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:244)
    at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1194)
    at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:1022)
    at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:868)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:564)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
    -> [Help 1]{code}
And in surefire-reports I see the following:
{code:java}
    # Created at 2018-09-13T13:42:07.587
    Error: Could not find or load main class Projects..home.project.m2.repository.org.eclipse.persistence.javax.persistence.2.2.0.javax.persistence-2.2.0.jar:.home.project..m2.repository.org.eclipse.persistence.org.eclipse.persistence.core.2.7.0.org.eclipse.persistence.core-2.7.0.jar:.home.project..m2.repository.org.slf4j.slf4j-api.1.7.25.slf4j-api-1.7.25.jar ...
    
    # Created at 2018-09-13T13:42:07.588
    Caused by: java.lang.ClassNotFoundException: /home/project//m2/repository/org/eclipse/persistence/javax/persistence/2/2/0/javax/persistence-2/2/0/jar:/home/project//m2/repository/org/eclipse/persistence/org/eclipse/persistence/core/2/7/0/org/eclipse/persistence/core-2/7/0/jar:/home/project//m2/repository/org/slf4j/slf4j-api/1/7/25/slf4j-api-1/7/25/jar ...{code}
I tried to use only Junit jupiter as explained here [https://maven.apache.org/surefire/maven-surefire-plugin/examples/junit-platform.html] but result is the same. Maybe the problem is that surefire builds wrong path? See
{code:java}
:/home/project//m2/repository/org/slf4j/slf4j-api/1/7/25/slf4j-api-1/7/25/jar
{code}
As you see there are two slashes before m2. The question about this problem was asked also on SO [https://stackoverflow.com/questions/52312151/maven-surefire-plugin-with-junit-platform-surefire-provider-for-java-9-module]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)