From 86c55a3bd13b6bd83d705ad4de8702cc78914ad2 Mon Sep 17 00:00:00 2001 From: Brett Leslie Porter Date: Thu, 28 Jul 2005 15:45:11 +0000 Subject: [PATCH] PR: MNG-670 tone it down a bit git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@225803 13f79535-47bb-0310-9956-ffa450edef68 --- .../resolver/WarningResolutionListener.java | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/maven-artifact-manager/src/main/java/org/apache/maven/artifact/resolver/WarningResolutionListener.java b/maven-artifact-manager/src/main/java/org/apache/maven/artifact/resolver/WarningResolutionListener.java index 9cbe7ce1db..e58d0d2028 100644 --- a/maven-artifact-manager/src/main/java/org/apache/maven/artifact/resolver/WarningResolutionListener.java +++ b/maven-artifact-manager/src/main/java/org/apache/maven/artifact/resolver/WarningResolutionListener.java @@ -19,6 +19,9 @@ import org.apache.maven.artifact.Artifact; import org.codehaus.plexus.logging.Logger; +import java.util.HashSet; +import java.util.Set; + /** * Send resolution warning events to the warning log. * @@ -30,6 +33,8 @@ public class WarningResolutionListener { private Logger logger; + private static Set ignoredArtifacts = new HashSet(); + public WarningResolutionListener( Logger logger ) { this.logger = logger; @@ -61,10 +66,15 @@ public void omitForCycle( Artifact omitted ) public void updateScopeCurrentPom( Artifact artifact, String scope ) { - logger.warn( "\n\tArtifact " + artifact.getId() + " is having scope '" + artifact + "' replaced with '" + - scope + "'\n" + - "\tas a dependency has given a broader scope. If this is not intended, use -X to locate the dependency,\n" + - "\tor force the desired scope using dependencyManagement.\n" ); + // TODO: better way than static? this might hide messages in a reactor + if ( !ignoredArtifacts.contains( artifact ) ) + { + logger.warn( "\n\tArtifact " + artifact.getId() + " has scope '" + artifact.getScope() + + "' replaced with '" + scope + "'\n" + + "\tas a dependency has given a broader scope. If this is not intended, use -X to locate the dependency,\n" + + "\tor force the desired scope using dependencyManagement.\n" ); + ignoredArtifacts.add( artifact ); + } } public void updateScope( Artifact artifact, String scope )