-
Notifications
You must be signed in to change notification settings - Fork 278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
StackOverflowError on attempt to run against import dependencies #4093
Comments
Hi @ZhyliaievD ; thanks for the report! Hadn't expected this type of use indeed. Is that a common case over there? |
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) |
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: