mirror of https://github.com/apache/maven.git
MNG-2823 Silencing some annoying logging
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@522696 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
dddd69dac1
commit
2e719998ac
|
@ -23,6 +23,9 @@ import org.apache.maven.artifact.Artifact;
|
||||||
import org.apache.maven.artifact.versioning.VersionRange;
|
import org.apache.maven.artifact.versioning.VersionRange;
|
||||||
import org.codehaus.plexus.logging.Logger;
|
import org.codehaus.plexus.logging.Logger;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.HashSet;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send resolution events to the debug log.
|
* Send resolution events to the debug log.
|
||||||
*
|
*
|
||||||
|
@ -36,6 +39,8 @@ public class DebugResolutionListener
|
||||||
|
|
||||||
private String indent = "";
|
private String indent = "";
|
||||||
|
|
||||||
|
private static Set ignoredArtifacts = new HashSet();
|
||||||
|
|
||||||
public DebugResolutionListener( Logger logger )
|
public DebugResolutionListener( Logger logger )
|
||||||
{
|
{
|
||||||
this.logger = logger;
|
this.logger = logger;
|
||||||
|
@ -74,6 +79,15 @@ public class DebugResolutionListener
|
||||||
{
|
{
|
||||||
logger.debug( indent + artifact + " (not setting scope to: " + scope + "; local scope " + artifact.getScope() +
|
logger.debug( indent + artifact + " (not setting scope to: " + scope + "; local scope " + artifact.getScope() +
|
||||||
" wins)" );
|
" wins)" );
|
||||||
|
|
||||||
|
// TODO: better way than static? this might hide messages in a reactor
|
||||||
|
if ( !ignoredArtifacts.contains( artifact ) )
|
||||||
|
{
|
||||||
|
logger.warn( "\n\tArtifact " + artifact + " retains local scope '" + artifact.getScope() +
|
||||||
|
"' overriding broader scope '" + scope + "'\n" +
|
||||||
|
"\tgiven by a dependency. If this is not intended, modify or remove the local scope.\n" );
|
||||||
|
ignoredArtifacts.add( artifact );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateScope( Artifact artifact, String scope )
|
public void updateScope( Artifact artifact, String scope )
|
||||||
|
|
|
@ -37,8 +37,6 @@ public class WarningResolutionListener
|
||||||
{
|
{
|
||||||
private Logger logger;
|
private Logger logger;
|
||||||
|
|
||||||
private static Set ignoredArtifacts = new HashSet();
|
|
||||||
|
|
||||||
public WarningResolutionListener( Logger logger )
|
public WarningResolutionListener( Logger logger )
|
||||||
{
|
{
|
||||||
this.logger = logger;
|
this.logger = logger;
|
||||||
|
@ -70,14 +68,6 @@ public class WarningResolutionListener
|
||||||
|
|
||||||
public void updateScopeCurrentPom( Artifact artifact, String scope )
|
public void updateScopeCurrentPom( Artifact artifact, String scope )
|
||||||
{
|
{
|
||||||
// TODO: better way than static? this might hide messages in a reactor
|
|
||||||
if ( !ignoredArtifacts.contains( artifact ) )
|
|
||||||
{
|
|
||||||
logger.warn( "\n\tArtifact " + artifact + " retains local scope '" + artifact.getScope() +
|
|
||||||
"' overriding broader scope '" + scope + "'\n" +
|
|
||||||
"\tgiven by a dependency. If this is not intended, modify or remove the local scope.\n" );
|
|
||||||
ignoredArtifacts.add( artifact );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateScope( Artifact artifact, String scope )
|
public void updateScope( Artifact artifact, String scope )
|
||||||
|
|
Loading…
Reference in New Issue