Fix #185 Removing test-scope dependencies before building dependency tree#307
Fix #185 Removing test-scope dependencies before building dependency tree#307slawekjaranowski merged 1 commit intomojohaus:masterfrom
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? |
slawekjaranowski
left a comment
There was a problem hiding this comment.
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.