maven
maven copied to clipboard
[MNG-7344] track dependencyManagement import location in effective Model for MPH-183
The goal of MPH-183 is to print via which BOM(s) a dependencyManagement dependency got in the effective POM in case of dependencyManagement import. MNG-7344 implements the required tracking in Maven core effective model.
This information was previously not available to the help plugin. This MR:
- introduces a change to the
InputSource
model to keep a hierarchy of sources (which are POM files) by tracking the POM that imported it - tracks dependencies through different dependency management imports, setting the hierarchy of sources on the
InputSource
objects
For now, this code has been written under the assumption that a BOM hierarchy (at least at the point the dependency management blocks are imported) is tree-shaped, without diamonds. That is, given a project P
with dependency D
, importing BOMs A
and B
, BOM C
with dependency D
, only A
or B
(not both) can import C
.
- [ ] Check assumption
If such a structure would be possible, the end result may be incorrectly represented as C via B via A
, which is not correct, because there is no direct relationship between A
and B
.
Furthermore, at the moment the original InputSource
of the file is mutated. This makes the hierarchy valid for all imported dependencies, and potentially other parts of the effective POM. This may not be desirable. A relatively minor change, replacing InputSource
objects that are about to be mutated, would solve this issue. In case updating the original InputSource
is desirable, there may be a better place to set it.
- [ ] Check solution strategy
Any input on the above points is highly appreciated.
A pull request for printing this information in the effective POM: https://github.com/apache/maven-help-plugin/pull/37
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
[MNG-XXX] - Fixes bug in ApproximateQuantiles
, where you replaceMNG-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. - [x] You have run the Core IT successfully.
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
-
[ ] In any other case, please file an Apache Individual Contributor License Agreement.
Hey @rfscholte, would it be appropriate to create a new ticket for this? The ticket this work is under is focused on maven-help-plugin, but this is turning out a bit more involved. I'm happy to work on it, but I think it makes sense to make the requirements, reasoning and discussion easily findable at a location where it is expected.
If you agree, can you create a ticket and formulate your ideas and expected results?
I've created https://issues.apache.org/jira/browse/MNG-7344