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
maven-rewrite-plugin fails with java.lang.StackOverflowError when there is a dependency with import scope having a parent declaration org.openrewrite.maven.tree.ResolvedPom tries to resolve parent of such dependency, which in turn contains the dependency itself, resulting in circular dependency
Of course, that's a clear problem in target project, but it is ignored by maven during build process so people can easily miss it
What version of OpenRewrite are you using?
latest version of rewrite-maven-plugin (5.25.0)
What is the smallest, simplest way to reproduce the problem?
Run any recipe against a sample project: https://github.com/ZhyliaievD/rewrite-maven-plugin-soe-sample
e.g. sample command to run: mvn -U org.openrewrite.maven:rewrite-maven-plugin:run -Drewrite.activeRecipes=org.openrewrite.java.RemoveUnusedImports
OR use the following code snippets to reproduce using the following parent&child poms:
Hi @ZhyliaievD ; thanks for the report! Hadn't expected this type of use indeed. Is that a common case over there?
The classes involved here are all in openrewrite/rewrite, so I'll move the issue for a likely fix in that project.
Not really a common case, but a mistake in existing project(actually, it was a problem in shared library, so all projects using that lib version were affected - may be not that fast to fix on scale in such cases)
The problem is that bug is hidden by maven during build process, so user receives StackOverflowError on a "green" repo, making openrewrite first thing to blame. It takes decent amout of time to investigate and find a real rootcause
Hi,
maven-rewrite-plugin fails with
java.lang.StackOverflowError
when there is a dependency withimport
scope having a parent declarationorg.openrewrite.maven.tree.ResolvedPom
tries to resolve parent of such dependency, which in turn contains the dependency itself, resulting in circular dependencyOf course, that's a clear problem in target project, but it is ignored by maven during build process so people can easily miss it
What version of OpenRewrite are you using?
latest version of rewrite-maven-plugin (5.25.0)
What is the smallest, simplest way to reproduce the problem?
Run any recipe against a sample project:
https://github.com/ZhyliaievD/rewrite-maven-plugin-soe-sample
e.g. sample command to run:
mvn -U org.openrewrite.maven:rewrite-maven-plugin:run -Drewrite.activeRecipes=org.openrewrite.java.RemoveUnusedImports
OR use the following code snippets to reproduce using the following parent&child poms:
project structure:
Parent pom:
child pom:
What did you expect to see?
a) plugin taking care of such cases
b) plugin throwing meaningful exception stating about circular dependencies in project
What did you see instead?
The text was updated successfully, but these errors were encountered: