[ 
https://issues.apache.org/jira/browse/MNG-8050?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17817105#comment-17817105
 ] 

ASF GitHub Bot commented on MNG-8050:
-------------------------------------

kwin commented on code in PR #1412:
URL: https://github.com/apache/maven/pull/1412#discussion_r1488374066


##########
maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java:
##########
@@ -576,6 +578,36 @@ public void validateEffectiveModel(Model ma, 
ModelBuildingRequest request, Model
         }
     }
 
+    @Override
+    public void validateExternalProfiles(
+            List<org.apache.maven.model.Profile> activeExternalProfiles,
+            Model ma,
+            ModelBuildingRequest request,
+            ModelProblemCollector problems) {
+        org.apache.maven.api.model.Model m = ma.getDelegate();
+        // check for id clashes in repositories
+        for (Profile profile : activeExternalProfiles.stream()
+                .map(org.apache.maven.model.Profile::getDelegate)
+                .collect(Collectors.toList())) {
+            for (Repository repository : profile.getRepositories()) {

Review Comment:
   TODO: Also check for clashing plugin repositories





> 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
>            Assignee: 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)

Reply via email to