-
Notifications
You must be signed in to change notification settings - Fork 94
Fix for #408, ensure nested dependency exclusions aren't overrided #485
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
base: master
Are you sure you want to change the base?
Conversation
but only direct ones
|
Contrary to my first assumption it is necessary to provide project dependencies to the collect request but using |
This comment has been minimized.
This comment has been minimized.
|
Don't merge this PR yet, it causes a regression on maven dependency version resolution. |
|
A word about the last commit (5b9a7e2) It is a workaround to the maven issue apache/maven#7682 This issue was already raised (#185) and solved (#307) by @suztomo in a previous version To ensure test dependencies did not override runtime dependencies this commit removes them from the collected dependencies and relaunch the conflict resolution process. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…sionTest.java Co-authored-by: Copilot <[email protected]>
…nerTest.java Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
project.getDependencies does contains profile deps
|
Hello @slawekjaranowski, @slachiewicz, |
|
Hello @slawekjaranowski, @slachiewicz, |
Hi,
This PR try to solve #408, dependencies are present in the flattened POM even when excluded in a nested dependency of a project.
From my understanding the issue comes from
flatten-maven-plugin/src/main/java/org/codehaus/mojo/flatten/FlattenMojo.java
Line 1126 in 75a3989
project.getArtifacts() returns all project's resolved artifacts which is ok but using those artifacts as dependencies in the CollectRequest transforms those dependencies as if they were direct ones and by doing so removes any exclusions that may have been set in the nested dependency POM.
I think projectDependencies and managedDependencies are sufficient so the whole loop is unnecessary and can be safely removed:
As I'm not familiar with all the ins and outs of this project i'm not 100% sure of my analysis so please take this removal with caution
A unit test has been added demonstrating the case.
Don't hesitate to request changes if needed