maven-dependency-plugin
maven-dependency-plugin copied to clipboard
[MDEP-317] - add mojo to analyze invalid exclusions
This mojo reports if exclusions are defined on a dependency, but that dependency does not pull in said artifacts.
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
[MDEP-XXX] - Fixes bug in ApproximateQuantiles, where you replaceMDEP-XXXwith 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 verifyto make sure basic checks pass. A more thorough check will be performed on your pull request automatically. - [x] 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 licensed under the Apache License Version 2.0, January 2004
-
[x] In any other case, please file an Apache Individual Contributor License Agreement.
Logs out a warning, alternatively fail when failOnError flag is set, when a dependency defines an exclusion that is not valid.
Some notes The failOnWarning property is the same property as for analyze, keep it that way or make its own property?
I placed the logic in its own package and made it its own execution, it can be moved to be a part of analyze if wanted. Having it as its own will make upgrading not change current behavior.
The exclusion glob pattern logic is copied from ExclusionArtifactFilter added in maven-core in jira MNG-7843.
@vbreivik thanks for idea and PR ... I will try to review in a few days
@vbreivik thanks for idea and PR ... I will try to review in a few days
I cannot take credit for the idea. I just saw it in Jira and was a bit bored. :)
@slawekjaranowski I have updated the test that started failing after c9e488ba11516aa5b4be22fedd5b109ab11fa32c, can you trigger the build again?
I think about extend test with scenario, for multimodule project:
root pom - dependencyManagement with exclusion
- child module with using dependency
I think about extend test with scenario, for multimodule project:
root pom - dependencyManagement with exclusion
- child module with using dependency
I added a test case with this scenario. I ended up putting the module name in the warning to make the test more clear.
Resolve #761