-
Notifications
You must be signed in to change notification settings - Fork 85
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
Fix #185 Removing test-scope dependencies before building dependency tree #307
Conversation
@slawekjaranowski Would you help me by reviewing this change? You might not have the context of #185 (2 years ago) and it's a bit complex problem. Unfortunately this issue came up in my organization recently; we released a library that excluded actually-used dependencies (googleapis/java-pubsub#1239). I want to contribute to fix it. |
I have merged #305 please resolve conflicts ... and check if new version of m-dependency-tree has the same issue. |
Yes, I will! |
In 2ced44c, I merged master branch and commented out my modification. I confirmed that the new version of maven-dependency-tree has the same problem: the test case for #185
It fails because the flattened project does not have a actually-used dependency that was interfered by the direct test dependency. Now, uncommenting my modification... |
@slawekjaranowski All tests passed. Would you review this pull request? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks ok, finally please squash to one commit
I just squashed the commits into one and |
Thank you! |
@slawekjaranowski When can we expect a new release with this change included? |
Problem
Fixes #185 , in which test-scope dependencies are unexpectedly excluded when
(The issue has a diagram to illustrate the mechanism)
The root cause is that, when building the dependency tree of the project, test-scope dependencies hides the actually-used dependencies with "omitted for duplicate" mark.
Solution
With this pull request, when building a dependency tree, the plugin removes the direct, test-scope dependencies. This avoids marking the actually-used dependencies as "omitted for duplicate".
This modification is safe because the test-scope dependencies are not visible to library users in any way.