mirror of https://github.com/apache/maven.git
make sure debug really is debug by initialising before DefaultMaven gets looked up.
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@168635 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ef7d9ec2bd
commit
b90399de88
maven-core/src/main/java/org/apache/maven/cli
|
@ -40,7 +40,6 @@ import org.apache.maven.monitor.logging.DefaultLog;
|
|||
import org.apache.maven.plugin.Mojo;
|
||||
import org.apache.maven.reactor.ReactorException;
|
||||
import org.apache.maven.settings.MavenSettingsBuilder;
|
||||
import org.apache.maven.settings.Profile;
|
||||
import org.apache.maven.settings.Settings;
|
||||
import org.codehaus.classworlds.ClassWorld;
|
||||
import org.codehaus.plexus.PlexusContainerException;
|
||||
|
@ -192,9 +191,16 @@ public class MavenCli
|
|||
MavenExecutionRequest request = null;
|
||||
try
|
||||
{
|
||||
maven = createMavenInstance( embedder );
|
||||
// logger must be created first
|
||||
LoggerManager manager = (LoggerManager) embedder.lookup( LoggerManager.ROLE );
|
||||
if ( debug )
|
||||
{
|
||||
manager.setThreshold( Logger.LEVEL_DEBUG );
|
||||
}
|
||||
|
||||
request = createRequest( projectFiles, embedder, commandLine, settings, eventDispatcher, debug );
|
||||
request = createRequest( projectFiles, embedder, commandLine, settings, eventDispatcher, manager );
|
||||
|
||||
maven = createMavenInstance( embedder );
|
||||
}
|
||||
catch ( ComponentLookupException e )
|
||||
{
|
||||
|
@ -247,7 +253,7 @@ public class MavenCli
|
|||
|
||||
private static MavenExecutionRequest createRequest( List files, ArtifactEnabledEmbedder embedder,
|
||||
CommandLine commandLine, Settings settings,
|
||||
EventDispatcher eventDispatcher, boolean debug )
|
||||
EventDispatcher eventDispatcher, LoggerManager manager )
|
||||
throws ComponentLookupException
|
||||
{
|
||||
MavenExecutionRequest request = null;
|
||||
|
@ -257,12 +263,6 @@ public class MavenCli
|
|||
request = new DefaultMavenExecutionRequest( localRepository, settings, eventDispatcher,
|
||||
commandLine.getArgList(), files, userDir.getPath() );
|
||||
|
||||
LoggerManager manager = (LoggerManager) embedder.lookup( LoggerManager.ROLE );
|
||||
if ( debug )
|
||||
{
|
||||
manager.setThreshold( Logger.LEVEL_DEBUG );
|
||||
}
|
||||
|
||||
// TODO [BP]: do we set one per mojo? where to do it?
|
||||
Logger logger = manager.getLoggerForComponent( Mojo.ROLE );
|
||||
if ( logger != null )
|
||||
|
|
Loading…
Reference in New Issue