From a07365f8fdeb5ed8cebb316c52630c69beadfcd9 Mon Sep 17 00:00:00 2001 From: Konrad Windszus Date: Mon, 4 Mar 2024 11:13:33 +0100 Subject: [PATCH] only emit warnings when urls differ --- .../apache/maven/model/validation/DefaultModelValidator.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java b/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java index 3952779be5b0..29262f7b7e70 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java +++ b/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java @@ -611,6 +611,7 @@ private void validateUniqueRepositoryIds( for (Repository externalRepository : externalRepositories) { Optional clashingPomRepository = pomRepositories.stream() .filter(r -> Objects.equals(r.getId(), externalRepository.getId())) + .filter(r -> !Objects.equals(r.getUrl(), externalRepository.getUrl())) .findFirst(); if (clashingPomRepository.isPresent()) { addViolation( @@ -619,7 +620,7 @@ private void validateUniqueRepositoryIds( Version.BASE, isPluginRepository ? "pluginRepositories.repository" : "repositories.repository", clashingPomRepository.get().getId(), - "is overwritten by the repository with same id from " + externalRepositoriesSource, + "is overwritten by the repository with same id but having a different url from " + externalRepositoriesSource, clashingPomRepository.get()); } }