I think I have a better workaround.
1) Edit $MAVEN_HOME/lib/maven-2.2.1-uber.jar!org/codehaus/plexus/plexus-bootstrap.xml
Replace:
<component>
<role>org.codehaus.plexus.logging.LoggerManager</role>
<implementation>org.codehaus.plexus.logging.console.ConsoleLoggerManager</implementation>
<lifecycle-handler>basic</lifecycle-handler>
<configuration>
<threshold>info</threshold>
</configuration>
</component>
by
<component>
<role>org.codehaus.plexus.logging.LoggerManager</role>
<implementation>
org.codehaus.plexus.logging.slf4j.Slf4jLoggerManager
</implementation>
</component>
2) Download and move into $MAVEN_HOME/lib:
plexus-slf4j-logging-1.1-alpha-1.jar
slf4j-api-1.5.8.jar
And also the slf4j implementation you want to use (in my case it is logback):
logback-core-0.9.15.jar
logback-classic-0.9.15.jar
3) To configure logback you can use a logback.xml file. The only trick is that Maven loader will only pick JAR file in /lib folder so you can simply create a new JAR containing only logback.xml
For example here is my logback.xml:
<?xml version="1.0" encoding="UTF-8" ?>
<!-- Logback configuration file -->
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<layout class="ch.qos.logback.classic.PatternLayout">
<!--Pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</Pattern-->
<Pattern>%-5level %d{HH:mm:ss.SSS} %msg%n</Pattern>
</layout>
</appender>
<root>
<level value="INFO" />
<appender-ref ref="STDOUT" />
</root>
</configuration>
And finally:
>mvn clean
INFO 15:01:32.785 Scanning for projects...
INFO 15:01:32.972 Reactor build order:
...
...
INFO 15:01:34.082 ------------------------------------------------------------------------
INFO 15:01:34.082 BUILD SUCCESSFUL
INFO 15:01:34.082 ------------------------------------------------------------------------
INFO 15:01:34.097 Total time: 1 second
INFO 15:01:34.097 Finished at: Fri Aug 14 15:01:34 CEST 2009
INFO 15:01:34.160 Final Memory: 7M/13M
INFO 15:01:34.160 ------------------------------------------------------------------------
There was no such logger 'org.apache.maven.artifact.metadata.ArtifactMetadataSource:maven' 18061339.
There was no such logger 'org.apache.maven.plugin.PluginMappingManager' 18061339.
There was no such logger 'org.apache.maven.artifact.resolver.ArtifactResolver' 18061339.
There was no such logger 'org.apache.maven.artifact.transform.ArtifactTransformation:snapshot' 18061339.
There was no such logger 'org.apache.maven.profiles.MavenProfilesBuilder' 18061339.
There are two issues with this solution:
1) The -X flag does nothing. You have to manually update logback.xml to change INFO to DEBUG.
2) I don't know why there is the lines:
There was no such logger 'org.apache.maven.profiles.MavenProfilesBuilder' 18061339.
at the end...
Hope that help.
sounds like a good optional enhancement to m2.
For m1, we won't be changing the logging - it currently uses log4j so you can customise the log4j settings built into maven.jar so that a timestamp is output.