You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We ran recipe "org.openrewrite.java.spring.boot2.UpgradeSpringBoot_2_7" which runs several recipes including "org.openrewrite.java.spring.boot2.SpringBoot2JUnit4to5Migration" which in turn runs "org.openrewrite.java.testing.junit5.JUnit4to5Migration".
When I ran a standard "maven verify" build when it got to the maven-surefire-plugin's "test" goal the build failed after printing a stack trace containing this cause:
Removing the "junit-platform-surefire-provider" plugin dependency from the pom.xml config snippet above fixed the issue.
This clause in source file junit5.yml seems to be the one that causes "junit-platform-surefire-provider" to be added as a plugin dependency under maven-surefire-plugin. Removing that "AddPluginDependency" recipe reference should do the trick.
Why is the change described above appropriate?
Per this issue and these release notes, library "junit-platform-surefire-provider" is deprecated since JUnit Jupiter 5 v5.3.0.
What is the full stack trace of any errors you encountered?
[INFO] --- maven-surefire-plugin:3.2.5:test (default-test) @ my-software-name-1_0 ---
[WARNING] Error injecting: org.apache.maven.plugin.surefire.SurefirePlugin
java.lang.NoClassDefFoundError: org/apache/maven/surefire/api/testset/TestSetFailedException
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671)
at java.lang.Class.getDeclaredConstructors(Class.java:2020)
at com.google.inject.spi.InjectionPoint.forConstructorOf(InjectionPoint.java:245)
at com.google.inject.internal.ConstructorBindingImpl.create(ConstructorBindingImpl.java:99)
at com.google.inject.internal.InjectorImpl.createUninitializedBinding(InjectorImpl.java:658)
at com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:882)
at com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:805)
at com.google.inject.internal.InjectorImpl.getJustInTimeBinding(InjectorImpl.java:282)
at com.google.inject.internal.InjectorImpl.getBindingOrThrow(InjectorImpl.java:214)
at com.google.inject.internal.InjectorImpl.getProviderOrThrow(InjectorImpl.java:1006)
at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:1038)
at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:1001)
at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1051)
at org.eclipse.sisu.space.AbstractDeferredClass.get(AbstractDeferredClass.java:48)
at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:81)
at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdap
ter.java:53)
at com.google.inject.internal.ProviderInternalFactory$1.call(ProviderInternalFactory.java:65)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.
java:115)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.
java:133)
at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:68)
at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:63)
at com.google.inject.internal.InternalFactoryToInitializableAdapter.get(InternalFactoryToInitializableAdapter.ja
va:45)
at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1016)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)
at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1012)
at org.eclipse.sisu.inject.Guice4$1.get(Guice4.java:162)
at org.eclipse.sisu.inject.LazyBeanEntry.getValue(LazyBeanEntry.java:81)
at org.eclipse.sisu.plexus.LazyPlexusBean.getValue(LazyPlexusBean.java:51)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:263)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:255)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo(DefaultMavenPluginManager.java:5
19)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:121)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
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:309)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:191)
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: java.lang.ClassNotFoundException: org.apache.maven.surefire.api.testset.TestSetFailedException
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:247)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239)
... 54 more
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
I'm about to head out on vacation so no, not right now. If this goes unresolved, I may be able to submit a pull request in a few weeks. I am selfishly hoping someone familiar with the product picks this up while I'm out. :)
The text was updated successfully, but these errors were encountered:
Indeed looks straightforward. Out of curiosity: what version of Maven are you using? I ask sauce there's a precondition on that recipe that should limit when it's applied.
With that I think we can close this issue; but do let me know if I've misunderstood the need for junit-platform-surefire-provider on Maven 3.5.4 and below.
I'm loving the promise of this tooling so far. Here's one item that tripped me up today. Looks like it has a straightforward fix.
What version of OpenRewrite are you using?
I am using "rewrite-maven-plugin" version 5.34.1
How are you running OpenRewrite?
I am using the Maven plugin from the command line, and my project is a single module project.
What is the smallest, simplest way to reproduce the problem?
Locate or generate a Maven project that's configured to use maven-surefire-plugin and JUnit 4 and run:
Then kick off a build:
How the issue presented
We ran recipe "org.openrewrite.java.spring.boot2.UpgradeSpringBoot_2_7" which runs several recipes including "org.openrewrite.java.spring.boot2.SpringBoot2JUnit4to5Migration" which in turn runs "org.openrewrite.java.testing.junit5.JUnit4to5Migration".
This produced this modified pom configuration:
When I ran a standard "maven verify" build when it got to the maven-surefire-plugin's "test" goal the build failed after printing a stack trace containing this cause:
Removing the "junit-platform-surefire-provider" plugin dependency from the pom.xml config snippet above fixed the issue.
This clause in source file junit5.yml seems to be the one that causes "junit-platform-surefire-provider" to be added as a plugin dependency under maven-surefire-plugin. Removing that "AddPluginDependency" recipe reference should do the trick.
Why is the change described above appropriate?
Per this issue and these release notes, library "junit-platform-surefire-provider" is deprecated since JUnit Jupiter 5 v5.3.0.
What is the full stack trace of any errors you encountered?
Are you interested in contributing a fix to OpenRewrite?
I'm about to head out on vacation so no, not right now. If this goes unresolved, I may be able to submit a pull request in a few weeks. I am selfishly hoping someone familiar with the product picks this up while I'm out. :)
The text was updated successfully, but these errors were encountered: