[ https://issues.apache.org/jira/browse/MNG-8050?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17817081#comment-17817081 ]
Konrad Windszus edited comment on MNG-8050 at 2/13/24 5:17 PM: --------------------------------------------------------------- Overwriting of the POM repository with the repository having the same id from settings.xml happens in [{{DefaultModelBuilder.build(...)}}|https://github.com/apache/maven/blob/bc0240f3c744dd6b6ec2920b3cd08dcc295161ae/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java#L317]. This is the place where some validation would need to happen, as at the time when raw model validation happens the active external profiles (from settings.xml) are not accessible and when the effective model is validated neither the repository data from the raw model are available nor the active external profiles (which are both necessary to detect clashes). Currently I would tend to introduce a new method to the {[ModelValidator}} receiving both the _rawModel_ as well as the _list of active external profiles_. There one could detect such id name clashes. was (Author: kwin): Overwriting of the POM repository with the repository having the same id from settings.xml happens in [{{DefaultModelBuilder.build(...)}}|https://github.com/apache/maven/blob/bc0240f3c744dd6b6ec2920b3cd08dcc295161ae/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java#L317]. This is the place where some validation would need to happen, as at the time when Model validation happens the active external profiles (from settings.xml) are not accessible. > Same repositories IDs in settings.xml and POM are not detected > -------------------------------------------------------------- > > Key: MNG-8050 > URL: https://issues.apache.org/jira/browse/MNG-8050 > Project: Maven > Issue Type: Improvement > Reporter: Konrad Windszus > Priority: Major > > When the same repository ID is used in repositories defined in > # {{settings.xml}} and > # POM > the one from the POM is just silently ignored and no ERROR is emitted. > OTOH when defining repositories with the same ID in POM the following error > is emitted: > {code} > [ERROR] Some problems were encountered while processing the POMs: > [ERROR] 'repositories.repository.id' must be unique .... > {code} > A similar error should be emitted for repository ID clashes in > {{settings.xml}} (both local and global) and POM > -- This message was sent by Atlassian Jira (v8.20.10#820010)