maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jens Teglhus Møller (JIRA) <j...@apache.org>
Subject [jira] [Commented] (SUREFIRE-1520) ClassNotFoundException with forkCount>1 and junit5
Date Tue, 18 Sep 2018 12:02:00 GMT

    [ https://issues.apache.org/jira/browse/SUREFIRE-1520?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16619017#comment-16619017
] 

Jens Teglhus Møller commented on SUREFIRE-1520:
-----------------------------------------------

Hi [~tibor17]

I'm not entirely sure what you are requesting, but I have put up a repo here: [https://github.com/djarnis73/SUREFIRE-1520] it
contains a pom and a single unit test. It demonstrates the original bug, the workaround and
the fix by using different profiles. This is described in the readme.

Let me know if this helps you out.

Best regards Jens

> ClassNotFoundException with forkCount>1 and junit5
> --------------------------------------------------
>
>                 Key: SUREFIRE-1520
>                 URL: https://issues.apache.org/jira/browse/SUREFIRE-1520
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: JUnit 5.x support, Maven Surefire Plugin
>    Affects Versions: 2.21.0
>            Reporter: Stefan Küttner
>            Priority: Major
>
> maven-version: 3.2.5 / 3.3.9
> OS: Windows 7
> Java 8 (compiler level & runtime)
> {code:xml|title=pom.xml (effective-pom)|collapse=true}
>       <plugin>
>         <artifactId>maven-surefire-plugin</artifactId>
>         <version>2.21.0</version>
>         <executions>
>           <execution>
>             <id>default-test</id>
>             <phase>test</phase>
>             <goals>
>               <goal>test</goal>
>             </goals>
>             <configuration>
>               <excludes>
>                 <exclude>**/*IntegrationTest.java</exclude>
>               </excludes>
>               <testFailureIgnore>false</testFailureIgnore>
>               <forkCount>2</forkCount>
>               <reuseForks>true</reuseForks>
>               <forkedProcessTimeoutInSeconds>3600</forkedProcessTimeoutInSeconds>
>               <argLine>-Djava.util.logging.config.file=${project.base.dir}logging.properties</argLine>
>               <runOrder>alphabetical</runOrder>
>               <includes>
>                 <include>**/*Test.java</include>
>               </includes>
>             </configuration>
>           </execution>
>         </executions>
>         <dependencies>
>           <dependency>
>             <groupId>org.junit.platform</groupId>
>             <artifactId>junit-platform-surefire-provider</artifactId>
>             <version>1.2.0</version>
>             <scope>compile</scope>
>           </dependency>
>           <dependency>
>             <groupId>org.junit.vintage</groupId>
>             <artifactId>junit-vintage-engine</artifactId>
>             <version>5.2.0</version>
>             <scope>compile</scope>
>           </dependency>
>           <dependency>
>             <groupId>org.junit.jupiter</groupId>
>             <artifactId>junit-jupiter-engine</artifactId>
>             <version>5.2.0</version>
>             <scope>compile</scope>
>           </dependency>
>         </dependencies>
>         <configuration>
>           <forkCount>2</forkCount>
>           <reuseForks>true</reuseForks>
>           <forkedProcessTimeoutInSeconds>3600</forkedProcessTimeoutInSeconds>
>           <argLine>-Djava.util.logging.config.file=${project.base.dir}logging.properties</argLine>
>           <runOrder>alphabetical</runOrder>
>           <testFailureIgnore>false</testFailureIgnore>
>           <includes>
>             <include>**/*Test.java</include>
>           </includes>
>           <excludes>
>             <exclude>**/*PerfTest.java</exclude>
>             <exclude>**/*IntegrationTest.java</exclude>
>           </excludes>
>         </configuration>
>       </plugin>
> {code}
> result is 
> {code:java|title=java.lang.ClassNotFoundException: org.apache.maven.plugin.surefire.log.api.ConsoleLogger|collapse=true}
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.21.0:test
(default-test) on project mts.ctsm: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.21.0:test
failed: java.lang.ClassNotFoundException: org.apache.maven.plugin.surefire.log.api.ConsoleLogger
-> [Help 1]
> org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.21.0:test
(default-test) on project mts.ctsm: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.21.0:test
failed: java.lang.ClassNotFoundException: org.apache.maven.plugin.surefire.log.api.ConsoleLogger
> 	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:224)
> 	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:120)
> 	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
> 	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
> 	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
> 	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
> 	at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:498)
> 	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)
> Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-test of
goal org.apache.maven.plugins:maven-surefire-plugin:2.21.0:test failed: java.lang.ClassNotFoundException:
org.apache.maven.plugin.surefire.log.api.ConsoleLogger
> 	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:143)
> 	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
> 	... 19 more
> Caused by: org.apache.maven.surefire.util.SurefireReflectionException: java.lang.ClassNotFoundException:
org.apache.maven.plugin.surefire.log.api.ConsoleLogger
> 	at org.apache.maven.plugin.surefire.CommonReflector.<init>(CommonReflector.java:56)
> 	at org.apache.maven.plugin.surefire.booterclient.ForkStarter.getSuitesIterator(ForkStarter.java:693)
> 	at org.apache.maven.plugin.surefire.booterclient.ForkStarter.runSuitesForkOnceMultiple(ForkStarter.java:317)
> 	at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:292)
> 	at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:245)
> 	at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1149)
> 	at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:978)
> 	at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:854)
> 	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
> 	... 20 more
> Caused by: java.lang.ClassNotFoundException: org.apache.maven.plugin.surefire.log.api.ConsoleLogger
> 	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
> 	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
> 	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
> 	at org.apache.maven.surefire.booter.IsolatedClassLoader.loadClass(IsolatedClassLoader.java:100)
> 	at org.apache.maven.plugin.surefire.CommonReflector.<init>(CommonReflector.java:52)
> 	... 28 more
> {code}



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

Mime
View raw message