[MNG-5395] don't inject DefaultMavenPluginManager's logger into Mojos

but create a dedicated logger with Mojo implementation name
This commit is contained in:
Hervé Boutemy 2012-12-01 04:27:23 +01:00
parent 4c8b3009d1
commit fee1640d65
1 changed files with 6 additions and 1 deletions

View File

@ -83,6 +83,7 @@ import org.codehaus.plexus.configuration.PlexusConfiguration;
import org.codehaus.plexus.configuration.PlexusConfigurationException;
import org.codehaus.plexus.configuration.xml.XmlPlexusConfiguration;
import org.codehaus.plexus.logging.Logger;
import org.codehaus.plexus.logging.LoggerManager;
import org.codehaus.plexus.util.IOUtil;
import org.codehaus.plexus.util.ReaderFactory;
import org.codehaus.plexus.util.StringUtils;
@ -110,6 +111,9 @@ public class DefaultMavenPluginManager
@Requirement
private Logger logger;
@Requirement
private LoggerManager loggerManager;
@Requirement
private PlexusContainer container;
@ -508,7 +512,8 @@ public class DefaultMavenPluginManager
if ( mojo instanceof Mojo )
{
( (Mojo) mojo ).setLog( new DefaultLog( logger ) );
Logger mojoLogger = loggerManager.getLoggerForComponent( mojoDescriptor.getImplementation() );
( (Mojo) mojo ).setLog( new DefaultLog( mojoLogger ) );
}
Xpp3Dom dom = mojoExecution.getConfiguration();