maven-assembly-plugin
maven-assembly-plugin copied to clipboard
MASSEMBLY-919: Fix dependency scope handling
The problem is that the assembly plugin collects every dependency, flatten the dependency hierarchy tree, and only after this, filter's out by scope. This will cause that if A has a test dependency B, which has a 'runtime' dependency C, C is treated as a runtime dependency of A, and it is included. The implemented fix is using proper tree walking, and checking eagerly the scope of the dependency.
Following this checklist to help us incorporate your contribution quickly and easily:
- [X] Make sure there is a JIRA issue filed for the change (usually before you start working on it). Trivial changes like typos do not require a JIRA issue. Your pull request should address just this issue, without pulling in other changes.
- [X] Each commit in the pull request should have a meaningful subject line and body.
- [X] Format the pull request title like
[MASSEMBLY-XXX] - Fixes bug in ApproximateQuantiles
, where you replaceMASSEMBLY-XXX
with the appropriate JIRA issue. Best practice is to use the JIRA issue title in the pull request title and in the first line of the commit message. - [X] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [X] Run
mvn clean verify
to make sure basic checks pass. A more thorough check will be performed on your pull request automatically. - [ ] You have run the integration tests successfully (
mvn -Prun-its clean verify
).
If your pull request is about ~20 lines of code you don't need to sign an Individual Contributor License Agreement if you are unsure please ask on the developers list.
To make clear that you license your contribution under the Apache License Version 2.0, January 2004 you have to acknowledge this by using the following check-box.
-
[X] I hereby declare this contribution to be licenced under the Apache License Version 2.0, January 2004
-
[x] In any other case, please file an Apache Individual Contributor License Agreement.
@gzsombor can you please help us draft an integration test first? I tried to replay your described scenario and I do not see any errors. Here is the code https://github.com/struberg/maven-assembly-plugin/tree/MASSEMBLY-919
Where does my IT differ from your use case?
I've replaced Easymock with Mockito, so this PR needs to be updated
any update ? this problem is still exists
Ideally we need an IT (or some test) that reproduces the issue (fails the expectation) and then a PR that fixes it (makes IT pass).
@Geker can you provide a reproducer? or does https://github.com/apache/maven-assembly-plugin/pull/12#pullrequestreview-336128503 work?
We should direct use Resolver API. By the way thanks for effort.