Hopefully somebody can help me :)
I am trying to update a project from spring boot 2.5 to spring boot 2.7 with the openrewrite recipe. After trying this several times I keep getting the same error message.
I tried excluding the exact module this error happens, but it will just skip that and give the same error on the next module (I have 3 modules in total) Also tried removing the .m2 folder but still the same error.
The following is my pom rewrite:
<plugin>
<groupId>org.openrewrite.maven</groupId>
<artifactId>rewrite-maven-plugin</artifactId>
<version>5.2.4</version>
<configuration>
<activeRecipes>
<recipe>org.openrewrite.java.spring.boot2.UpgradeSpringBoot_2_7</recipe>
</activeRecipes>
<exclusions>
<exclude>*/node/**</exclude>
<exclude>*/node_modules/**</exclude>
<exclude>*/target/**</exclude>
</exclusions>
</configuration>
<dependencies>
<dependency>
<groupId>org.openrewrite.recipe</groupId>
<artifactId>rewrite-spring</artifactId>
<version>5.0.1</version>
</dependency>
</dependencies>
</plugin>
After mvn rewrite:run the error message is:
[ERROR] The recipe produced an error. Please report this to the recipe author.
[ERROR] Failed to execute goal org.openrewrite.maven:rewrite-maven-plugin:5.2.4:run (default-cli) on project my-project: Execution default-cli of goal org.openrewrite.maven:rewrite-maven-plugin:5.2.4:run failed: Error while visiting my-module/src/main/java/nl/commons/util/someClass.java: java.lang.NoSuchMethodError: 'boolean org.openrewrite.java.MethodMatcher.matches(org.openrewrite.java.tree.J$MethodInvocation)'
[ERROR] org.openrewrite.java.testing.mockito.PowerMockitoMockStaticToMockito$PowerMockitoToMockitoVisitor.visitMethodInvocation(PowerMockitoMockStaticToMockito.java:164)
[ERROR] org.openrewrite.java.testing.mockito.PowerMockitoMockStaticToMockito$PowerMockitoToMockitoVisitor.visitMethodInvocation(PowerMockitoMockStaticToMockito.java:48)
[ERROR] org.openrewrite.java.tree.J$MethodInvocation.acceptJava(J.java:3706)
[ERROR] org.openrewrite.java.tree.J.accept(J.java:59)
[ERROR] org.openrewrite.TreeVisitor.visit(TreeVisitor.java:278)
[ERROR] org.openrewrite.TreeVisitor.visitAndCast(TreeVisitor.java:361)
[ERROR] org.openrewrite.java.JavaVisitor.visitRightPadded(JavaVisitor.java:1284)
[ERROR] org.openrewrite.java.JavaVisitor.lambda$visitBlock$4(JavaVisitor.java:367)
Thanks in advance!
Niek