[MNG-8050] emit warn in case of repo id clashes between settings and POM
Following this checklist to help us incorporate your contribution quickly and easily:
- [ ] 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.
- [ ] Each commit in the pull request should have a meaningful subject line and body.
- [ ] Format the pull request title like
[MNG-XXX] SUMMARY, where you replaceMNG-XXXandSUMMARYwith the appropriate JIRA issue. - [ ] Also format the first line of the commit message like
[MNG-XXX] SUMMARY. Best practice is to use the JIRA issue title in both the pull request title and in the first line of the commit message. - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [ ] Run
mvn clean verifyto make sure basic checks pass. A more thorough check will be performed on your pull request automatically. - [ ] 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.
-
[ ] 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.
@gnodet ?
If there are no concerns I am gonna merge end of next week @gnodet.
@kwin Should we check that the repositories are actually not the same ? What's the problem is they point to the same repo ? If the user simply wants to override the policy in the settings ?
BTW, I think the mapping from an id to a repository URI should actually be defined in the local repository. I think two projects using the same id but pointing to different repositories might be problematic too.
@gnodet I now only emit warning if the URLs differ (https://github.com/apache/maven/commit/cd7aba6af6ff80a394e12b975a293fa07cb813c9)
I think the mapping from an id to a repository URI should actually be defined in the local repository
Not sure how this can ever be achieved. I still want to be able to clone arbitrary projects and build it immediately without needing to tweak either my settings.xml or some other Maven configuration file.
@gnodet I now only emit warning if the URLs differ (cd7aba6)
I think the mapping from an id to a repository URI should actually be defined in the local repository
Not sure how this can ever be achieved. I still want to be able to clone arbitrary projects and build it immediately without needing to tweak either my
settings.xmlor some other Maven configuration file.
@cstamas can the resolver provide any help here ?
Sadly nope.
IMHO the best we can do is to accept the facts:
- repository ID is the "key" (so assume URL is "just" an attribute) and limit ourselves onto ID clash checking
- maybe as improvement, warn (optionally fail) the build, if there are two different IDs with same URLs?
- cases when same ID may be used for different reposes (or when different IDs are used for same repository) mostly stands for us, people that check out various project, having various "repo naming conventions" (as for example, ideally within one company or even forge, this should be unified) is we simply cannot handle.
@gnodet I think we should also warn if the URL is equal but the <enabled> flags for either <release> or <snapshot> differ. Otherwise this might lead to subtle issues which are hard to debug.
I think we should also warn if the URL is equal but the
flags for either or differ. Otherwise this might lead to subtle issues which are hard to debug.
I decided to ignore those subtle differences for now.