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
This commit is contained in:
Brett Leslie Porter 2005-07-28 15:45:11 +00:00
parent 3c461ef89d
commit 86c55a3bd1
1 changed files with 14 additions and 4 deletions

View File

@ -19,6 +19,9 @@ package org.apache.maven.artifact.resolver;
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 class WarningResolutionListener
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 )