mirror of https://github.com/apache/maven.git
turn on logging, resolve some issues surrounding test dependencies
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@163473 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
d514fff118
commit
1d615cd239
|
@ -57,7 +57,8 @@ public class DefaultArtifact
|
|||
/** @todo this should be replaced by type handler */
|
||||
public DefaultArtifact( String groupId, String artifactId, String version, String type, String extension )
|
||||
{
|
||||
this( groupId, artifactId, version, SCOPE_RUNTIME, type, extension );
|
||||
// TODO: default should be runtime, except in currently building POM where it is compile.
|
||||
this( groupId, artifactId, version, SCOPE_COMPILE, type, extension );
|
||||
}
|
||||
|
||||
public DefaultArtifact( String groupId, String artifactId, String version, String type )
|
||||
|
|
|
@ -37,9 +37,11 @@ import org.apache.maven.monitor.event.DefaultEventDispatcher;
|
|||
import org.apache.maven.monitor.event.DefaultEventMonitor;
|
||||
import org.apache.maven.monitor.event.EventDispatcher;
|
||||
import org.apache.maven.monitor.logging.DefaultLog;
|
||||
import org.apache.maven.plugin.Plugin;
|
||||
import org.codehaus.classworlds.ClassWorld;
|
||||
import org.codehaus.plexus.embed.ArtifactEnabledEmbedder;
|
||||
import org.codehaus.plexus.logging.Logger;
|
||||
import org.codehaus.plexus.logging.LoggerManager;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
|
@ -154,18 +156,24 @@ public class MavenCli
|
|||
ArtifactEnabledEmbedder embedder = new ArtifactEnabledEmbedder();
|
||||
|
||||
embedder.start( classWorld );
|
||||
|
||||
Logger logger = embedder.getContainer().getLogger();
|
||||
if( logger != null )
|
||||
|
||||
LoggerManager manager = (LoggerManager) embedder.lookup( LoggerManager.ROLE );
|
||||
if ( commandLine.hasOption( CLIManager.DEBUG ) )
|
||||
{
|
||||
manager.setThreshold( Logger.LEVEL_DEBUG );
|
||||
}
|
||||
|
||||
// TODO [BP]: do we set one per mojo? where to do it?
|
||||
Logger logger = manager.getLoggerForComponent( Plugin.ROLE );
|
||||
if ( logger != null )
|
||||
{
|
||||
request.setLog( new DefaultLog( logger ) );
|
||||
|
||||
request.addEventMonitor( new DefaultEventMonitor( logger ) );
|
||||
}
|
||||
|
||||
// TODO [BP]: doing this here as it is CLI specific, though it doesn't feel like the right place.
|
||||
// TODO [BP]: doing this here as it is CLI specific, though it doesn't feel like the right place (likewise logger).
|
||||
WagonManager wagonManager = (WagonManager) embedder.lookup( WagonManager.ROLE );
|
||||
|
||||
wagonManager.setDownloadMonitor( new ConsoleDownloadMonitor() );
|
||||
|
||||
Maven maven = (Maven) embedder.lookup( Maven.ROLE );
|
||||
|
|
|
@ -807,7 +807,9 @@
|
|||
<version>4.0.0</version>
|
||||
<description>The scope of the dependency - build, compile, test, runtime</description>
|
||||
<type>String</type>
|
||||
<!-- TODO: set default value? see DefaultArtifact first
|
||||
<defaultValue>runtime</defaultValue>
|
||||
-->
|
||||
</field>
|
||||
</fields>
|
||||
<codeSegments>
|
||||
|
|
|
@ -108,6 +108,7 @@ public class CompilerMojo extends AbstractPlugin
|
|||
|
||||
List messages = compiler.compile( compilerConfiguration );
|
||||
|
||||
// TODO: doesn't appear to be called
|
||||
if ( debug )
|
||||
{
|
||||
for ( Iterator i = classpathElements.iterator(); i.hasNext(); )
|
||||
|
|
Loading…
Reference in New Issue