Skip to content
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

Cyclic Dependency when project depends on itself #307

Closed
knrc opened this issue Mar 14, 2023 · 1 comment
Closed

Cyclic Dependency when project depends on itself #307

knrc opened this issue Mar 14, 2023 · 1 comment

Comments

@knrc
Copy link
Contributor

knrc commented Mar 14, 2023

Maven normally excludes cyclic dependencies, however there is one case when this is allowed. This results in recursion leading to a StackOverflowError.

This was first discovered when generating a bom for the netty-tcnative project which includes netty-tcnative-boringssl-static.
The netty-tcnative-boringssl-static project has dependencies on itself, albeit with individual qualifiers (such as linux-x86_64) for each of its supported binaries.

@knrc
Copy link
Contributor Author

knrc commented Mar 14, 2023

The submitted PR includes a test case which results in the following dependency tree

com.example.cyclic:cyclic_A:jar:1.0.0
+- com.example.cyclic:cyclic_A:jar:classifier_1:1.0.0:compile
|  +- (com.example.cyclic:cyclic_A:jar:classifier_2:1.0.0:compile - omitted for duplicate)
|  \- (com.example.cyclic:cyclic_A:jar:classifier_3:1.0.0:compile - omitted for duplicate)
+- com.example.cyclic:cyclic_A:jar:classifier_2:1.0.0:compile
|  +- (com.example.cyclic:cyclic_A:jar:classifier_1:1.0.0:compile - omitted for duplicate)
|  \- (com.example.cyclic:cyclic_A:jar:classifier_3:1.0.0:compile - omitted for duplicate)
\- com.example.cyclic:cyclic_A:jar:classifier_3:1.0.0:compile
   +- (com.example.cyclic:cyclic_A:jar:classifier_1:1.0.0:compile - omitted for duplicate)
   \- (com.example.cyclic:cyclic_A:jar:classifier_2:1.0.0:compile - omitted for duplicate)

hboutemy added a commit that referenced this issue Mar 15, 2023
Fixes #307, addresses cyclic dependencies created by self references
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant