You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Mark Struberg <st...@yahoo.de> on 2012/09/03 09:10:08 UTC

Re: svn commit: r1380105 - in /maven/maven-3/trunk: ./ apache-maven/ maven-core/src/main/java/org/apache/maven/classrealm/ maven-embedder/ maven-embedder/src/main/java/org/apache/maven/cli/

whats the reason for the slf4j bridge? 

This is kown to trash old plugins which use log4j because it clashes with it's namespace and only partly implements the log4j classes.

I personally ind slf4j nice, but for older projects which use commons-logging or log4j already (and where you cant fiddle around with their sources) this broke way too many things for me.
Why is this needed at all? Has nothing to do with JSR-330.

LieGrue,
strub




----- Original Message -----
> From: "jvanzyl@apache.org" <jv...@apache.org>
> To: commits@maven.apache.org
> Cc: 
> Sent: Monday, September 3, 2012 3:07 AM
> Subject: svn commit: r1380105 - in /maven/maven-3/trunk: ./ apache-maven/ maven-core/src/main/java/org/apache/maven/classrealm/ maven-embedder/ maven-embedder/src/main/java/org/apache/maven/cli/
> 
> Author: jvanzyl
> Date: Mon Sep  3 01:07:31 2012
> New Revision: 1380105
> 
> URL: http://svn.apache.org/viewvc?rev=1380105&view=rev
> Log:
> o Enabled support and discovery of JSR-330 components
> 
> o Added Slf4j logger factory to support generic JSR-330 logging
> 
> o Exported Guice package for components that access Guice (or better it's 
> injector) directly
> 
> Widen export of Guice packages (not ideal, need to look into ways to avoid this)
> 
> o use specific exports
> 
> o for now we will attempt to hide all of Guice in plugin realms and we'll do 
> a bit of testing
> 
> closes #3
> 
> Added:
>     
> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLogger.java
>     
> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLoggerFactory.java
> Modified:
>     maven/maven-3/trunk/apache-maven/pom.xml
>     
> maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java
>     maven/maven-3/trunk/maven-embedder/pom.xml
>     
> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
>     maven/maven-3/trunk/pom.xml
> 
> Modified: maven/maven-3/trunk/apache-maven/pom.xml
> URL: 
> http://svn.apache.org/viewvc/maven/maven-3/trunk/apache-maven/pom.xml?rev=1380105&r1=1380104&r2=1380105&view=diff
> ==============================================================================
> --- maven/maven-3/trunk/apache-maven/pom.xml (original)
> +++ maven/maven-3/trunk/apache-maven/pom.xml Mon Sep  3 01:07:31 2012
> @@ -83,6 +83,10 @@
>        <groupId>org.sonatype.aether</groupId>
>        <artifactId>aether-connector-wagon</artifactId>
>      </dependency>
> +    <dependency>
> +      <groupId>org.slf4j</groupId>
> +      <artifactId>slf4j-nop</artifactId>
> +    </dependency>
>    </dependencies>
> 
>    <build>
> 
> Modified: 
> maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java
> URL: 
> http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java?rev=1380105&r1=1380104&r2=1380105&view=diff
> ==============================================================================
> --- 
> maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java 
> (original)
> +++ 
> maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java 
> Mon Sep  3 01:07:31 2012
> @@ -198,6 +198,26 @@ public class DefaultClassRealmManager
>          imports.put( 
> "org.codehaus.plexus.util.xml.pull.XmlPullParser", coreRealm );
>          imports.put( 
> "org.codehaus.plexus.util.xml.pull.XmlPullParserException", coreRealm 
> );
>          imports.put( 
> "org.codehaus.plexus.util.xml.pull.XmlSerializer", coreRealm );
> +
> +        // javax.inject, sisu-inject (JSR-330)
> +        imports.put( "javax.inject.*", coreRealm );
> +        imports.put( "javax.enterprise.inject.*", coreRealm );
> +        imports.put( "org.sonatype.inject.*", coreRealm );
> +        imports.put( "org.slf4j.*", coreRealm );
> +        
> +        // com.google
> +        //
> +        // We may potentially want to export these, but right now I'm not 
> sure that anything Guice specific needs
> +        // to be made available to plugin authors. If we find people are 
> getting fancy and want to take advantage
> +        // of Guice specifics we can expose that later. Really some testing 
> needs to be done to see full hiding
> +        // of Guice has any impact on what we may categorize as a standard 
> JSR-330 based Tesla/Maven plugin.
> +        //
> +        // imports.put( "com.google.inject.*", coreRealm );
> +        // imports.put( "com.google.inject.binder.*", coreRealm );
> +        // imports.put( "com.google.inject.matcher.*", coreRealm );
> +        // imports.put( "com.google.inject.name.*", coreRealm );
> +        // imports.put( "com.google.inject.spi.*", coreRealm );
> +        // imports.put( "com.google.inject.util.*", coreRealm );
>      }
> 
>      /**
> 
> Modified: maven/maven-3/trunk/maven-embedder/pom.xml
> URL: 
> http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-embedder/pom.xml?rev=1380105&r1=1380104&r2=1380105&view=diff
> ==============================================================================
> --- maven/maven-3/trunk/maven-embedder/pom.xml (original)
> +++ maven/maven-3/trunk/maven-embedder/pom.xml Mon Sep  3 01:07:31 2012
> @@ -70,6 +70,10 @@
>        <groupId>org.sonatype.plexus</groupId>
>        <artifactId>plexus-cipher</artifactId>
>      </dependency>
> +    <dependency>
> +      <groupId>org.slf4j</groupId>
> +      <artifactId>slf4j-api</artifactId>
> +    </dependency>
>      <!-- CLI -->
>      <dependency>
>        <groupId>commons-cli</groupId>
> 
> Modified: 
> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
> URL: 
> http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java?rev=1380105&r1=1380104&r2=1380105&view=diff
> ==============================================================================
> --- 
> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java 
> (original)
> +++ 
> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java 
> Mon Sep  3 01:07:31 2012
> @@ -59,12 +59,14 @@ import org.apache.maven.settings.buildin
> import org.codehaus.plexus.ContainerConfiguration;
> import org.codehaus.plexus.DefaultContainerConfiguration;
> import org.codehaus.plexus.DefaultPlexusContainer;
> +import org.codehaus.plexus.PlexusConstants;
> import org.codehaus.plexus.PlexusContainer;
> import org.codehaus.plexus.classworlds.ClassWorld;
> import org.codehaus.plexus.classworlds.realm.ClassRealm;
> import 
> org.codehaus.plexus.component.repository.exception.ComponentLookupException;
> import org.codehaus.plexus.logging.Logger;
> import org.codehaus.plexus.util.StringUtils;
> +import org.slf4j.ILoggerFactory;
> import org.sonatype.aether.transfer.TransferListener;
> import org.sonatype.plexus.components.cipher.DefaultPlexusCipher;
> import org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher;
> @@ -72,6 +74,8 @@ import org.sonatype.plexus.components.se
> import org.sonatype.plexus.components.sec.dispatcher.SecUtil;
> import org.sonatype.plexus.components.sec.dispatcher.model.SettingsSecurity;
> 
> +import com.google.inject.AbstractModule;
> +
> // TODO: push all common bits back to plexus cli and prepare for transition to 
> Guice. We don't need 50 ways to make CLIs
> 
> /**
> @@ -372,17 +376,29 @@ public class MavenCli
>          {
>              logger = setupLogger( cliRequest );
> 
> +            final MavenLoggerManager loggerManager = new MavenLoggerManager( 
> logger ) ;
> +
>              ContainerConfiguration cc = new DefaultContainerConfiguration()
>                  .setClassWorld( cliRequest.classWorld )
>                  .setRealm( setupContainerRealm( cliRequest ) )
> +                .setClassPathScanning( PlexusConstants.SCANNING_INDEX )
> +                .setAutoWiring( true )
>                  .setName( "maven" );
> 
> -            container = new DefaultPlexusContainer( cc );
> +            container = new DefaultPlexusContainer( cc, new AbstractModule()
> +            {
> +
> +                protected void configure()
> +                {
> +                    bind( ILoggerFactory.class ).toInstance( new 
> PlexusLoggerFactory( loggerManager ) );
> +                }
> +
> +            } );
> 
>              // NOTE: To avoid inconsistencies, we'll use the TCCL 
> exclusively for lookups
>              container.setLookupRealm( null );
> 
> -            container.setLoggerManager( new MavenLoggerManager( logger ) );
> +            container.setLoggerManager( loggerManager );
> 
>              customizeContainer( container );
> 
> 
> Added: 
> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLogger.java
> URL: 
> http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLogger.java?rev=1380105&view=auto
> ==============================================================================
> --- 
> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLogger.java 
> (added)
> +++ 
> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLogger.java 
> Mon Sep  3 01:07:31 2012
> @@ -0,0 +1,358 @@
> +package org.apache.maven.cli;
> +
> +/*
> + * Licensed to the Apache Software Foundation (ASF) under one
> + * or more contributor license agreements.  See the NOTICE file
> + * distributed with this work for additional information
> + * regarding copyright ownership.  The ASF licenses this file
> + * to you under the Apache License, Version 2.0 (the
> + * "License"); you may not use this file except in compliance
> + * with the License.  You may obtain a copy of the License at
> + *
> + *  http://www.apache.org/licenses/LICENSE-2.0
> + *
> + * Unless required by applicable law or agreed to in writing,
> + * software distributed under the License is distributed on an
> + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> + * KIND, either express or implied.  See the License for the
> + * specific language governing permissions and limitations
> + * under the License.
> + */
> +
> +import org.slf4j.Logger;
> +import org.slf4j.Marker;
> +import org.slf4j.helpers.FormattingTuple;
> +import org.slf4j.helpers.MessageFormatter;
> +
> +/**
> + * A Slf4j logger bridged onto a Plexus logger.
> + */
> +class PlexusLogger
> +    implements Logger
> +{
> +
> +    private final org.codehaus.plexus.logging.Logger logger;
> +
> +    public PlexusLogger( org.codehaus.plexus.logging.Logger logger )
> +    {
> +        this.logger = logger;
> +    }
> +
> +    public String getName()
> +    {
> +        return logger.getName();
> +    }
> +
> +    public boolean isTraceEnabled()
> +    {
> +        return isDebugEnabled();
> +    }
> +
> +    public void trace( String msg )
> +    {
> +        debug( msg );
> +    }
> +
> +    public void trace( String format, Object arg )
> +    {
> +        debug( format, arg );
> +    }
> +
> +    public void trace( String format, Object arg1, Object arg2 )
> +    {
> +        debug( format, arg1, arg2 );
> +    }
> +
> +    public void trace( String format, Object[] argArray )
> +    {
> +        debug( format, argArray );
> +    }
> +
> +    public void trace( String msg, Throwable t )
> +    {
> +        debug( msg, t );
> +    }
> +
> +    public boolean isTraceEnabled( Marker marker )
> +    {
> +        return isTraceEnabled();
> +    }
> +
> +    public void trace( Marker marker, String msg )
> +    {
> +        trace( msg );
> +    }
> +
> +    public void trace( Marker marker, String format, Object arg )
> +    {
> +        trace( format, arg );
> +    }
> +
> +    public void trace( Marker marker, String format, Object arg1, Object arg2 )
> +    {
> +        trace( format, arg1, arg2 );
> +    }
> +
> +    public void trace( Marker marker, String format, Object[] argArray )
> +    {
> +        trace( format, argArray );
> +    }
> +
> +    public void trace( Marker marker, String msg, Throwable t )
> +    {
> +        trace( msg, t );
> +    }
> +
> +    public boolean isDebugEnabled()
> +    {
> +        return logger.isDebugEnabled();
> +    }
> +
> +    public void debug( String msg )
> +    {
> +        logger.debug( msg );
> +    }
> +
> +    public void debug( String format, Object arg )
> +    {
> +        FormattingTuple ft = MessageFormatter.format( format, arg );
> +        logger.debug( ft.getMessage(), ft.getThrowable() );
> +    }
> +
> +    public void debug( String format, Object arg1, Object arg2 )
> +    {
> +        FormattingTuple ft = MessageFormatter.format( format, arg1, arg2 );
> +        logger.debug( ft.getMessage(), ft.getThrowable() );
> +    }
> +
> +    public void debug( String format, Object[] argArray )
> +    {
> +        FormattingTuple ft = MessageFormatter.arrayFormat( format, argArray );
> +        logger.debug( ft.getMessage(), ft.getThrowable() );
> +    }
> +
> +    public void debug( String msg, Throwable t )
> +    {
> +        logger.debug( msg, t );
> +    }
> +
> +    public boolean isDebugEnabled( Marker marker )
> +    {
> +        return isDebugEnabled();
> +    }
> +
> +    public void debug( Marker marker, String msg )
> +    {
> +        debug( msg );
> +    }
> +
> +    public void debug( Marker marker, String format, Object arg )
> +    {
> +        debug( format, arg );
> +    }
> +
> +    public void debug( Marker marker, String format, Object arg1, Object arg2 )
> +    {
> +        debug( format, arg1, arg2 );
> +    }
> +
> +    public void debug( Marker marker, String format, Object[] argArray )
> +    {
> +        debug( format, argArray );
> +    }
> +
> +    public void debug( Marker marker, String msg, Throwable t )
> +    {
> +        debug( msg, t );
> +    }
> +
> +    public boolean isInfoEnabled()
> +    {
> +        return logger.isInfoEnabled();
> +    }
> +
> +    public void info( String msg )
> +    {
> +        logger.info( msg );
> +    }
> +
> +    public void info( String format, Object arg )
> +    {
> +        FormattingTuple ft = MessageFormatter.format( format, arg );
> +        logger.info( ft.getMessage(), ft.getThrowable() );
> +    }
> +
> +    public void info( String format, Object arg1, Object arg2 )
> +    {
> +        FormattingTuple ft = MessageFormatter.format( format, arg1, arg2 );
> +        logger.info( ft.getMessage(), ft.getThrowable() );
> +    }
> +
> +    public void info( String format, Object[] argArray )
> +    {
> +        FormattingTuple ft = MessageFormatter.arrayFormat( format, argArray );
> +        logger.info( ft.getMessage(), ft.getThrowable() );
> +    }
> +
> +    public void info( String msg, Throwable t )
> +    {
> +        logger.info( msg, t );
> +    }
> +
> +    public boolean isInfoEnabled( Marker marker )
> +    {
> +        return isInfoEnabled();
> +    }
> +
> +    public void info( Marker marker, String msg )
> +    {
> +        info( msg );
> +    }
> +
> +    public void info( Marker marker, String format, Object arg )
> +    {
> +        info( format, arg );
> +    }
> +
> +    public void info( Marker marker, String format, Object arg1, Object arg2 )
> +    {
> +        info( format, arg1, arg2 );
> +    }
> +
> +    public void info( Marker marker, String format, Object[] argArray )
> +    {
> +        info( format, argArray );
> +    }
> +
> +    public void info( Marker marker, String msg, Throwable t )
> +    {
> +        info( msg, t );
> +    }
> +
> +    public boolean isWarnEnabled()
> +    {
> +        return logger.isWarnEnabled();
> +    }
> +
> +    public void warn( String msg )
> +    {
> +        logger.warn( msg );
> +    }
> +
> +    public void warn( String format, Object arg )
> +    {
> +        FormattingTuple ft = MessageFormatter.format( format, arg );
> +        logger.warn( ft.getMessage(), ft.getThrowable() );
> +    }
> +
> +    public void warn( String format, Object arg1, Object arg2 )
> +    {
> +        FormattingTuple ft = MessageFormatter.format( format, arg1, arg2 );
> +        logger.warn( ft.getMessage(), ft.getThrowable() );
> +    }
> +
> +    public void warn( String format, Object[] argArray )
> +    {
> +        FormattingTuple ft = MessageFormatter.arrayFormat( format, argArray );
> +        logger.warn( ft.getMessage(), ft.getThrowable() );
> +    }
> +
> +    public void warn( String msg, Throwable t )
> +    {
> +        logger.warn( msg, t );
> +    }
> +
> +    public boolean isWarnEnabled( Marker marker )
> +    {
> +        return isWarnEnabled();
> +    }
> +
> +    public void warn( Marker marker, String msg )
> +    {
> +        warn( msg );
> +    }
> +
> +    public void warn( Marker marker, String format, Object arg )
> +    {
> +        warn( format, arg );
> +    }
> +
> +    public void warn( Marker marker, String format, Object arg1, Object arg2 )
> +    {
> +        warn( format, arg1, arg2 );
> +    }
> +
> +    public void warn( Marker marker, String format, Object[] argArray )
> +    {
> +        warn( format, argArray );
> +    }
> +
> +    public void warn( Marker marker, String msg, Throwable t )
> +    {
> +        warn( msg, t );
> +    }
> +
> +    public boolean isErrorEnabled()
> +    {
> +        return logger.isErrorEnabled();
> +    }
> +
> +    public void error( String msg )
> +    {
> +        logger.error( msg );
> +    }
> +
> +    public void error( String format, Object arg )
> +    {
> +        FormattingTuple ft = MessageFormatter.format( format, arg );
> +        logger.error( ft.getMessage(), ft.getThrowable() );
> +    }
> +
> +    public void error( String format, Object arg1, Object arg2 )
> +    {
> +        FormattingTuple ft = MessageFormatter.format( format, arg1, arg2 );
> +        logger.error( ft.getMessage(), ft.getThrowable() );
> +    }
> +
> +    public void error( String format, Object[] argArray )
> +    {
> +        FormattingTuple ft = MessageFormatter.arrayFormat( format, argArray );
> +        logger.error( ft.getMessage(), ft.getThrowable() );
> +    }
> +
> +    public void error( String msg, Throwable t )
> +    {
> +        logger.error( msg, t );
> +    }
> +
> +    public boolean isErrorEnabled( Marker marker )
> +    {
> +        return isErrorEnabled();
> +    }
> +
> +    public void error( Marker marker, String msg )
> +    {
> +        error( msg );
> +    }
> +
> +    public void error( Marker marker, String format, Object arg )
> +    {
> +        error( format, arg );
> +    }
> +
> +    public void error( Marker marker, String format, Object arg1, Object arg2 )
> +    {
> +        error( format, arg1, arg2 );
> +    }
> +
> +    public void error( Marker marker, String format, Object[] argArray )
> +    {
> +        error( format, argArray );
> +    }
> +
> +    public void error( Marker marker, String msg, Throwable t )
> +    {
> +        error( msg, t );
> +    }
> +
> +}
> 
> Added: 
> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLoggerFactory.java
> URL: 
> http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLoggerFactory.java?rev=1380105&view=auto
> ==============================================================================
> --- 
> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLoggerFactory.java 
> (added)
> +++ 
> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLoggerFactory.java 
> Mon Sep  3 01:07:31 2012
> @@ -0,0 +1,50 @@
> +package org.apache.maven.cli;
> +
> +/*
> + * Licensed to the Apache Software Foundation (ASF) under one
> + * or more contributor license agreements.  See the NOTICE file
> + * distributed with this work for additional information
> + * regarding copyright ownership.  The ASF licenses this file
> + * to you under the Apache License, Version 2.0 (the
> + * "License"); you may not use this file except in compliance
> + * with the License.  You may obtain a copy of the License at
> + *
> + *  http://www.apache.org/licenses/LICENSE-2.0
> + *
> + * Unless required by applicable law or agreed to in writing,
> + * software distributed under the License is distributed on an
> + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> + * KIND, either express or implied.  See the License for the
> + * specific language governing permissions and limitations
> + * under the License.
> + */
> +
> +import org.codehaus.plexus.logging.LoggerManager;
> +import org.slf4j.ILoggerFactory;
> +import org.slf4j.Logger;
> +
> +/**
> + * A Slf4j logger factory bridged onto a Plexus logger manager.
> + */
> +public class PlexusLoggerFactory
> +    implements ILoggerFactory
> +{
> +
> +    private LoggerManager loggerManager;
> +
> +    public PlexusLoggerFactory( LoggerManager loggerManager )
> +    {
> +        this.loggerManager = loggerManager;
> +    }
> +
> +    public void setLoggerManager( LoggerManager loggerManager )
> +    {
> +        this.loggerManager = loggerManager;
> +    }
> +
> +    public Logger getLogger( String name )
> +    {
> +        return new PlexusLogger( loggerManager.getLoggerForComponent( name, 
> null ) );
> +    }
> +
> +}
> 
> Modified: maven/maven-3/trunk/pom.xml
> URL: 
> http://svn.apache.org/viewvc/maven/maven-3/trunk/pom.xml?rev=1380105&r1=1380104&r2=1380105&view=diff
> ==============================================================================
> --- maven/maven-3/trunk/pom.xml (original)
> +++ maven/maven-3/trunk/pom.xml Mon Sep  3 01:07:31 2012
> @@ -56,6 +56,7 @@
>      <modelloVersion>1.4.1</modelloVersion>
>      <jxpathVersion>1.3</jxpathVersion>
>      <aetherVersion>1.13.1</aetherVersion>
> +    <slf4jVersion>1.6.1</slf4jVersion>
>     
> <maven.test.redirectTestOutputToFile>true</maven.test.redirectTestOutputToFile>
>      <!-- Control the name of the distribution and information output by mvn 
> -->
>      <distributionId>apache-maven</distributionId>
> @@ -203,6 +204,17 @@
>          <artifactId>plexus-interpolation</artifactId>
>          <version>${plexusInterpolationVersion}</version>
>        </dependency>
> +      <dependency>
> +        <groupId>org.slf4j</groupId>
> +        <artifactId>slf4j-api</artifactId>
> +        <version>${slf4jVersion}</version>
> +      </dependency>
> +      <dependency>
> +        <groupId>org.slf4j</groupId>
> +        <artifactId>slf4j-nop</artifactId>
> +        <version>${slf4jVersion}</version>
> +        <scope>runtime</scope>
> +      </dependency>
>        <!--  Wagon -->
>        <dependency>
>          <groupId>org.apache.maven.wagon</groupId>
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: svn commit: r1380105 - in /maven/maven-3/trunk: ./ apache-maven/ maven-core/src/main/java/org/apache/maven/classrealm/ maven-embedder/ maven-embedder/src/main/java/org/apache/maven/cli/

Posted by Mark Struberg <st...@yahoo.de>.
but you don't expose it to maven plugins, do you? I guess not, because it was not in the root realm classpath.

LieGrue,
strub




----- Original Message -----
> From: Igor Fedorenko <ig...@ifedorenko.com>
> To: dev@maven.apache.org
> Cc: 
> Sent: Monday, September 3, 2012 2:25 PM
> Subject: Re: svn commit: r1380105 - in /maven/maven-3/trunk: ./ apache-maven/ maven-core/src/main/java/org/apache/maven/classrealm/ maven-embedder/ maven-embedder/src/main/java/org/apache/maven/cli/
> 
> FWIW, we are using sfl4j and logback as part of m2e embedded maven
> runtime for over a year now without any major issues. There was a
> problem with older IBM JVMs [1], but it is fixed now in slf4j (and
> in IBM code too, as far as I understand).
> 
> [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=338252
> 
> --
> Regards,
> Igor
> 
> 
> On 12-09-03 3:10 AM, Mark Struberg wrote:
>>  whats the reason for the slf4j bridge?
>> 
>>  This is kown to trash old plugins which use log4j because it clashes
>>  with it's namespace and only partly implements the log4j classes.
>> 
>>  I personally ind slf4j nice, but for older projects which use
>>  commons-logging or log4j already (and where you cant fiddle around
>>  with their sources) this broke way too many things for me. Why is
>>  this needed at all? Has nothing to do with JSR-330.
>> 
>>  LieGrue, strub >
>> 
>> 
>> 
>>  ----- Original Message -----
>>>  From: "jvanzyl@apache.org" <jv...@apache.org>
>>>  To: commits@maven.apache.org
>>>  Cc:
>>>  Sent: Monday, September 3, 2012 3:07 AM
>>>  Subject: svn commit: r1380105 - in /maven/maven-3/trunk: ./ 
> apache-maven/ maven-core/src/main/java/org/apache/maven/classrealm/ 
> maven-embedder/ maven-embedder/src/main/java/org/apache/maven/cli/
>>> 
>>>  Author: jvanzyl
>>>  Date: Mon Sep  3 01:07:31 2012
>>>  New Revision: 1380105
>>> 
>>>  URL: http://svn.apache.org/viewvc?rev=1380105&view=rev
>>>  Log:
>>>  o Enabled support and discovery of JSR-330 components
>>> 
>>>  o Added Slf4j logger factory to support generic JSR-330 logging
>>> 
>>>  o Exported Guice package for components that access Guice (or better 
> it's
>>>  injector) directly
>>> 
>>>  Widen export of Guice packages (not ideal, need to look into ways to 
> avoid this)
>>> 
>>>  o use specific exports
>>> 
>>>  o for now we will attempt to hide all of Guice in plugin realms and 
> we'll do
>>>  a bit of testing
>>> 
>>>  closes #3
>>> 
>>>  Added:
>>> 
>>> 
> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLogger.java
>>> 
>>> 
> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLoggerFactory.java
>>>  Modified:
>>>       maven/maven-3/trunk/apache-maven/pom.xml
>>> 
>>> 
> maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java
>>>       maven/maven-3/trunk/maven-embedder/pom.xml
>>> 
>>> 
> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
>>>       maven/maven-3/trunk/pom.xml
>>> 
>>>  Modified: maven/maven-3/trunk/apache-maven/pom.xml
>>>  URL:
>>> 
> http://svn.apache.org/viewvc/maven/maven-3/trunk/apache-maven/pom.xml?rev=1380105&r1=1380104&r2=1380105&view=diff
>>> 
> ==============================================================================
>>>  --- maven/maven-3/trunk/apache-maven/pom.xml (original)
>>>  +++ maven/maven-3/trunk/apache-maven/pom.xml Mon Sep  3 01:07:31 2012
>>>  @@ -83,6 +83,10 @@
>>>          <groupId>org.sonatype.aether</groupId>
>>>          <artifactId>aether-connector-wagon</artifactId>
>>>        </dependency>
>>>  +    <dependency>
>>>  +      <groupId>org.slf4j</groupId>
>>>  +      <artifactId>slf4j-nop</artifactId>
>>>  +    </dependency>
>>>      </dependencies>
>>> 
>>>      <build>
>>> 
>>>  Modified:
>>> 
> maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java
>>>  URL:
>>> 
> http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java?rev=1380105&r1=1380104&r2=1380105&view=diff
>>> 
> ==============================================================================
>>>  ---
>>> 
> maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java
>>>  (original)
>>>  +++
>>> 
> maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java
>>>  Mon Sep  3 01:07:31 2012
>>>  @@ -198,6 +198,26 @@ public class DefaultClassRealmManager
>>>            imports.put(
>>>  "org.codehaus.plexus.util.xml.pull.XmlPullParser", coreRealm 
> );
>>>            imports.put(
>>>  "org.codehaus.plexus.util.xml.pull.XmlPullParserException", 
> coreRealm
>>>  );
>>>            imports.put(
>>>  "org.codehaus.plexus.util.xml.pull.XmlSerializer", coreRealm 
> );
>>>  +
>>>  +        // javax.inject, sisu-inject (JSR-330)
>>>  +        imports.put( "javax.inject.*", coreRealm );
>>>  +        imports.put( "javax.enterprise.inject.*", coreRealm 
> );
>>>  +        imports.put( "org.sonatype.inject.*", coreRealm );
>>>  +        imports.put( "org.slf4j.*", coreRealm );
>>>  +
>>>  +        // com.google
>>>  +        //
>>>  +        // We may potentially want to export these, but right now 
> I'm not
>>>  sure that anything Guice specific needs
>>>  +        // to be made available to plugin authors. If we find people 
> are
>>>  getting fancy and want to take advantage
>>>  +        // of Guice specifics we can expose that later. Really some 
> testing
>>>  needs to be done to see full hiding
>>>  +        // of Guice has any impact on what we may categorize as a 
> standard
>>>  JSR-330 based Tesla/Maven plugin.
>>>  +        //
>>>  +        // imports.put( "com.google.inject.*", coreRealm );
>>>  +        // imports.put( "com.google.inject.binder.*", 
> coreRealm );
>>>  +        // imports.put( "com.google.inject.matcher.*", 
> coreRealm );
>>>  +        // imports.put( "com.google.inject.name.*", 
> coreRealm );
>>>  +        // imports.put( "com.google.inject.spi.*", coreRealm 
> );
>>>  +        // imports.put( "com.google.inject.util.*", 
> coreRealm );
>>>        }
>>> 
>>>        /**
>>> 
>>>  Modified: maven/maven-3/trunk/maven-embedder/pom.xml
>>>  URL:
>>> 
> http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-embedder/pom.xml?rev=1380105&r1=1380104&r2=1380105&view=diff
>>> 
> ==============================================================================
>>>  --- maven/maven-3/trunk/maven-embedder/pom.xml (original)
>>>  +++ maven/maven-3/trunk/maven-embedder/pom.xml Mon Sep  3 01:07:31 2012
>>>  @@ -70,6 +70,10 @@
>>>          <groupId>org.sonatype.plexus</groupId>
>>>          <artifactId>plexus-cipher</artifactId>
>>>        </dependency>
>>>  +    <dependency>
>>>  +      <groupId>org.slf4j</groupId>
>>>  +      <artifactId>slf4j-api</artifactId>
>>>  +    </dependency>
>>>        <!-- CLI -->
>>>        <dependency>
>>>          <groupId>commons-cli</groupId>
>>> 
>>>  Modified:
>>> 
> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
>>>  URL:
>>> 
> http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java?rev=1380105&r1=1380104&r2=1380105&view=diff
>>> 
> ==============================================================================
>>>  ---
>>> 
> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
>>>  (original)
>>>  +++
>>> 
> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
>>>  Mon Sep  3 01:07:31 2012
>>>  @@ -59,12 +59,14 @@ import org.apache.maven.settings.buildin
>>>  import org.codehaus.plexus.ContainerConfiguration;
>>>  import org.codehaus.plexus.DefaultContainerConfiguration;
>>>  import org.codehaus.plexus.DefaultPlexusContainer;
>>>  +import org.codehaus.plexus.PlexusConstants;
>>>  import org.codehaus.plexus.PlexusContainer;
>>>  import org.codehaus.plexus.classworlds.ClassWorld;
>>>  import org.codehaus.plexus.classworlds.realm.ClassRealm;
>>>  import
>>> 
> org.codehaus.plexus.component.repository.exception.ComponentLookupException;
>>>  import org.codehaus.plexus.logging.Logger;
>>>  import org.codehaus.plexus.util.StringUtils;
>>>  +import org.slf4j.ILoggerFactory;
>>>  import org.sonatype.aether.transfer.TransferListener;
>>>  import org.sonatype.plexus.components.cipher.DefaultPlexusCipher;
>>>  import 
> org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher;
>>>  @@ -72,6 +74,8 @@ import org.sonatype.plexus.components.se
>>>  import org.sonatype.plexus.components.sec.dispatcher.SecUtil;
>>>  import 
> org.sonatype.plexus.components.sec.dispatcher.model.SettingsSecurity;
>>> 
>>>  +import com.google.inject.AbstractModule;
>>>  +
>>>  // TODO: push all common bits back to plexus cli and prepare for 
> transition to
>>>  Guice. We don't need 50 ways to make CLIs
>>> 
>>>  /**
>>>  @@ -372,17 +376,29 @@ public class MavenCli
>>>            {
>>>                logger = setupLogger( cliRequest );
>>> 
>>>  +            final MavenLoggerManager loggerManager = new 
> MavenLoggerManager(
>>>  logger ) ;
>>>  +
>>>                ContainerConfiguration cc = new 
> DefaultContainerConfiguration()
>>>                    .setClassWorld( cliRequest.classWorld )
>>>                    .setRealm( setupContainerRealm( cliRequest ) )
>>>  +                .setClassPathScanning( PlexusConstants.SCANNING_INDEX 
> )
>>>  +                .setAutoWiring( true )
>>>                    .setName( "maven" );
>>> 
>>>  -            container = new DefaultPlexusContainer( cc );
>>>  +            container = new DefaultPlexusContainer( cc, new 
> AbstractModule()
>>>  +            {
>>>  +
>>>  +                protected void configure()
>>>  +                {
>>>  +                    bind( ILoggerFactory.class ).toInstance( new
>>>  PlexusLoggerFactory( loggerManager ) );
>>>  +                }
>>>  +
>>>  +            } );
>>> 
>>>                // NOTE: To avoid inconsistencies, we'll use the TCCL
>>>  exclusively for lookups
>>>                container.setLookupRealm( null );
>>> 
>>>  -            container.setLoggerManager( new MavenLoggerManager( logger 
> ) );
>>>  +            container.setLoggerManager( loggerManager );
>>> 
>>>                customizeContainer( container );
>>> 
>>> 
>>>  Added:
>>> 
> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLogger.java
>>>  URL:
>>> 
> http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLogger.java?rev=1380105&view=auto
>>> 
> ==============================================================================
>>>  ---
>>> 
> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLogger.java
>>>  (added)
>>>  +++
>>> 
> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLogger.java
>>>  Mon Sep  3 01:07:31 2012
>>>  @@ -0,0 +1,358 @@
>>>  +package org.apache.maven.cli;
>>>  +
>>>  +/*
>>>  + * Licensed to the Apache Software Foundation (ASF) under one
>>>  + * or more contributor license agreements.  See the NOTICE file
>>>  + * distributed with this work for additional information
>>>  + * regarding copyright ownership.  The ASF licenses this file
>>>  + * to you under the Apache License, Version 2.0 (the
>>>  + * "License"); you may not use this file except in 
> compliance
>>>  + * with the License.  You may obtain a copy of the License at
>>>  + *
>>>  + *  http://www.apache.org/licenses/LICENSE-2.0
>>>  + *
>>>  + * Unless required by applicable law or agreed to in writing,
>>>  + * software distributed under the License is distributed on an
>>>  + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>>>  + * KIND, either express or implied.  See the License for the
>>>  + * specific language governing permissions and limitations
>>>  + * under the License.
>>>  + */
>>>  +
>>>  +import org.slf4j.Logger;
>>>  +import org.slf4j.Marker;
>>>  +import org.slf4j.helpers.FormattingTuple;
>>>  +import org.slf4j.helpers.MessageFormatter;
>>>  +
>>>  +/**
>>>  + * A Slf4j logger bridged onto a Plexus logger.
>>>  + */
>>>  +class PlexusLogger
>>>  +    implements Logger
>>>  +{
>>>  +
>>>  +    private final org.codehaus.plexus.logging.Logger logger;
>>>  +
>>>  +    public PlexusLogger( org.codehaus.plexus.logging.Logger logger )
>>>  +    {
>>>  +        this.logger = logger;
>>>  +    }
>>>  +
>>>  +    public String getName()
>>>  +    {
>>>  +        return logger.getName();
>>>  +    }
>>>  +
>>>  +    public boolean isTraceEnabled()
>>>  +    {
>>>  +        return isDebugEnabled();
>>>  +    }
>>>  +
>>>  +    public void trace( String msg )
>>>  +    {
>>>  +        debug( msg );
>>>  +    }
>>>  +
>>>  +    public void trace( String format, Object arg )
>>>  +    {
>>>  +        debug( format, arg );
>>>  +    }
>>>  +
>>>  +    public void trace( String format, Object arg1, Object arg2 )
>>>  +    {
>>>  +        debug( format, arg1, arg2 );
>>>  +    }
>>>  +
>>>  +    public void trace( String format, Object[] argArray )
>>>  +    {
>>>  +        debug( format, argArray );
>>>  +    }
>>>  +
>>>  +    public void trace( String msg, Throwable t )
>>>  +    {
>>>  +        debug( msg, t );
>>>  +    }
>>>  +
>>>  +    public boolean isTraceEnabled( Marker marker )
>>>  +    {
>>>  +        return isTraceEnabled();
>>>  +    }
>>>  +
>>>  +    public void trace( Marker marker, String msg )
>>>  +    {
>>>  +        trace( msg );
>>>  +    }
>>>  +
>>>  +    public void trace( Marker marker, String format, Object arg )
>>>  +    {
>>>  +        trace( format, arg );
>>>  +    }
>>>  +
>>>  +    public void trace( Marker marker, String format, Object arg1, 
> Object arg2 )
>>>  +    {
>>>  +        trace( format, arg1, arg2 );
>>>  +    }
>>>  +
>>>  +    public void trace( Marker marker, String format, Object[] argArray 
> )
>>>  +    {
>>>  +        trace( format, argArray );
>>>  +    }
>>>  +
>>>  +    public void trace( Marker marker, String msg, Throwable t )
>>>  +    {
>>>  +        trace( msg, t );
>>>  +    }
>>>  +
>>>  +    public boolean isDebugEnabled()
>>>  +    {
>>>  +        return logger.isDebugEnabled();
>>>  +    }
>>>  +
>>>  +    public void debug( String msg )
>>>  +    {
>>>  +        logger.debug( msg );
>>>  +    }
>>>  +
>>>  +    public void debug( String format, Object arg )
>>>  +    {
>>>  +        FormattingTuple ft = MessageFormatter.format( format, arg );
>>>  +        logger.debug( ft.getMessage(), ft.getThrowable() );
>>>  +    }
>>>  +
>>>  +    public void debug( String format, Object arg1, Object arg2 )
>>>  +    {
>>>  +        FormattingTuple ft = MessageFormatter.format( format, arg1, 
> arg2 );
>>>  +        logger.debug( ft.getMessage(), ft.getThrowable() );
>>>  +    }
>>>  +
>>>  +    public void debug( String format, Object[] argArray )
>>>  +    {
>>>  +        FormattingTuple ft = MessageFormatter.arrayFormat( format, 
> argArray );
>>>  +        logger.debug( ft.getMessage(), ft.getThrowable() );
>>>  +    }
>>>  +
>>>  +    public void debug( String msg, Throwable t )
>>>  +    {
>>>  +        logger.debug( msg, t );
>>>  +    }
>>>  +
>>>  +    public boolean isDebugEnabled( Marker marker )
>>>  +    {
>>>  +        return isDebugEnabled();
>>>  +    }
>>>  +
>>>  +    public void debug( Marker marker, String msg )
>>>  +    {
>>>  +        debug( msg );
>>>  +    }
>>>  +
>>>  +    public void debug( Marker marker, String format, Object arg )
>>>  +    {
>>>  +        debug( format, arg );
>>>  +    }
>>>  +
>>>  +    public void debug( Marker marker, String format, Object arg1, 
> Object arg2 )
>>>  +    {
>>>  +        debug( format, arg1, arg2 );
>>>  +    }
>>>  +
>>>  +    public void debug( Marker marker, String format, Object[] argArray 
> )
>>>  +    {
>>>  +        debug( format, argArray );
>>>  +    }
>>>  +
>>>  +    public void debug( Marker marker, String msg, Throwable t )
>>>  +    {
>>>  +        debug( msg, t );
>>>  +    }
>>>  +
>>>  +    public boolean isInfoEnabled()
>>>  +    {
>>>  +        return logger.isInfoEnabled();
>>>  +    }
>>>  +
>>>  +    public void info( String msg )
>>>  +    {
>>>  +        logger.info( msg );
>>>  +    }
>>>  +
>>>  +    public void info( String format, Object arg )
>>>  +    {
>>>  +        FormattingTuple ft = MessageFormatter.format( format, arg );
>>>  +        logger.info( ft.getMessage(), ft.getThrowable() );
>>>  +    }
>>>  +
>>>  +    public void info( String format, Object arg1, Object arg2 )
>>>  +    {
>>>  +        FormattingTuple ft = MessageFormatter.format( format, arg1, 
> arg2 );
>>>  +        logger.info( ft.getMessage(), ft.getThrowable() );
>>>  +    }
>>>  +
>>>  +    public void info( String format, Object[] argArray )
>>>  +    {
>>>  +        FormattingTuple ft = MessageFormatter.arrayFormat( format, 
> argArray );
>>>  +        logger.info( ft.getMessage(), ft.getThrowable() );
>>>  +    }
>>>  +
>>>  +    public void info( String msg, Throwable t )
>>>  +    {
>>>  +        logger.info( msg, t );
>>>  +    }
>>>  +
>>>  +    public boolean isInfoEnabled( Marker marker )
>>>  +    {
>>>  +        return isInfoEnabled();
>>>  +    }
>>>  +
>>>  +    public void info( Marker marker, String msg )
>>>  +    {
>>>  +        info( msg );
>>>  +    }
>>>  +
>>>  +    public void info( Marker marker, String format, Object arg )
>>>  +    {
>>>  +        info( format, arg );
>>>  +    }
>>>  +
>>>  +    public void info( Marker marker, String format, Object arg1, 
> Object arg2 )
>>>  +    {
>>>  +        info( format, arg1, arg2 );
>>>  +    }
>>>  +
>>>  +    public void info( Marker marker, String format, Object[] argArray 
> )
>>>  +    {
>>>  +        info( format, argArray );
>>>  +    }
>>>  +
>>>  +    public void info( Marker marker, String msg, Throwable t )
>>>  +    {
>>>  +        info( msg, t );
>>>  +    }
>>>  +
>>>  +    public boolean isWarnEnabled()
>>>  +    {
>>>  +        return logger.isWarnEnabled();
>>>  +    }
>>>  +
>>>  +    public void warn( String msg )
>>>  +    {
>>>  +        logger.warn( msg );
>>>  +    }
>>>  +
>>>  +    public void warn( String format, Object arg )
>>>  +    {
>>>  +        FormattingTuple ft = MessageFormatter.format( format, arg );
>>>  +        logger.warn( ft.getMessage(), ft.getThrowable() );
>>>  +    }
>>>  +
>>>  +    public void warn( String format, Object arg1, Object arg2 )
>>>  +    {
>>>  +        FormattingTuple ft = MessageFormatter.format( format, arg1, 
> arg2 );
>>>  +        logger.warn( ft.getMessage(), ft.getThrowable() );
>>>  +    }
>>>  +
>>>  +    public void warn( String format, Object[] argArray )
>>>  +    {
>>>  +        FormattingTuple ft = MessageFormatter.arrayFormat( format, 
> argArray );
>>>  +        logger.warn( ft.getMessage(), ft.getThrowable() );
>>>  +    }
>>>  +
>>>  +    public void warn( String msg, Throwable t )
>>>  +    {
>>>  +        logger.warn( msg, t );
>>>  +    }
>>>  +
>>>  +    public boolean isWarnEnabled( Marker marker )
>>>  +    {
>>>  +        return isWarnEnabled();
>>>  +    }
>>>  +
>>>  +    public void warn( Marker marker, String msg )
>>>  +    {
>>>  +        warn( msg );
>>>  +    }
>>>  +
>>>  +    public void warn( Marker marker, String format, Object arg )
>>>  +    {
>>>  +        warn( format, arg );
>>>  +    }
>>>  +
>>>  +    public void warn( Marker marker, String format, Object arg1, 
> Object arg2 )
>>>  +    {
>>>  +        warn( format, arg1, arg2 );
>>>  +    }
>>>  +
>>>  +    public void warn( Marker marker, String format, Object[] argArray 
> )
>>>  +    {
>>>  +        warn( format, argArray );
>>>  +    }
>>>  +
>>>  +    public void warn( Marker marker, String msg, Throwable t )
>>>  +    {
>>>  +        warn( msg, t );
>>>  +    }
>>>  +
>>>  +    public boolean isErrorEnabled()
>>>  +    {
>>>  +        return logger.isErrorEnabled();
>>>  +    }
>>>  +
>>>  +    public void error( String msg )
>>>  +    {
>>>  +        logger.error( msg );
>>>  +    }
>>>  +
>>>  +    public void error( String format, Object arg )
>>>  +    {
>>>  +        FormattingTuple ft = MessageFormatter.format( format, arg );
>>>  +        logger.error( ft.getMessage(), ft.getThrowable() );
>>>  +    }
>>>  +
>>>  +    public void error( String format, Object arg1, Object arg2 )
>>>  +    {
>>>  +        FormattingTuple ft = MessageFormatter.format( format, arg1, 
> arg2 );
>>>  +        logger.error( ft.getMessage(), ft.getThrowable() );
>>>  +    }
>>>  +
>>>  +    public void error( String format, Object[] argArray )
>>>  +    {
>>>  +        FormattingTuple ft = MessageFormatter.arrayFormat( format, 
> argArray );
>>>  +        logger.error( ft.getMessage(), ft.getThrowable() );
>>>  +    }
>>>  +
>>>  +    public void error( String msg, Throwable t )
>>>  +    {
>>>  +        logger.error( msg, t );
>>>  +    }
>>>  +
>>>  +    public boolean isErrorEnabled( Marker marker )
>>>  +    {
>>>  +        return isErrorEnabled();
>>>  +    }
>>>  +
>>>  +    public void error( Marker marker, String msg )
>>>  +    {
>>>  +        error( msg );
>>>  +    }
>>>  +
>>>  +    public void error( Marker marker, String format, Object arg )
>>>  +    {
>>>  +        error( format, arg );
>>>  +    }
>>>  +
>>>  +    public void error( Marker marker, String format, Object arg1, 
> Object arg2 )
>>>  +    {
>>>  +        error( format, arg1, arg2 );
>>>  +    }
>>>  +
>>>  +    public void error( Marker marker, String format, Object[] argArray 
> )
>>>  +    {
>>>  +        error( format, argArray );
>>>  +    }
>>>  +
>>>  +    public void error( Marker marker, String msg, Throwable t )
>>>  +    {
>>>  +        error( msg, t );
>>>  +    }
>>>  +
>>>  +}
>>> 
>>>  Added:
>>> 
> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLoggerFactory.java
>>>  URL:
>>> 
> http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLoggerFactory.java?rev=1380105&view=auto
>>> 
> ==============================================================================
>>>  ---
>>> 
> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLoggerFactory.java
>>>  (added)
>>>  +++
>>> 
> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLoggerFactory.java
>>>  Mon Sep  3 01:07:31 2012
>>>  @@ -0,0 +1,50 @@
>>>  +package org.apache.maven.cli;
>>>  +
>>>  +/*
>>>  + * Licensed to the Apache Software Foundation (ASF) under one
>>>  + * or more contributor license agreements.  See the NOTICE file
>>>  + * distributed with this work for additional information
>>>  + * regarding copyright ownership.  The ASF licenses this file
>>>  + * to you under the Apache License, Version 2.0 (the
>>>  + * "License"); you may not use this file except in 
> compliance
>>>  + * with the License.  You may obtain a copy of the License at
>>>  + *
>>>  + *  http://www.apache.org/licenses/LICENSE-2.0
>>>  + *
>>>  + * Unless required by applicable law or agreed to in writing,
>>>  + * software distributed under the License is distributed on an
>>>  + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>>>  + * KIND, either express or implied.  See the License for the
>>>  + * specific language governing permissions and limitations
>>>  + * under the License.
>>>  + */
>>>  +
>>>  +import org.codehaus.plexus.logging.LoggerManager;
>>>  +import org.slf4j.ILoggerFactory;
>>>  +import org.slf4j.Logger;
>>>  +
>>>  +/**
>>>  + * A Slf4j logger factory bridged onto a Plexus logger manager.
>>>  + */
>>>  +public class PlexusLoggerFactory
>>>  +    implements ILoggerFactory
>>>  +{
>>>  +
>>>  +    private LoggerManager loggerManager;
>>>  +
>>>  +    public PlexusLoggerFactory( LoggerManager loggerManager )
>>>  +    {
>>>  +        this.loggerManager = loggerManager;
>>>  +    }
>>>  +
>>>  +    public void setLoggerManager( LoggerManager loggerManager )
>>>  +    {
>>>  +        this.loggerManager = loggerManager;
>>>  +    }
>>>  +
>>>  +    public Logger getLogger( String name )
>>>  +    {
>>>  +        return new PlexusLogger( loggerManager.getLoggerForComponent( 
> name,
>>>  null ) );
>>>  +    }
>>>  +
>>>  +}
>>> 
>>>  Modified: maven/maven-3/trunk/pom.xml
>>>  URL:
>>> 
> http://svn.apache.org/viewvc/maven/maven-3/trunk/pom.xml?rev=1380105&r1=1380104&r2=1380105&view=diff
>>> 
> ==============================================================================
>>>  --- maven/maven-3/trunk/pom.xml (original)
>>>  +++ maven/maven-3/trunk/pom.xml Mon Sep  3 01:07:31 2012
>>>  @@ -56,6 +56,7 @@
>>>        <modelloVersion>1.4.1</modelloVersion>
>>>        <jxpathVersion>1.3</jxpathVersion>
>>>        <aetherVersion>1.13.1</aetherVersion>
>>>  +    <slf4jVersion>1.6.1</slf4jVersion>
>>> 
>>> 
> <maven.test.redirectTestOutputToFile>true</maven.test.redirectTestOutputToFile>
>>>        <!-- Control the name of the distribution and information 
> output by mvn
>>>  -->
>>>        <distributionId>apache-maven</distributionId>
>>>  @@ -203,6 +204,17 @@
>>>            <artifactId>plexus-interpolation</artifactId>
>>>            <version>${plexusInterpolationVersion}</version>
>>>          </dependency>
>>>  +      <dependency>
>>>  +        <groupId>org.slf4j</groupId>
>>>  +        <artifactId>slf4j-api</artifactId>
>>>  +        <version>${slf4jVersion}</version>
>>>  +      </dependency>
>>>  +      <dependency>
>>>  +        <groupId>org.slf4j</groupId>
>>>  +        <artifactId>slf4j-nop</artifactId>
>>>  +        <version>${slf4jVersion}</version>
>>>  +        <scope>runtime</scope>
>>>  +      </dependency>
>>>          <!--  Wagon -->
>>>          <dependency>
>>>            <groupId>org.apache.maven.wagon</groupId>
>>> 
>> 
>>  ---------------------------------------------------------------------
>>  To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>>  For additional commands, e-mail: dev-help@maven.apache.org
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: svn commit: r1380105 - in /maven/maven-3/trunk: ./ apache-maven/ maven-core/src/main/java/org/apache/maven/classrealm/ maven-embedder/ maven-embedder/src/main/java/org/apache/maven/cli/

Posted by Igor Fedorenko <ig...@ifedorenko.com>.
FWIW, we are using sfl4j and logback as part of m2e embedded maven
runtime for over a year now without any major issues. There was a
problem with older IBM JVMs [1], but it is fixed now in slf4j (and
in IBM code too, as far as I understand).

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=338252

--
Regards,
Igor


On 12-09-03 3:10 AM, Mark Struberg wrote:
> whats the reason for the slf4j bridge?
>
> This is kown to trash old plugins which use log4j because it clashes
> with it's namespace and only partly implements the log4j classes.
>
> I personally ind slf4j nice, but for older projects which use
> commons-logging or log4j already (and where you cant fiddle around
> with their sources) this broke way too many things for me. Why is
> this needed at all? Has nothing to do with JSR-330.
>
> LieGrue, strub >
>
>
>
> ----- Original Message -----
>> From: "jvanzyl@apache.org" <jv...@apache.org>
>> To: commits@maven.apache.org
>> Cc:
>> Sent: Monday, September 3, 2012 3:07 AM
>> Subject: svn commit: r1380105 - in /maven/maven-3/trunk: ./ apache-maven/ maven-core/src/main/java/org/apache/maven/classrealm/ maven-embedder/ maven-embedder/src/main/java/org/apache/maven/cli/
>>
>> Author: jvanzyl
>> Date: Mon Sep  3 01:07:31 2012
>> New Revision: 1380105
>>
>> URL: http://svn.apache.org/viewvc?rev=1380105&view=rev
>> Log:
>> o Enabled support and discovery of JSR-330 components
>>
>> o Added Slf4j logger factory to support generic JSR-330 logging
>>
>> o Exported Guice package for components that access Guice (or better it's
>> injector) directly
>>
>> Widen export of Guice packages (not ideal, need to look into ways to avoid this)
>>
>> o use specific exports
>>
>> o for now we will attempt to hide all of Guice in plugin realms and we'll do
>> a bit of testing
>>
>> closes #3
>>
>> Added:
>>
>> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLogger.java
>>
>> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLoggerFactory.java
>> Modified:
>>      maven/maven-3/trunk/apache-maven/pom.xml
>>
>> maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java
>>      maven/maven-3/trunk/maven-embedder/pom.xml
>>
>> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
>>      maven/maven-3/trunk/pom.xml
>>
>> Modified: maven/maven-3/trunk/apache-maven/pom.xml
>> URL:
>> http://svn.apache.org/viewvc/maven/maven-3/trunk/apache-maven/pom.xml?rev=1380105&r1=1380104&r2=1380105&view=diff
>> ==============================================================================
>> --- maven/maven-3/trunk/apache-maven/pom.xml (original)
>> +++ maven/maven-3/trunk/apache-maven/pom.xml Mon Sep  3 01:07:31 2012
>> @@ -83,6 +83,10 @@
>>         <groupId>org.sonatype.aether</groupId>
>>         <artifactId>aether-connector-wagon</artifactId>
>>       </dependency>
>> +    <dependency>
>> +      <groupId>org.slf4j</groupId>
>> +      <artifactId>slf4j-nop</artifactId>
>> +    </dependency>
>>     </dependencies>
>>
>>     <build>
>>
>> Modified:
>> maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java
>> URL:
>> http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java?rev=1380105&r1=1380104&r2=1380105&view=diff
>> ==============================================================================
>> ---
>> maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java
>> (original)
>> +++
>> maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java
>> Mon Sep  3 01:07:31 2012
>> @@ -198,6 +198,26 @@ public class DefaultClassRealmManager
>>           imports.put(
>> "org.codehaus.plexus.util.xml.pull.XmlPullParser", coreRealm );
>>           imports.put(
>> "org.codehaus.plexus.util.xml.pull.XmlPullParserException", coreRealm
>> );
>>           imports.put(
>> "org.codehaus.plexus.util.xml.pull.XmlSerializer", coreRealm );
>> +
>> +        // javax.inject, sisu-inject (JSR-330)
>> +        imports.put( "javax.inject.*", coreRealm );
>> +        imports.put( "javax.enterprise.inject.*", coreRealm );
>> +        imports.put( "org.sonatype.inject.*", coreRealm );
>> +        imports.put( "org.slf4j.*", coreRealm );
>> +
>> +        // com.google
>> +        //
>> +        // We may potentially want to export these, but right now I'm not
>> sure that anything Guice specific needs
>> +        // to be made available to plugin authors. If we find people are
>> getting fancy and want to take advantage
>> +        // of Guice specifics we can expose that later. Really some testing
>> needs to be done to see full hiding
>> +        // of Guice has any impact on what we may categorize as a standard
>> JSR-330 based Tesla/Maven plugin.
>> +        //
>> +        // imports.put( "com.google.inject.*", coreRealm );
>> +        // imports.put( "com.google.inject.binder.*", coreRealm );
>> +        // imports.put( "com.google.inject.matcher.*", coreRealm );
>> +        // imports.put( "com.google.inject.name.*", coreRealm );
>> +        // imports.put( "com.google.inject.spi.*", coreRealm );
>> +        // imports.put( "com.google.inject.util.*", coreRealm );
>>       }
>>
>>       /**
>>
>> Modified: maven/maven-3/trunk/maven-embedder/pom.xml
>> URL:
>> http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-embedder/pom.xml?rev=1380105&r1=1380104&r2=1380105&view=diff
>> ==============================================================================
>> --- maven/maven-3/trunk/maven-embedder/pom.xml (original)
>> +++ maven/maven-3/trunk/maven-embedder/pom.xml Mon Sep  3 01:07:31 2012
>> @@ -70,6 +70,10 @@
>>         <groupId>org.sonatype.plexus</groupId>
>>         <artifactId>plexus-cipher</artifactId>
>>       </dependency>
>> +    <dependency>
>> +      <groupId>org.slf4j</groupId>
>> +      <artifactId>slf4j-api</artifactId>
>> +    </dependency>
>>       <!-- CLI -->
>>       <dependency>
>>         <groupId>commons-cli</groupId>
>>
>> Modified:
>> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
>> URL:
>> http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java?rev=1380105&r1=1380104&r2=1380105&view=diff
>> ==============================================================================
>> ---
>> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
>> (original)
>> +++
>> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
>> Mon Sep  3 01:07:31 2012
>> @@ -59,12 +59,14 @@ import org.apache.maven.settings.buildin
>> import org.codehaus.plexus.ContainerConfiguration;
>> import org.codehaus.plexus.DefaultContainerConfiguration;
>> import org.codehaus.plexus.DefaultPlexusContainer;
>> +import org.codehaus.plexus.PlexusConstants;
>> import org.codehaus.plexus.PlexusContainer;
>> import org.codehaus.plexus.classworlds.ClassWorld;
>> import org.codehaus.plexus.classworlds.realm.ClassRealm;
>> import
>> org.codehaus.plexus.component.repository.exception.ComponentLookupException;
>> import org.codehaus.plexus.logging.Logger;
>> import org.codehaus.plexus.util.StringUtils;
>> +import org.slf4j.ILoggerFactory;
>> import org.sonatype.aether.transfer.TransferListener;
>> import org.sonatype.plexus.components.cipher.DefaultPlexusCipher;
>> import org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher;
>> @@ -72,6 +74,8 @@ import org.sonatype.plexus.components.se
>> import org.sonatype.plexus.components.sec.dispatcher.SecUtil;
>> import org.sonatype.plexus.components.sec.dispatcher.model.SettingsSecurity;
>>
>> +import com.google.inject.AbstractModule;
>> +
>> // TODO: push all common bits back to plexus cli and prepare for transition to
>> Guice. We don't need 50 ways to make CLIs
>>
>> /**
>> @@ -372,17 +376,29 @@ public class MavenCli
>>           {
>>               logger = setupLogger( cliRequest );
>>
>> +            final MavenLoggerManager loggerManager = new MavenLoggerManager(
>> logger ) ;
>> +
>>               ContainerConfiguration cc = new DefaultContainerConfiguration()
>>                   .setClassWorld( cliRequest.classWorld )
>>                   .setRealm( setupContainerRealm( cliRequest ) )
>> +                .setClassPathScanning( PlexusConstants.SCANNING_INDEX )
>> +                .setAutoWiring( true )
>>                   .setName( "maven" );
>>
>> -            container = new DefaultPlexusContainer( cc );
>> +            container = new DefaultPlexusContainer( cc, new AbstractModule()
>> +            {
>> +
>> +                protected void configure()
>> +                {
>> +                    bind( ILoggerFactory.class ).toInstance( new
>> PlexusLoggerFactory( loggerManager ) );
>> +                }
>> +
>> +            } );
>>
>>               // NOTE: To avoid inconsistencies, we'll use the TCCL
>> exclusively for lookups
>>               container.setLookupRealm( null );
>>
>> -            container.setLoggerManager( new MavenLoggerManager( logger ) );
>> +            container.setLoggerManager( loggerManager );
>>
>>               customizeContainer( container );
>>
>>
>> Added:
>> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLogger.java
>> URL:
>> http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLogger.java?rev=1380105&view=auto
>> ==============================================================================
>> ---
>> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLogger.java
>> (added)
>> +++
>> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLogger.java
>> Mon Sep  3 01:07:31 2012
>> @@ -0,0 +1,358 @@
>> +package org.apache.maven.cli;
>> +
>> +/*
>> + * Licensed to the Apache Software Foundation (ASF) under one
>> + * or more contributor license agreements.  See the NOTICE file
>> + * distributed with this work for additional information
>> + * regarding copyright ownership.  The ASF licenses this file
>> + * to you under the Apache License, Version 2.0 (the
>> + * "License"); you may not use this file except in compliance
>> + * with the License.  You may obtain a copy of the License at
>> + *
>> + *  http://www.apache.org/licenses/LICENSE-2.0
>> + *
>> + * Unless required by applicable law or agreed to in writing,
>> + * software distributed under the License is distributed on an
>> + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>> + * KIND, either express or implied.  See the License for the
>> + * specific language governing permissions and limitations
>> + * under the License.
>> + */
>> +
>> +import org.slf4j.Logger;
>> +import org.slf4j.Marker;
>> +import org.slf4j.helpers.FormattingTuple;
>> +import org.slf4j.helpers.MessageFormatter;
>> +
>> +/**
>> + * A Slf4j logger bridged onto a Plexus logger.
>> + */
>> +class PlexusLogger
>> +    implements Logger
>> +{
>> +
>> +    private final org.codehaus.plexus.logging.Logger logger;
>> +
>> +    public PlexusLogger( org.codehaus.plexus.logging.Logger logger )
>> +    {
>> +        this.logger = logger;
>> +    }
>> +
>> +    public String getName()
>> +    {
>> +        return logger.getName();
>> +    }
>> +
>> +    public boolean isTraceEnabled()
>> +    {
>> +        return isDebugEnabled();
>> +    }
>> +
>> +    public void trace( String msg )
>> +    {
>> +        debug( msg );
>> +    }
>> +
>> +    public void trace( String format, Object arg )
>> +    {
>> +        debug( format, arg );
>> +    }
>> +
>> +    public void trace( String format, Object arg1, Object arg2 )
>> +    {
>> +        debug( format, arg1, arg2 );
>> +    }
>> +
>> +    public void trace( String format, Object[] argArray )
>> +    {
>> +        debug( format, argArray );
>> +    }
>> +
>> +    public void trace( String msg, Throwable t )
>> +    {
>> +        debug( msg, t );
>> +    }
>> +
>> +    public boolean isTraceEnabled( Marker marker )
>> +    {
>> +        return isTraceEnabled();
>> +    }
>> +
>> +    public void trace( Marker marker, String msg )
>> +    {
>> +        trace( msg );
>> +    }
>> +
>> +    public void trace( Marker marker, String format, Object arg )
>> +    {
>> +        trace( format, arg );
>> +    }
>> +
>> +    public void trace( Marker marker, String format, Object arg1, Object arg2 )
>> +    {
>> +        trace( format, arg1, arg2 );
>> +    }
>> +
>> +    public void trace( Marker marker, String format, Object[] argArray )
>> +    {
>> +        trace( format, argArray );
>> +    }
>> +
>> +    public void trace( Marker marker, String msg, Throwable t )
>> +    {
>> +        trace( msg, t );
>> +    }
>> +
>> +    public boolean isDebugEnabled()
>> +    {
>> +        return logger.isDebugEnabled();
>> +    }
>> +
>> +    public void debug( String msg )
>> +    {
>> +        logger.debug( msg );
>> +    }
>> +
>> +    public void debug( String format, Object arg )
>> +    {
>> +        FormattingTuple ft = MessageFormatter.format( format, arg );
>> +        logger.debug( ft.getMessage(), ft.getThrowable() );
>> +    }
>> +
>> +    public void debug( String format, Object arg1, Object arg2 )
>> +    {
>> +        FormattingTuple ft = MessageFormatter.format( format, arg1, arg2 );
>> +        logger.debug( ft.getMessage(), ft.getThrowable() );
>> +    }
>> +
>> +    public void debug( String format, Object[] argArray )
>> +    {
>> +        FormattingTuple ft = MessageFormatter.arrayFormat( format, argArray );
>> +        logger.debug( ft.getMessage(), ft.getThrowable() );
>> +    }
>> +
>> +    public void debug( String msg, Throwable t )
>> +    {
>> +        logger.debug( msg, t );
>> +    }
>> +
>> +    public boolean isDebugEnabled( Marker marker )
>> +    {
>> +        return isDebugEnabled();
>> +    }
>> +
>> +    public void debug( Marker marker, String msg )
>> +    {
>> +        debug( msg );
>> +    }
>> +
>> +    public void debug( Marker marker, String format, Object arg )
>> +    {
>> +        debug( format, arg );
>> +    }
>> +
>> +    public void debug( Marker marker, String format, Object arg1, Object arg2 )
>> +    {
>> +        debug( format, arg1, arg2 );
>> +    }
>> +
>> +    public void debug( Marker marker, String format, Object[] argArray )
>> +    {
>> +        debug( format, argArray );
>> +    }
>> +
>> +    public void debug( Marker marker, String msg, Throwable t )
>> +    {
>> +        debug( msg, t );
>> +    }
>> +
>> +    public boolean isInfoEnabled()
>> +    {
>> +        return logger.isInfoEnabled();
>> +    }
>> +
>> +    public void info( String msg )
>> +    {
>> +        logger.info( msg );
>> +    }
>> +
>> +    public void info( String format, Object arg )
>> +    {
>> +        FormattingTuple ft = MessageFormatter.format( format, arg );
>> +        logger.info( ft.getMessage(), ft.getThrowable() );
>> +    }
>> +
>> +    public void info( String format, Object arg1, Object arg2 )
>> +    {
>> +        FormattingTuple ft = MessageFormatter.format( format, arg1, arg2 );
>> +        logger.info( ft.getMessage(), ft.getThrowable() );
>> +    }
>> +
>> +    public void info( String format, Object[] argArray )
>> +    {
>> +        FormattingTuple ft = MessageFormatter.arrayFormat( format, argArray );
>> +        logger.info( ft.getMessage(), ft.getThrowable() );
>> +    }
>> +
>> +    public void info( String msg, Throwable t )
>> +    {
>> +        logger.info( msg, t );
>> +    }
>> +
>> +    public boolean isInfoEnabled( Marker marker )
>> +    {
>> +        return isInfoEnabled();
>> +    }
>> +
>> +    public void info( Marker marker, String msg )
>> +    {
>> +        info( msg );
>> +    }
>> +
>> +    public void info( Marker marker, String format, Object arg )
>> +    {
>> +        info( format, arg );
>> +    }
>> +
>> +    public void info( Marker marker, String format, Object arg1, Object arg2 )
>> +    {
>> +        info( format, arg1, arg2 );
>> +    }
>> +
>> +    public void info( Marker marker, String format, Object[] argArray )
>> +    {
>> +        info( format, argArray );
>> +    }
>> +
>> +    public void info( Marker marker, String msg, Throwable t )
>> +    {
>> +        info( msg, t );
>> +    }
>> +
>> +    public boolean isWarnEnabled()
>> +    {
>> +        return logger.isWarnEnabled();
>> +    }
>> +
>> +    public void warn( String msg )
>> +    {
>> +        logger.warn( msg );
>> +    }
>> +
>> +    public void warn( String format, Object arg )
>> +    {
>> +        FormattingTuple ft = MessageFormatter.format( format, arg );
>> +        logger.warn( ft.getMessage(), ft.getThrowable() );
>> +    }
>> +
>> +    public void warn( String format, Object arg1, Object arg2 )
>> +    {
>> +        FormattingTuple ft = MessageFormatter.format( format, arg1, arg2 );
>> +        logger.warn( ft.getMessage(), ft.getThrowable() );
>> +    }
>> +
>> +    public void warn( String format, Object[] argArray )
>> +    {
>> +        FormattingTuple ft = MessageFormatter.arrayFormat( format, argArray );
>> +        logger.warn( ft.getMessage(), ft.getThrowable() );
>> +    }
>> +
>> +    public void warn( String msg, Throwable t )
>> +    {
>> +        logger.warn( msg, t );
>> +    }
>> +
>> +    public boolean isWarnEnabled( Marker marker )
>> +    {
>> +        return isWarnEnabled();
>> +    }
>> +
>> +    public void warn( Marker marker, String msg )
>> +    {
>> +        warn( msg );
>> +    }
>> +
>> +    public void warn( Marker marker, String format, Object arg )
>> +    {
>> +        warn( format, arg );
>> +    }
>> +
>> +    public void warn( Marker marker, String format, Object arg1, Object arg2 )
>> +    {
>> +        warn( format, arg1, arg2 );
>> +    }
>> +
>> +    public void warn( Marker marker, String format, Object[] argArray )
>> +    {
>> +        warn( format, argArray );
>> +    }
>> +
>> +    public void warn( Marker marker, String msg, Throwable t )
>> +    {
>> +        warn( msg, t );
>> +    }
>> +
>> +    public boolean isErrorEnabled()
>> +    {
>> +        return logger.isErrorEnabled();
>> +    }
>> +
>> +    public void error( String msg )
>> +    {
>> +        logger.error( msg );
>> +    }
>> +
>> +    public void error( String format, Object arg )
>> +    {
>> +        FormattingTuple ft = MessageFormatter.format( format, arg );
>> +        logger.error( ft.getMessage(), ft.getThrowable() );
>> +    }
>> +
>> +    public void error( String format, Object arg1, Object arg2 )
>> +    {
>> +        FormattingTuple ft = MessageFormatter.format( format, arg1, arg2 );
>> +        logger.error( ft.getMessage(), ft.getThrowable() );
>> +    }
>> +
>> +    public void error( String format, Object[] argArray )
>> +    {
>> +        FormattingTuple ft = MessageFormatter.arrayFormat( format, argArray );
>> +        logger.error( ft.getMessage(), ft.getThrowable() );
>> +    }
>> +
>> +    public void error( String msg, Throwable t )
>> +    {
>> +        logger.error( msg, t );
>> +    }
>> +
>> +    public boolean isErrorEnabled( Marker marker )
>> +    {
>> +        return isErrorEnabled();
>> +    }
>> +
>> +    public void error( Marker marker, String msg )
>> +    {
>> +        error( msg );
>> +    }
>> +
>> +    public void error( Marker marker, String format, Object arg )
>> +    {
>> +        error( format, arg );
>> +    }
>> +
>> +    public void error( Marker marker, String format, Object arg1, Object arg2 )
>> +    {
>> +        error( format, arg1, arg2 );
>> +    }
>> +
>> +    public void error( Marker marker, String format, Object[] argArray )
>> +    {
>> +        error( format, argArray );
>> +    }
>> +
>> +    public void error( Marker marker, String msg, Throwable t )
>> +    {
>> +        error( msg, t );
>> +    }
>> +
>> +}
>>
>> Added:
>> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLoggerFactory.java
>> URL:
>> http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLoggerFactory.java?rev=1380105&view=auto
>> ==============================================================================
>> ---
>> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLoggerFactory.java
>> (added)
>> +++
>> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLoggerFactory.java
>> Mon Sep  3 01:07:31 2012
>> @@ -0,0 +1,50 @@
>> +package org.apache.maven.cli;
>> +
>> +/*
>> + * Licensed to the Apache Software Foundation (ASF) under one
>> + * or more contributor license agreements.  See the NOTICE file
>> + * distributed with this work for additional information
>> + * regarding copyright ownership.  The ASF licenses this file
>> + * to you under the Apache License, Version 2.0 (the
>> + * "License"); you may not use this file except in compliance
>> + * with the License.  You may obtain a copy of the License at
>> + *
>> + *  http://www.apache.org/licenses/LICENSE-2.0
>> + *
>> + * Unless required by applicable law or agreed to in writing,
>> + * software distributed under the License is distributed on an
>> + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>> + * KIND, either express or implied.  See the License for the
>> + * specific language governing permissions and limitations
>> + * under the License.
>> + */
>> +
>> +import org.codehaus.plexus.logging.LoggerManager;
>> +import org.slf4j.ILoggerFactory;
>> +import org.slf4j.Logger;
>> +
>> +/**
>> + * A Slf4j logger factory bridged onto a Plexus logger manager.
>> + */
>> +public class PlexusLoggerFactory
>> +    implements ILoggerFactory
>> +{
>> +
>> +    private LoggerManager loggerManager;
>> +
>> +    public PlexusLoggerFactory( LoggerManager loggerManager )
>> +    {
>> +        this.loggerManager = loggerManager;
>> +    }
>> +
>> +    public void setLoggerManager( LoggerManager loggerManager )
>> +    {
>> +        this.loggerManager = loggerManager;
>> +    }
>> +
>> +    public Logger getLogger( String name )
>> +    {
>> +        return new PlexusLogger( loggerManager.getLoggerForComponent( name,
>> null ) );
>> +    }
>> +
>> +}
>>
>> Modified: maven/maven-3/trunk/pom.xml
>> URL:
>> http://svn.apache.org/viewvc/maven/maven-3/trunk/pom.xml?rev=1380105&r1=1380104&r2=1380105&view=diff
>> ==============================================================================
>> --- maven/maven-3/trunk/pom.xml (original)
>> +++ maven/maven-3/trunk/pom.xml Mon Sep  3 01:07:31 2012
>> @@ -56,6 +56,7 @@
>>       <modelloVersion>1.4.1</modelloVersion>
>>       <jxpathVersion>1.3</jxpathVersion>
>>       <aetherVersion>1.13.1</aetherVersion>
>> +    <slf4jVersion>1.6.1</slf4jVersion>
>>
>> <maven.test.redirectTestOutputToFile>true</maven.test.redirectTestOutputToFile>
>>       <!-- Control the name of the distribution and information output by mvn
>> -->
>>       <distributionId>apache-maven</distributionId>
>> @@ -203,6 +204,17 @@
>>           <artifactId>plexus-interpolation</artifactId>
>>           <version>${plexusInterpolationVersion}</version>
>>         </dependency>
>> +      <dependency>
>> +        <groupId>org.slf4j</groupId>
>> +        <artifactId>slf4j-api</artifactId>
>> +        <version>${slf4jVersion}</version>
>> +      </dependency>
>> +      <dependency>
>> +        <groupId>org.slf4j</groupId>
>> +        <artifactId>slf4j-nop</artifactId>
>> +        <version>${slf4jVersion}</version>
>> +        <scope>runtime</scope>
>> +      </dependency>
>>         <!--  Wagon -->
>>         <dependency>
>>           <groupId>org.apache.maven.wagon</groupId>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: svn commit: r1380105 - in /maven/maven-3/trunk: ./ apache-maven/ maven-core/src/main/java/org/apache/maven/classrealm/ maven-embedder/ maven-embedder/src/main/java/org/apache/maven/cli/

Posted by Jason van Zyl <ja...@tesla.io>.
I disagree and believe making another API is of little value, especially given the ubiquity of SLF4J.

Benefits:
- Ubiquity. SLF4J may not be perfect, but I doubt we'll make anything better
- Changes have been made in Sisu that allow SLF4J logger to be injectable (we would have to redo this work)
- M2E uses SLF4J successfully and we never had any problems. We also now get consistency through the most widely used Maven toolchain.
- There are many default implementations to choose from, including log4j
- All the bridges function which pretty much allows all the common frameworks to be utilized with no work on our side. This allows others to use whatever they like in their components, and we can absorb almost any component that exists using its
- If there are integration issues I'm sure Ceki will fix them. If there are examples of integrations I'd like to see the examples because I've never seen them personally.

Downsides:
- I'm sure users and integrators do not want to see another logging API
- No injectable loggers
- We would have to write all the bridges again to integrate all the other frameworks and I really don't see this as a valuable exercise. I have never seen integration issues with SLF4J in m2e or Nexus and they are fairly extensive programs.

In summary I see this as low value work with no real benefit to anyone.

At any rate I don't want to get in a religious debate about logging frameworks, i just want to most reasonable solution that exists without doing any work.

If we all agree SLF4J is not appropriate, let me know and I'll rollback my commit and change it.

On Sep 3, 2012, at 6:01 AM, Mark Struberg wrote:

> 
> 
>> A simpler approach
>> would be to produce a bridge dependency: slf4j-maven so that everyone that
>> has dependencies that use slf4j can trivially route their dependency
>> logging through to maven
> 
> 
> +1 for taking this route. That would also allow us to adopt easily for future API changes. Been there, done that ...
> 
> LieGrue,
> strub
> 
>> ________________________________
>> From: Stephen Connolly <st...@gmail.com>
>> To: Maven Developers List <de...@maven.apache.org>; Mark Struberg <st...@yahoo.de> 
>> Sent: Monday, September 3, 2012 11:55 AM
>> Subject: Re: svn commit: r1380105 - in /maven/maven-3/trunk: ./ apache-maven/ maven-core/src/main/java/org/apache/maven/classrealm/ maven-embedder/ maven-embedder/src/main/java/org/apache/maven/cli/
>> 
>> On 3 September 2012 09:59, Mark Struberg <st...@yahoo.de> wrote:
>> 
>>> 
>>>> imports.put( "org.slf4j.*", coreRealm );
>>> 
>>> To me this looks like any org.slf4j sub package would be exported.
>>> 
>> 
>> slf4j is such a ubiquitous logging framework that it seems to me that it
>> would make sense to allow any plugins that have dependencies that use slf4j
>> to log through to maven.
>> 
>> 
>>> 
>>> The whole goal of org.codehaus.plexus.logging.Logger was to shield the
>>> user from ANY specific logging framework. That way we could back the plexus
>>> Logger with any implementation the user wants.
>>> 
>>> 
>>> We already HAVE a logging bridge. Imo there is just no need to introduce
>>> another one!
>>> 
>> 
>> That is fine for plugin code, but why should *everyone* else have to
>> rewrite the same bridge from slf4j to our logging bridge?
>> 
>> And then that bridge routes back to slf4j?
>> 
>> 
>>> To kind of hardcode this now to slf4j is frankly speaking nonsense imo.
>>> 
>>> 
>> Perhaps. I have concerns about slf4j API stability having seen some issues
>> with slf4j 1.5 vs 1.6 which I resolved and forgot about. A simpler approach
>> would be to produce a bridge dependency: slf4j-maven so that everyone that
>> has dependencies that use slf4j can trivially route their dependency
>> logging through to maven
>> 
>> 
>>> But maybe I just missed the point? What is the reason for it?
>>> 
>>> 
>> Consider jetty:run... jetty sends its logging to slf4j... so to play
>> properly the plugin *should* be picking up those logs and routing them
>> through to Maven so that Maven's logging controls can correctly filter the
>> logs... now tomcat:run needs to do the same, etc....
>> 
>> There is logging bridge madness all over the shop.
>> 
>> Logging bridges should be as close to the logger as possible, especially in
>> a short lived tool such as Maven, where the JVM may not have had a chance
>> to optimize out the bridge.
>> 
>> For server classes such as, e.g. MyFaces, the use of a bridge is less of an
>> issue as the JVM will optimize it out of the code since there is only one
>> trivial implementation and that can be in-lined and reduced away to a
>> direct call.
>> 
>> But a build tool that is invoking other 3rd party libs on a short lived
>> lifecycle will have a performance hit for the logging calls.
>> 
>> That is the argument for exposing directly.
>> 
>> The argument against is that slf4j's API sucks... though it sucks less than
>> any other logging api out there at the moment... there are still issues
>> with it ;-)
>> 
>> 
>>> 
>>> LieGrue,
>>> strub
>>> 
>>> 
>>>> ________________________________
>>>> From: Stephen Connolly <st...@gmail.com>
>>>> To: Maven Developers List <de...@maven.apache.org>; Mark Struberg <
>>> struberg@yahoo.de>
>>>> Sent: Monday, September 3, 2012 10:42 AM
>>>> Subject: Re: svn commit: r1380105 - in /maven/maven-3/trunk: ./
>>> apache-maven/ maven-core/src/main/java/org/apache/maven/classrealm/
>>> maven-embedder/ maven-embedder/src/main/java/org/apache/maven/cli/
>>>> 
>>>> 
>>>> I'm not seeing log4j-over-slf4j in the dependency tree there at all... so
>>> where is the bridge?
>>>> 
>>>> 
>>>> On 3 September 2012 08:10, Mark Struberg <st...@yahoo.de> wrote:
>>>> 
>>>> whats the reason for the slf4j bridge?
>>>>> 
>>>>> This is kown to trash old plugins which use log4j because it clashes
>>> with it's namespace and only partly implements the log4j classes.
>>>>> 
>>>>> I personally ind slf4j nice, but for older projects which use
>>> commons-logging or log4j already (and where you cant fiddle around with
>>> their sources) this broke way too many things for me.
>>>>> Why is this needed at all? Has nothing to do with JSR-330.
>>>>> 
>>>>> LieGrue,
>>>>> strub
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> ----- Original Message -----
>>>>>> From: "jvanzyl@apache.org" <jv...@apache.org>
>>>>>> To: commits@maven.apache.org
>>>>>> Cc:
>>>>>> Sent: Monday, September 3, 2012 3:07 AM
>>>>>> Subject: svn commit: r1380105 - in /maven/maven-3/trunk: ./
>>> apache-maven/ maven-core/src/main/java/org/apache/maven/classrealm/
>>> maven-embedder/ maven-embedder/src/main/java/org/apache/maven/cli/
>>>>>> 
>>>>>> Author: jvanzyl
>>>>>> Date: Mon Sep  3 01:07:31 2012
>>>>>> New Revision: 1380105
>>>>>> 
>>>>>> URL: http://svn.apache.org/viewvc?rev=1380105&view=rev
>>>>>> Log:
>>>>>> o Enabled support and discovery of JSR-330 components
>>>>>> 
>>>>>> o Added Slf4j logger factory to support generic JSR-330 logging
>>>>>> 
>>>>>> o Exported Guice package for components that access Guice (or better
>>> it's
>>>>>> injector) directly
>>>>>> 
>>>>>> Widen export of Guice packages (not ideal, need to look into ways to
>>> avoid this)
>>>>>> 
>>>>>> o use specific exports
>>>>>> 
>>>>>> o for now we will attempt to hide all of Guice in plugin realms and
>>> we'll do
>>>>>> a bit of testing
>>>>>> 
>>>>>> closes #3
>>>>>> 
>>>>>> Added:
>>>>>> 
>>>>>> 
>>> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLogger.java
>>>>>> 
>>>>>> 
>>> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLoggerFactory.java
>>>>>> Modified:
>>>>>>      maven/maven-3/trunk/apache-maven/pom.xml
>>>>>> 
>>>>>> 
>>> maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java
>>>>>>      maven/maven-3/trunk/maven-embedder/pom.xml
>>>>>> 
>>>>>> 
>>> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
>>>>>>      maven/maven-3/trunk/pom.xml
>>>>>> 
>>>>>> Modified: maven/maven-3/trunk/apache-maven/pom.xml
>>>>>> URL:
>>>>>> 
>>> http://svn.apache.org/viewvc/maven/maven-3/trunk/apache-maven/pom.xml?rev=1380105&r1=1380104&r2=1380105&view=diff
>>>>>> 
>>> ==============================================================================
>>>>>> --- maven/maven-3/trunk/apache-maven/pom.xml (original)
>>>>>> +++ maven/maven-3/trunk/apache-maven/pom.xml Mon Sep  3 01:07:31 2012
>>>>>> @@ -83,6 +83,10 @@
>>>>>>         <groupId>org.sonatype.aether</groupId>
>>>>>>         <artifactId>aether-connector-wagon</artifactId>
>>>>>>       </dependency>
>>>>>> +    <dependency>
>>>>>> +      <groupId>org.slf4j</groupId>
>>>>>> +      <artifactId>slf4j-nop</artifactId>
>>>>>> +    </dependency>
>>>>>>     </dependencies>
>>>>>> 
>>>>>>     <build>
>>>>>> 
>>>>>> Modified:
>>>>>> 
>>> maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java
>>>>>> URL:
>>>>>> 
>>> http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java?rev=1380105&r1=1380104&r2=1380105&view=diff
>>>>>> 
>>> ==============================================================================
>>>>>> ---
>>>>>> 
>>> maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java
>>>>>> (original)
>>>>>> +++
>>>>>> 
>>> maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java
>>>>>> Mon Sep  3 01:07:31 2012
>>>>>> @@ -198,6 +198,26 @@ public class DefaultClassRealmManager
>>>>>>           imports.put(
>>>>>> "org.codehaus.plexus.util.xml.pull.XmlPullParser", coreRealm );
>>>>>>           imports.put(
>>>>>> "org.codehaus.plexus.util.xml.pull.XmlPullParserException", coreRealm
>>>>>> );
>>>>>>           imports.put(
>>>>>> "org.codehaus.plexus.util.xml.pull.XmlSerializer", coreRealm );
>>>>>> +
>>>>>> +        // javax.inject, sisu-inject (JSR-330)
>>>>>> +        imports.put( "javax.inject.*", coreRealm );
>>>>>> +        imports.put( "javax.enterprise.inject.*", coreRealm );
>>>>>> +        imports.put( "org.sonatype.inject.*", coreRealm );
>>>>>> +        imports.put( "org.slf4j.*", coreRealm );
>>>>>> +
>>>>>> +        // com.google
>>>>>> +        //
>>>>>> +        // We may potentially want to export these, but right now I'm
>>> not
>>>>>> sure that anything Guice specific needs
>>>>>> +        // to be made available to plugin authors. If we find people
>>> are
>>>>>> getting fancy and want to take advantage
>>>>>> +        // of Guice specifics we can expose that later. Really some
>>> testing
>>>>>> needs to be done to see full hiding
>>>>>> +        // of Guice has any impact on what we may categorize as a
>>> standard
>>>>>> JSR-330 based Tesla/Maven plugin.
>>>>>> +        //
>>>>>> +        // imports.put( "com.google.inject.*", coreRealm );
>>>>>> +        // imports.put( "com.google.inject.binder.*", coreRealm );
>>>>>> +        // imports.put( "com.google.inject.matcher.*", coreRealm );
>>>>>> +        // imports.put( "com.google.inject.name.*", coreRealm );
>>>>>> +        // imports.put( "com.google.inject.spi.*", coreRealm );
>>>>>> +        // imports.put( "com.google.inject.util.*", coreRealm );
>>>>>>       }
>>>>>> 
>>>>>>       /**
>>>>>> 
>>>>>> Modified: maven/maven-3/trunk/maven-embedder/pom.xml
>>>>>> URL:
>>>>>> 
>>> http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-embedder/pom.xml?rev=1380105&r1=1380104&r2=1380105&view=diff
>>>>>> 
>>> ==============================================================================
>>>>>> --- maven/maven-3/trunk/maven-embedder/pom.xml (original)
>>>>>> +++ maven/maven-3/trunk/maven-embedder/pom.xml Mon Sep  3 01:07:31 2012
>>>>>> @@ -70,6 +70,10 @@
>>>>>>         <groupId>org.sonatype.plexus</groupId>
>>>>>>         <artifactId>plexus-cipher</artifactId>
>>>>>>       </dependency>
>>>>>> +    <dependency>
>>>>>> +      <groupId>org.slf4j</groupId>
>>>>>> +      <artifactId>slf4j-api</artifactId>
>>>>>> +    </dependency>
>>>>>>       <!-- CLI -->
>>>>>>       <dependency>
>>>>>>         <groupId>commons-cli</groupId>
>>>>>> 
>>>>>> Modified:
>>>>>> 
>>> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
>>>>>> URL:
>>>>>> 
>>> http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java?rev=1380105&r1=1380104&r2=1380105&view=diff
>>>>>> 
>>> ==============================================================================
>>>>>> ---
>>>>>> 
>>> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
>>>>>> (original)
>>>>>> +++
>>>>>> 
>>> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
>>>>>> Mon Sep  3 01:07:31 2012
>>>>>> @@ -59,12 +59,14 @@ import org.apache.maven.settings.buildin
>>>>>> import org.codehaus.plexus.ContainerConfiguration;
>>>>>> import org.codehaus.plexus.DefaultContainerConfiguration;
>>>>>> import org.codehaus.plexus.DefaultPlexusContainer;
>>>>>> +import org.codehaus.plexus.PlexusConstants;
>>>>>> import org.codehaus.plexus.PlexusContainer;
>>>>>> import org.codehaus.plexus.classworlds.ClassWorld;
>>>>>> import org.codehaus.plexus.classworlds.realm.ClassRealm;
>>>>>> import
>>>>>> 
>>> org.codehaus.plexus.component.repository.exception.ComponentLookupException;
>>>>>> import org.codehaus.plexus.logging.Logger;
>>>>>> import org.codehaus.plexus.util.StringUtils;
>>>>>> +import org.slf4j.ILoggerFactory;
>>>>>> import org.sonatype.aether.transfer.TransferListener;
>>>>>> import org.sonatype.plexus.components.cipher.DefaultPlexusCipher;
>>>>>> import
>>> org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher;
>>>>>> @@ -72,6 +74,8 @@ import org.sonatype.plexus.components.se
>>>>>> import org.sonatype.plexus.components.sec.dispatcher.SecUtil;
>>>>>> import
>>> org.sonatype.plexus.components.sec.dispatcher.model.SettingsSecurity;
>>>>>> 
>>>>>> +import com.google.inject.AbstractModule;
>>>>>> +
>>>>>> // TODO: push all common bits back to plexus cli and prepare for
>>> transition to
>>>>>> Guice. We don't need 50 ways to make CLIs
>>>>>> 
>>>>>> /**
>>>>>> @@ -372,17 +376,29 @@ public class MavenCli
>>>>>>           {
>>>>>>               logger = setupLogger( cliRequest );
>>>>>> 
>>>>>> +            final MavenLoggerManager loggerManager = new
>>> MavenLoggerManager(
>>>>>> logger ) ;
>>>>>> +
>>>>>>               ContainerConfiguration cc = new
>>> DefaultContainerConfiguration()
>>>>>>                   .setClassWorld( cliRequest.classWorld )
>>>>>>                   .setRealm( setupContainerRealm( cliRequest ) )
>>>>>> +                .setClassPathScanning( PlexusConstants.SCANNING_INDEX
>>> )
>>>>>> +                .setAutoWiring( true )
>>>>>>                   .setName( "maven" );
>>>>>> 
>>>>>> -            container = new DefaultPlexusContainer( cc );
>>>>>> +            container = new DefaultPlexusContainer( cc, new
>>> AbstractModule()
>>>>>> +            {
>>>>>> +
>>>>>> +                protected void configure()
>>>>>> +                {
>>>>>> +                    bind( ILoggerFactory.class ).toInstance( new
>>>>>> PlexusLoggerFactory( loggerManager ) );
>>>>>> +                }
>>>>>> +
>>>>>> +            } );
>>>>>> 
>>>>>>               // NOTE: To avoid inconsistencies, we'll use the TCCL
>>>>>> exclusively for lookups
>>>>>>               container.setLookupRealm( null );
>>>>>> 
>>>>>> -            container.setLoggerManager( new MavenLoggerManager(
>>> logger ) );
>>>>>> +            container.setLoggerManager( loggerManager );
>>>>>> 
>>>>>>               customizeContainer( container );
>>>>>> 
>>>>>> 
>>>>>> Added:
>>>>>> 
>>> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLogger.java
>>>>>> URL:
>>>>>> 
>>> http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLogger.java?rev=1380105&view=auto
>>>>>> 
>>> ==============================================================================
>>>>>> ---
>>>>>> 
>>> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLogger.java
>>>>>> (added)
>>>>>> +++
>>>>>> 
>>> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLogger.java
>>>>>> Mon Sep  3 01:07:31 2012
>>>>>> @@ -0,0 +1,358 @@
>>>>>> +package org.apache.maven.cli;
>>>>>> +
>>>>>> +/*
>>>>>> + * Licensed to the Apache Software Foundation (ASF) under one
>>>>>> + * or more contributor license agreements.  See the NOTICE file
>>>>>> + * distributed with this work for additional information
>>>>>> + * regarding copyright ownership.  The ASF licenses this file
>>>>>> + * to you under the Apache License, Version 2.0 (the
>>>>>> + * "License"); you may not use this file except in compliance
>>>>>> + * with the License.  You may obtain a copy of the License at
>>>>>> + *
>>>>>> + *  http://www.apache.org/licenses/LICENSE-2.0
>>>>>> + *
>>>>>> + * Unless required by applicable law or agreed to in writing,
>>>>>> + * software distributed under the License is distributed on an
>>>>>> + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>>>>>> + * KIND, either express or implied.  See the License for the
>>>>>> + * specific language governing permissions and limitations
>>>>>> + * under the License.
>>>>>> + */
>>>>>> +
>>>>>> +import org.slf4j.Logger;
>>>>>> +import org.slf4j.Marker;
>>>>>> +import org.slf4j.helpers.FormattingTuple;
>>>>>> +import org.slf4j.helpers.MessageFormatter;
>>>>>> +
>>>>>> +/**
>>>>>> + * A Slf4j logger bridged onto a Plexus logger.
>>>>>> + */
>>>>>> +class PlexusLogger
>>>>>> +    implements Logger
>>>>>> +{
>>>>>> +
>>>>>> +    private final org.codehaus.plexus.logging.Logger logger;
>>>>>> +
>>>>>> +    public PlexusLogger( org.codehaus.plexus.logging.Logger logger )
>>>>>> +    {
>>>>>> +        this.logger = logger;
>>>>>> +    }
>>>>>> +
>>>>>> +    public String getName()
>>>>>> +    {
>>>>>> +        return logger.getName();
>>>>>> +    }
>>>>>> +
>>>>>> +    public boolean isTraceEnabled()
>>>>>> +    {
>>>>>> +        return isDebugEnabled();
>>>>>> +    }
>>>>>> +
>>>>>> +    public void trace( String msg )
>>>>>> +    {
>>>>>> +        debug( msg );
>>>>>> +    }
>>>>>> +
>>>>>> +    public void trace( String format, Object arg )
>>>>>> +    {
>>>>>> +        debug( format, arg );
>>>>>> +    }
>>>>>> +
>>>>>> +    public void trace( String format, Object arg1, Object arg2 )
>>>>>> +    {
>>>>>> +        debug( format, arg1, arg2 );
>>>>>> +    }
>>>>>> +
>>>>>> +    public void trace( String format, Object[] argArray )
>>>>>> +    {
>>>>>> +        debug( format, argArray );
>>>>>> +    }
>>>>>> +
>>>>>> +    public void trace( String msg, Throwable t )
>>>>>> +    {
>>>>>> +        debug( msg, t );
>>>>>> +    }
>>>>>> +
>>>>>> +    public boolean isTraceEnabled( Marker marker )
>>>>>> +    {
>>>>>> +        return isTraceEnabled();
>>>>>> +    }
>>>>>> +
>>>>>> +    public void trace( Marker marker, String msg )
>>>>>> +    {
>>>>>> +        trace( msg );
>>>>>> +    }
>>>>>> +
>>>>>> +    public void trace( Marker marker, String format, Object arg )
>>>>>> +    {
>>>>>> +        trace( format, arg );
>>>>>> +    }
>>>>>> +
>>>>>> +    public void trace( Marker marker, String format, Object arg1,
>>> Object arg2 )
>>>>>> +    {
>>>>>> +        trace( format, arg1, arg2 );
>>>>>> +    }
>>>>>> +
>>>>>> +    public void trace( Marker marker, String format, Object[]
>>> argArray )
>>>>>> +    {
>>>>>> +        trace( format, argArray );
>>>>>> +    }
>>>>>> +
>>>>>> +    public void trace( Marker marker, String msg, Throwable t )
>>>>>> +    {
>>>>>> +        trace( msg, t );
>>>>>> +    }
>>>>>> +
>>>>>> +    public boolean isDebugEnabled()
>>>>>> +    {
>>>>>> +        return logger.isDebugEnabled();
>>>>>> +    }
>>>>>> +
>>>>>> +    public void debug( String msg )
>>>>>> +    {
>>>>>> +        logger.debug( msg );
>>>>>> +    }
>>>>>> +
>>>>>> +    public void debug( String format, Object arg )
>>>>>> +    {
>>>>>> +        FormattingTuple ft = MessageFormatter.format( format, arg );
>>>>>> +        logger.debug( ft.getMessage(), ft.getThrowable() );
>>>>>> +    }
>>>>>> +
>>>>>> +    public void debug( String format, Object arg1, Object arg2 )
>>>>>> +    {
>>>>>> +        FormattingTuple ft = MessageFormatter.format( format, arg1,
>>> arg2 );
>>>>>> +        logger.debug( ft.getMessage(), ft.getThrowable() );
>>>>>> +    }
>>>>>> +
>>>>>> +    public void debug( String format, Object[] argArray )
>>>>>> +    {
>>>>>> +        FormattingTuple ft = MessageFormatter.arrayFormat( format,
>>> argArray );
>>>>>> +        logger.debug( ft.getMessage(), ft.getThrowable() );
>>>>>> +    }
>>>>>> +
>>>>>> +    public void debug( String msg, Throwable t )
>>>>>> +    {
>>>>>> +        logger.debug( msg, t );
>>>>>> +    }
>>>>>> +
>>>>>> +    public boolean isDebugEnabled( Marker marker )
>>>>>> +    {
>>>>>> +        return isDebugEnabled();
>>>>>> +    }
>>>>>> +
>>>>>> +    public void debug( Marker marker, String msg )
>>>>>> +    {
>>>>>> +        debug( msg );
>>>>>> +    }
>>>>>> +
>>>>>> +    public void debug( Marker marker, String format, Object arg )
>>>>>> +    {
>>>>>> +        debug( format, arg );
>>>>>> +    }
>>>>>> +
>>>>>> +    public void debug( Marker marker, String format, Object arg1,
>>> Object arg2 )
>>>>>> +    {
>>>>>> +        debug( format, arg1, arg2 );
>>>>>> +    }
>>>>>> +
>>>>>> +    public void debug( Marker marker, String format, Object[]
>>> argArray )
>>>>>> +    {
>>>>>> +        debug( format, argArray );
>>>>>> +    }
>>>>>> +
>>>>>> +    public void debug( Marker marker, String msg, Throwable t )
>>>>>> +    {
>>>>>> +        debug( msg, t );
>>>>>> +    }
>>>>>> +
>>>>>> +    public boolean isInfoEnabled()
>>>>>> +    {
>>>>>> +        return logger.isInfoEnabled();
>>>>>> +    }
>>>>>> +
>>>>>> +    public void info( String msg )
>>>>>> +    {
>>>>>> +        logger.info( msg );
>>>>>> +    }
>>>>>> +
>>>>>> +    public void info( String format, Object arg )
>>>>>> +    {
>>>>>> +        FormattingTuple ft = MessageFormatter.format( format, arg );
>>>>>> +        logger.info( ft.getMessage(), ft.getThrowable() );
>>>>>> +    }
>>>>>> +
>>>>>> +    public void info( String format, Object arg1, Object arg2 )
>>>>>> +    {
>>>>>> +        FormattingTuple ft = MessageFormatter.format( format, arg1,
>>> arg2 );
>>>>>> +        logger.info( ft.getMessage(), ft.getThrowable() );
>>>>>> +    }
>>>>>> +
>>>>>> +    public void info( String format, Object[] argArray )
>>>>>> +    {
>>>>>> +        FormattingTuple ft = MessageFormatter.arrayFormat( format,
>>> argArray );
>>>>>> +        logger.info( ft.getMessage(), ft.getThrowable() );
>>>>>> +    }
>>>>>> +
>>>>>> +    public void info( String msg, Throwable t )
>>>>>> +    {
>>>>>> +        logger.info( msg, t );
>>>>>> +    }
>>>>>> +
>>>>>> +    public boolean isInfoEnabled( Marker marker )
>>>>>> +    {
>>>>>> +        return isInfoEnabled();
>>>>>> +    }
>>>>>> +
>>>>>> +    public void info( Marker marker, String msg )
>>>>>> +    {
>>>>>> +        info( msg );
>>>>>> +    }
>>>>>> +
>>>>>> +    public void info( Marker marker, String format, Object arg )
>>>>>> +    {
>>>>>> +        info( format, arg );
>>>>>> +    }
>>>>>> +
>>>>>> +    public void info( Marker marker, String format, Object arg1,
>>> Object arg2 )
>>>>>> +    {
>>>>>> +        info( format, arg1, arg2 );
>>>>>> +    }
>>>>>> +
>>>>>> +    public void info( Marker marker, String format, Object[] argArray
>>> )
>>>>>> +    {
>>>>>> +        info( format, argArray );
>>>>>> +    }
>>>>>> +
>>>>>> +    public void info( Marker marker, String msg, Throwable t )
>>>>>> +    {
>>>>>> +        info( msg, t );
>>>>>> +    }
>>>>>> +
>>>>>> +    public boolean isWarnEnabled()
>>>>>> +    {
>>>>>> +        return logger.isWarnEnabled();
>>>>>> +    }
>>>>>> +
>>>>>> +    public void warn( String msg )
>>>>>> +    {
>>>>>> +        logger.warn( msg );
>>>>>> +    }
>>>>>> +
>>>>>> +    public void warn( String format, Object arg )
>>>>>> +    {
>>>>>> +        FormattingTuple ft = MessageFormatter.format( format, arg );
>>>>>> +        logger.warn( ft.getMessage(), ft.getThrowable() );
>>>>>> +    }
>>>>>> +
>>>>>> +    public void warn( String format, Object arg1, Object arg2 )
>>>>>> +    {
>>>>>> +        FormattingTuple ft = MessageFormatter.format( format, arg1,
>>> arg2 );
>>>>>> +        logger.warn( ft.getMessage(), ft.getThrowable() );
>>>>>> +    }
>>>>>> +
>>>>>> +    public void warn( String format, Object[] argArray )
>>>>>> +    {
>>>>>> +        FormattingTuple ft = MessageFormatter.arrayFormat( format,
>>> argArray );
>>>>>> +        logger.warn( ft.getMessage(), ft.getThrowable() );
>>>>>> +    }
>>>>>> +
>>>>>> +    public void warn( String msg, Throwable t )
>>>>>> +    {
>>>>>> +        logger.warn( msg, t );
>>>>>> +    }
>>>>>> +
>>>>>> +    public boolean isWarnEnabled( Marker marker )
>>>>>> +    {
>>>>>> +        return isWarnEnabled();
>>>>>> +    }
>>>>>> +
>>>>>> +    public void warn( Marker marker, String msg )
>>>>>> +    {
>>>>>> +        warn( msg );
>>>>>> +    }
>>>>>> +
>>>>>> +    public void warn( Marker marker, String format, Object arg )
>>>>>> +    {
>>>>>> +        warn( format, arg );
>>>>>> +    }
>>>>>> +
>>>>>> +    public void warn( Marker marker, String format, Object arg1,
>>> Object arg2 )
>>>>>> +    {
>>>>>> +        warn( format, arg1, arg2 );
>>>>>> +    }
>>>>>> +
>>>>>> +    public void warn( Marker marker, String format, Object[] argArray
>>> )
>>>>>> +    {
>>>>>> +        warn( format, argArray );
>>>>>> +    }
>>>>>> +
>>>>>> +    public void warn( Marker marker, String msg, Throwable t )
>>>>>> +    {
>>>>>> +        warn( msg, t );
>>>>>> +    }
>>>>>> +
>>>>>> +    public boolean isErrorEnabled()
>>>>>> +    {
>>>>>> +        return logger.isErrorEnabled();
>>>>>> +    }
>>>>>> +
>>>>>> +    public void error( String msg )
>>>>>> +    {
>>>>>> +        logger.error( msg );
>>>>>> +    }
>>>>>> +
>>>>>> +    public void error( String format, Object arg )
>>>>>> +    {
>>>>>> +        FormattingTuple ft = MessageFormatter.format( format, arg );
>>>>>> +        logger.error( ft.getMessage(), ft.getThrowable() );
>>>>>> +    }
>>>>>> +
>>>>>> +    public void error( String format, Object arg1, Object arg2 )
>>>>>> +    {
>>>>>> +        FormattingTuple ft = MessageFormatter.format( format, arg1,
>>> arg2 );
>>>>>> +        logger.error( ft.getMessage(), ft.getThrowable() );
>>>>>> +    }
>>>>>> +
>>>>>> +    public void error( String format, Object[] argArray )
>>>>>> +    {
>>>>>> +        FormattingTuple ft = MessageFormatter.arrayFormat( format,
>>> argArray );
>>>>>> +        logger.error( ft.getMessage(), ft.getThrowable() );
>>>>>> +    }
>>>>>> +
>>>>>> +    public void error( String msg, Throwable t )
>>>>>> +    {
>>>>>> +        logger.error( msg, t );
>>>>>> +    }
>>>>>> +
>>>>>> +    public boolean isErrorEnabled( Marker marker )
>>>>>> +    {
>>>>>> +        return isErrorEnabled();
>>>>>> +    }
>>>>>> +
>>>>>> +    public void error( Marker marker, String msg )
>>>>>> +    {
>>>>>> +        error( msg );
>>>>>> +    }
>>>>>> +
>>>>>> +    public void error( Marker marker, String format, Object arg )
>>>>>> +    {
>>>>>> +        error( format, arg );
>>>>>> +    }
>>>>>> +
>>>>>> +    public void error( Marker marker, String format, Object arg1,
>>> Object arg2 )
>>>>>> +    {
>>>>>> +        error( format, arg1, arg2 );
>>>>>> +    }
>>>>>> +
>>>>>> +    public void error( Marker marker, String format, Object[]
>>> argArray )
>>>>>> +    {
>>>>>> +        error( format, argArray );
>>>>>> +    }
>>>>>> +
>>>>>> +    public void error( Marker marker, String msg, Throwable t )
>>>>>> +    {
>>>>>> +        error( msg, t );
>>>>>> +    }
>>>>>> +
>>>>>> +}
>>>>>> 
>>>>>> Added:
>>>>>> 
>>> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLoggerFactory.java
>>>>>> URL:
>>>>>> 
>>> http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLoggerFactory.java?rev=1380105&view=auto
>>>>>> 
>>> ==============================================================================
>>>>>> ---
>>>>>> 
>>> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLoggerFactory.java
>>>>>> (added)
>>>>>> +++
>>>>>> 
>>> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLoggerFactory.java
>>>>>> Mon Sep  3 01:07:31 2012
>>>>>> @@ -0,0 +1,50 @@
>>>>>> +package org.apache.maven.cli;
>>>>>> +
>>>>>> +/*
>>>>>> + * Licensed to the Apache Software Foundation (ASF) under one
>>>>>> + * or more contributor license agreements.  See the NOTICE file
>>>>>> + * distributed with this work for additional information
>>>>>> + * regarding copyright ownership.  The ASF licenses this file
>>>>>> + * to you under the Apache License, Version 2.0 (the
>>>>>> + * "License"); you may not use this file except in compliance
>>>>>> + * with the License.  You may obtain a copy of the License at
>>>>>> + *
>>>>>> + *  http://www.apache.org/licenses/LICENSE-2.0
>>>>>> + *
>>>>>> + * Unless required by applicable law or agreed to in writing,
>>>>>> + * software distributed under the License is distributed on an
>>>>>> + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>>>>>> + * KIND, either express or implied.  See the License for the
>>>>>> + * specific language governing permissions and limitations
>>>>>> + * under the License.
>>>>>> + */
>>>>>> +
>>>>>> +import org.codehaus.plexus.logging.LoggerManager;
>>>>>> +import org.slf4j.ILoggerFactory;
>>>>>> +import org.slf4j.Logger;
>>>>>> +
>>>>>> +/**
>>>>>> + * A Slf4j logger factory bridged onto a Plexus logger manager.
>>>>>> + */
>>>>>> +public class PlexusLoggerFactory
>>>>>> +    implements ILoggerFactory
>>>>>> +{
>>>>>> +
>>>>>> +    private LoggerManager loggerManager;
>>>>>> +
>>>>>> +    public PlexusLoggerFactory( LoggerManager loggerManager )
>>>>>> +    {
>>>>>> +        this.loggerManager = loggerManager;
>>>>>> +    }
>>>>>> +
>>>>>> +    public void setLoggerManager( LoggerManager loggerManager )
>>>>>> +    {
>>>>>> +        this.loggerManager = loggerManager;
>>>>>> +    }
>>>>>> +
>>>>>> +    public Logger getLogger( String name )
>>>>>> +    {
>>>>>> +        return new PlexusLogger( loggerManager.getLoggerForComponent(
>>> name,
>>>>>> null ) );
>>>>>> +    }
>>>>>> +
>>>>>> +}
>>>>>> 
>>>>>> Modified: maven/maven-3/trunk/pom.xml
>>>>>> URL:
>>>>>> 
>>> http://svn.apache.org/viewvc/maven/maven-3/trunk/pom.xml?rev=1380105&r1=1380104&r2=1380105&view=diff
>>>>>> 
>>> ==============================================================================
>>>>>> --- maven/maven-3/trunk/pom.xml (original)
>>>>>> +++ maven/maven-3/trunk/pom.xml Mon Sep  3 01:07:31 2012
>>>>>> @@ -56,6 +56,7 @@
>>>>>>       <modelloVersion>1.4.1</modelloVersion>
>>>>>>       <jxpathVersion>1.3</jxpathVersion>
>>>>>>       <aetherVersion>1.13.1</aetherVersion>
>>>>>> +    <slf4jVersion>1.6.1</slf4jVersion>
>>>>>> 
>>>>>> 
>>> <maven.test.redirectTestOutputToFile>true</maven.test.redirectTestOutputToFile>
>>>>>>       <!-- Control the name of the distribution and information output
>>> by mvn
>>>>>> -->
>>>>>>       <distributionId>apache-maven</distributionId>
>>>>>> @@ -203,6 +204,17 @@
>>>>>>           <artifactId>plexus-interpolation</artifactId>
>>>>>>           <version>${plexusInterpolationVersion}</version>
>>>>>>         </dependency>
>>>>>> +      <dependency>
>>>>>> +        <groupId>org.slf4j</groupId>
>>>>>> +        <artifactId>slf4j-api</artifactId>
>>>>>> +        <version>${slf4jVersion}</version>
>>>>>> +      </dependency>
>>>>>> +      <dependency>
>>>>>> +        <groupId>org.slf4j</groupId>
>>>>>> +        <artifactId>slf4j-nop</artifactId>
>>>>>> +        <version>${slf4jVersion}</version>
>>>>>> +        <scope>runtime</scope>
>>>>>> +      </dependency>
>>>>>>         <!--  Wagon -->
>>>>>>         <dependency>
>>>>>>           <groupId>org.apache.maven.wagon</groupId>
>>>>>> 
>>>>> 
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>>>>> For additional commands, e-mail: dev-help@maven.apache.org
>>>>> 
>>>>> 
>>>> 
>>>> 
>>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: dev-help@maven.apache.org
>>> 
>>> 
>> 
>> 
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 

Thanks,

Jason

----------------------------------------------------------
Jason van Zyl
Founder & CTO, Sonatype
Founder,  Apache Maven
http://twitter.com/jvanzyl
---------------------------------------------------------

A man enjoys his work when he understands the whole and when he
is responsible for the quality of the whole

 -- Christopher Alexander, A Pattern Language






Re: svn commit: r1380105 - in /maven/maven-3/trunk: ./ apache-maven/ maven-core/src/main/java/org/apache/maven/classrealm/ maven-embedder/ maven-embedder/src/main/java/org/apache/maven/cli/

Posted by Mark Struberg <st...@yahoo.de>.

> A simpler approach
> would be to produce a bridge dependency: slf4j-maven so that everyone that
> has dependencies that use slf4j can trivially route their dependency
> logging through to maven


+1 for taking this route. That would also allow us to adopt easily for future API changes. Been there, done that ...

LieGrue,
strub

>________________________________
> From: Stephen Connolly <st...@gmail.com>
>To: Maven Developers List <de...@maven.apache.org>; Mark Struberg <st...@yahoo.de> 
>Sent: Monday, September 3, 2012 11:55 AM
>Subject: Re: svn commit: r1380105 - in /maven/maven-3/trunk: ./ apache-maven/ maven-core/src/main/java/org/apache/maven/classrealm/ maven-embedder/ maven-embedder/src/main/java/org/apache/maven/cli/
> 
>On 3 September 2012 09:59, Mark Struberg <st...@yahoo.de> wrote:
>
>>
>> > imports.put( "org.slf4j.*", coreRealm );
>>
>> To me this looks like any org.slf4j sub package would be exported.
>>
>
>slf4j is such a ubiquitous logging framework that it seems to me that it
>would make sense to allow any plugins that have dependencies that use slf4j
>to log through to maven.
>
>
>>
>> The whole goal of org.codehaus.plexus.logging.Logger was to shield the
>> user from ANY specific logging framework. That way we could back the plexus
>> Logger with any implementation the user wants.
>>
>>
>> We already HAVE a logging bridge. Imo there is just no need to introduce
>> another one!
>>
>
>That is fine for plugin code, but why should *everyone* else have to
>rewrite the same bridge from slf4j to our logging bridge?
>
>And then that bridge routes back to slf4j?
>
>
>> To kind of hardcode this now to slf4j is frankly speaking nonsense imo.
>>
>>
>Perhaps. I have concerns about slf4j API stability having seen some issues
>with slf4j 1.5 vs 1.6 which I resolved and forgot about. A simpler approach
>would be to produce a bridge dependency: slf4j-maven so that everyone that
>has dependencies that use slf4j can trivially route their dependency
>logging through to maven
>
>
>> But maybe I just missed the point? What is the reason for it?
>>
>>
>Consider jetty:run... jetty sends its logging to slf4j... so to play
>properly the plugin *should* be picking up those logs and routing them
>through to Maven so that Maven's logging controls can correctly filter the
>logs... now tomcat:run needs to do the same, etc....
>
>There is logging bridge madness all over the shop.
>
>Logging bridges should be as close to the logger as possible, especially in
>a short lived tool such as Maven, where the JVM may not have had a chance
>to optimize out the bridge.
>
>For server classes such as, e.g. MyFaces, the use of a bridge is less of an
>issue as the JVM will optimize it out of the code since there is only one
>trivial implementation and that can be in-lined and reduced away to a
>direct call.
>
>But a build tool that is invoking other 3rd party libs on a short lived
>lifecycle will have a performance hit for the logging calls.
>
>That is the argument for exposing directly.
>
>The argument against is that slf4j's API sucks... though it sucks less than
>any other logging api out there at the moment... there are still issues
>with it ;-)
>
>
>>
>> LieGrue,
>> strub
>>
>>
>> >________________________________
>> > From: Stephen Connolly <st...@gmail.com>
>> >To: Maven Developers List <de...@maven.apache.org>; Mark Struberg <
>> struberg@yahoo.de>
>> >Sent: Monday, September 3, 2012 10:42 AM
>> >Subject: Re: svn commit: r1380105 - in /maven/maven-3/trunk: ./
>> apache-maven/ maven-core/src/main/java/org/apache/maven/classrealm/
>> maven-embedder/ maven-embedder/src/main/java/org/apache/maven/cli/
>> >
>> >
>> >I'm not seeing log4j-over-slf4j in the dependency tree there at all... so
>> where is the bridge?
>> >
>> >
>> >On 3 September 2012 08:10, Mark Struberg <st...@yahoo.de> wrote:
>> >
>> >whats the reason for the slf4j bridge?
>> >>
>> >>This is kown to trash old plugins which use log4j because it clashes
>> with it's namespace and only partly implements the log4j classes.
>> >>
>> >>I personally ind slf4j nice, but for older projects which use
>> commons-logging or log4j already (and where you cant fiddle around with
>> their sources) this broke way too many things for me.
>> >>Why is this needed at all? Has nothing to do with JSR-330.
>> >>
>> >>LieGrue,
>> >>strub
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>----- Original Message -----
>> >>> From: "jvanzyl@apache.org" <jv...@apache.org>
>> >>> To: commits@maven.apache.org
>> >>> Cc:
>> >>> Sent: Monday, September 3, 2012 3:07 AM
>> >>> Subject: svn commit: r1380105 - in /maven/maven-3/trunk: ./
>> apache-maven/ maven-core/src/main/java/org/apache/maven/classrealm/
>> maven-embedder/ maven-embedder/src/main/java/org/apache/maven/cli/
>> >>>
>> >>> Author: jvanzyl
>> >>> Date: Mon Sep  3 01:07:31 2012
>> >>> New Revision: 1380105
>> >>>
>> >>> URL: http://svn.apache.org/viewvc?rev=1380105&view=rev
>> >>> Log:
>> >>> o Enabled support and discovery of JSR-330 components
>> >>>
>> >>> o Added Slf4j logger factory to support generic JSR-330 logging
>> >>>
>> >>> o Exported Guice package for components that access Guice (or better
>> it's
>> >>> injector) directly
>> >>>
>> >>> Widen export of Guice packages (not ideal, need to look into ways to
>> avoid this)
>> >>>
>> >>> o use specific exports
>> >>>
>> >>> o for now we will attempt to hide all of Guice in plugin realms and
>> we'll do
>> >>> a bit of testing
>> >>>
>> >>> closes #3
>> >>>
>> >>> Added:
>> >>>
>> >>>
>> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLogger.java
>> >>>
>> >>>
>> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLoggerFactory.java
>> >>> Modified:
>> >>>     maven/maven-3/trunk/apache-maven/pom.xml
>> >>>
>> >>>
>> maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java
>> >>>     maven/maven-3/trunk/maven-embedder/pom.xml
>> >>>
>> >>>
>> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
>> >>>     maven/maven-3/trunk/pom.xml
>> >>>
>> >>> Modified: maven/maven-3/trunk/apache-maven/pom.xml
>> >>> URL:
>> >>>
>> http://svn.apache.org/viewvc/maven/maven-3/trunk/apache-maven/pom.xml?rev=1380105&r1=1380104&r2=1380105&view=diff
>> >>>
>> ==============================================================================
>> >>> --- maven/maven-3/trunk/apache-maven/pom.xml (original)
>> >>> +++ maven/maven-3/trunk/apache-maven/pom.xml Mon Sep  3 01:07:31 2012
>> >>> @@ -83,6 +83,10 @@
>> >>>        <groupId>org.sonatype.aether</groupId>
>> >>>        <artifactId>aether-connector-wagon</artifactId>
>> >>>      </dependency>
>> >>> +    <dependency>
>> >>> +      <groupId>org.slf4j</groupId>
>> >>> +      <artifactId>slf4j-nop</artifactId>
>> >>> +    </dependency>
>> >>>    </dependencies>
>> >>>
>> >>>    <build>
>> >>>
>> >>> Modified:
>> >>>
>> maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java
>> >>> URL:
>> >>>
>> http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java?rev=1380105&r1=1380104&r2=1380105&view=diff
>> >>>
>> ==============================================================================
>> >>> ---
>> >>>
>> maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java
>> >>> (original)
>> >>> +++
>> >>>
>> maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java
>> >>> Mon Sep  3 01:07:31 2012
>> >>> @@ -198,6 +198,26 @@ public class DefaultClassRealmManager
>> >>>          imports.put(
>> >>> "org.codehaus.plexus.util.xml.pull.XmlPullParser", coreRealm );
>> >>>          imports.put(
>> >>> "org.codehaus.plexus.util.xml.pull.XmlPullParserException", coreRealm
>> >>> );
>> >>>          imports.put(
>> >>> "org.codehaus.plexus.util.xml.pull.XmlSerializer", coreRealm );
>> >>> +
>> >>> +        // javax.inject, sisu-inject (JSR-330)
>> >>> +        imports.put( "javax.inject.*", coreRealm );
>> >>> +        imports.put( "javax.enterprise.inject.*", coreRealm );
>> >>> +        imports.put( "org.sonatype.inject.*", coreRealm );
>> >>> +        imports.put( "org.slf4j.*", coreRealm );
>> >>> +
>> >>> +        // com.google
>> >>> +        //
>> >>> +        // We may potentially want to export these, but right now I'm
>> not
>> >>> sure that anything Guice specific needs
>> >>> +        // to be made available to plugin authors. If we find people
>> are
>> >>> getting fancy and want to take advantage
>> >>> +        // of Guice specifics we can expose that later. Really some
>> testing
>> >>> needs to be done to see full hiding
>> >>> +        // of Guice has any impact on what we may categorize as a
>> standard
>> >>> JSR-330 based Tesla/Maven plugin.
>> >>> +        //
>> >>> +        // imports.put( "com.google.inject.*", coreRealm );
>> >>> +        // imports.put( "com.google.inject.binder.*", coreRealm );
>> >>> +        // imports.put( "com.google.inject.matcher.*", coreRealm );
>> >>> +        // imports.put( "com.google.inject.name.*", coreRealm );
>> >>> +        // imports.put( "com.google.inject.spi.*", coreRealm );
>> >>> +        // imports.put( "com.google.inject.util.*", coreRealm );
>> >>>      }
>> >>>
>> >>>      /**
>> >>>
>> >>> Modified: maven/maven-3/trunk/maven-embedder/pom.xml
>> >>> URL:
>> >>>
>> http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-embedder/pom.xml?rev=1380105&r1=1380104&r2=1380105&view=diff
>> >>>
>> ==============================================================================
>> >>> --- maven/maven-3/trunk/maven-embedder/pom.xml (original)
>> >>> +++ maven/maven-3/trunk/maven-embedder/pom.xml Mon Sep  3 01:07:31 2012
>> >>> @@ -70,6 +70,10 @@
>> >>>        <groupId>org.sonatype.plexus</groupId>
>> >>>        <artifactId>plexus-cipher</artifactId>
>> >>>      </dependency>
>> >>> +    <dependency>
>> >>> +      <groupId>org.slf4j</groupId>
>> >>> +      <artifactId>slf4j-api</artifactId>
>> >>> +    </dependency>
>> >>>      <!-- CLI -->
>> >>>      <dependency>
>> >>>        <groupId>commons-cli</groupId>
>> >>>
>> >>> Modified:
>> >>>
>> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
>> >>> URL:
>> >>>
>> http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java?rev=1380105&r1=1380104&r2=1380105&view=diff
>> >>>
>> ==============================================================================
>> >>> ---
>> >>>
>> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
>> >>> (original)
>> >>> +++
>> >>>
>> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
>> >>> Mon Sep  3 01:07:31 2012
>> >>> @@ -59,12 +59,14 @@ import org.apache.maven.settings.buildin
>> >>> import org.codehaus.plexus.ContainerConfiguration;
>> >>> import org.codehaus.plexus.DefaultContainerConfiguration;
>> >>> import org.codehaus.plexus.DefaultPlexusContainer;
>> >>> +import org.codehaus.plexus.PlexusConstants;
>> >>> import org.codehaus.plexus.PlexusContainer;
>> >>> import org.codehaus.plexus.classworlds.ClassWorld;
>> >>> import org.codehaus.plexus.classworlds.realm.ClassRealm;
>> >>> import
>> >>>
>> org.codehaus.plexus.component.repository.exception.ComponentLookupException;
>> >>> import org.codehaus.plexus.logging.Logger;
>> >>> import org.codehaus.plexus.util.StringUtils;
>> >>> +import org.slf4j.ILoggerFactory;
>> >>> import org.sonatype.aether.transfer.TransferListener;
>> >>> import org.sonatype.plexus.components.cipher.DefaultPlexusCipher;
>> >>> import
>> org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher;
>> >>> @@ -72,6 +74,8 @@ import org.sonatype.plexus.components.se
>> >>> import org.sonatype.plexus.components.sec.dispatcher.SecUtil;
>> >>> import
>> org.sonatype.plexus.components.sec.dispatcher.model.SettingsSecurity;
>> >>>
>> >>> +import com.google.inject.AbstractModule;
>> >>> +
>> >>> // TODO: push all common bits back to plexus cli and prepare for
>> transition to
>> >>> Guice. We don't need 50 ways to make CLIs
>> >>>
>> >>> /**
>> >>> @@ -372,17 +376,29 @@ public class MavenCli
>> >>>          {
>> >>>              logger = setupLogger( cliRequest );
>> >>>
>> >>> +            final MavenLoggerManager loggerManager = new
>> MavenLoggerManager(
>> >>> logger ) ;
>> >>> +
>> >>>              ContainerConfiguration cc = new
>> DefaultContainerConfiguration()
>> >>>                  .setClassWorld( cliRequest.classWorld )
>> >>>                  .setRealm( setupContainerRealm( cliRequest ) )
>> >>> +                .setClassPathScanning( PlexusConstants.SCANNING_INDEX
>> )
>> >>> +                .setAutoWiring( true )
>> >>>                  .setName( "maven" );
>> >>>
>> >>> -            container = new DefaultPlexusContainer( cc );
>> >>> +            container = new DefaultPlexusContainer( cc, new
>> AbstractModule()
>> >>> +            {
>> >>> +
>> >>> +                protected void configure()
>> >>> +                {
>> >>> +                    bind( ILoggerFactory.class ).toInstance( new
>> >>> PlexusLoggerFactory( loggerManager ) );
>> >>> +                }
>> >>> +
>> >>> +            } );
>> >>>
>> >>>              // NOTE: To avoid inconsistencies, we'll use the TCCL
>> >>> exclusively for lookups
>> >>>              container.setLookupRealm( null );
>> >>>
>> >>> -            container.setLoggerManager( new MavenLoggerManager(
>> logger ) );
>> >>> +            container.setLoggerManager( loggerManager );
>> >>>
>> >>>              customizeContainer( container );
>> >>>
>> >>>
>> >>> Added:
>> >>>
>> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLogger.java
>> >>> URL:
>> >>>
>> http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLogger.java?rev=1380105&view=auto
>> >>>
>> ==============================================================================
>> >>> ---
>> >>>
>> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLogger.java
>> >>> (added)
>> >>> +++
>> >>>
>> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLogger.java
>> >>> Mon Sep  3 01:07:31 2012
>> >>> @@ -0,0 +1,358 @@
>> >>> +package org.apache.maven.cli;
>> >>> +
>> >>> +/*
>> >>> + * Licensed to the Apache Software Foundation (ASF) under one
>> >>> + * or more contributor license agreements.  See the NOTICE file
>> >>> + * distributed with this work for additional information
>> >>> + * regarding copyright ownership.  The ASF licenses this file
>> >>> + * to you under the Apache License, Version 2.0 (the
>> >>> + * "License"); you may not use this file except in compliance
>> >>> + * with the License.  You may obtain a copy of the License at
>> >>> + *
>> >>> + *  http://www.apache.org/licenses/LICENSE-2.0
>> >>> + *
>> >>> + * Unless required by applicable law or agreed to in writing,
>> >>> + * software distributed under the License is distributed on an
>> >>> + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>> >>> + * KIND, either express or implied.  See the License for the
>> >>> + * specific language governing permissions and limitations
>> >>> + * under the License.
>> >>> + */
>> >>> +
>> >>> +import org.slf4j.Logger;
>> >>> +import org.slf4j.Marker;
>> >>> +import org.slf4j.helpers.FormattingTuple;
>> >>> +import org.slf4j.helpers.MessageFormatter;
>> >>> +
>> >>> +/**
>> >>> + * A Slf4j logger bridged onto a Plexus logger.
>> >>> + */
>> >>> +class PlexusLogger
>> >>> +    implements Logger
>> >>> +{
>> >>> +
>> >>> +    private final org.codehaus.plexus.logging.Logger logger;
>> >>> +
>> >>> +    public PlexusLogger( org.codehaus.plexus.logging.Logger logger )
>> >>> +    {
>> >>> +        this.logger = logger;
>> >>> +    }
>> >>> +
>> >>> +    public String getName()
>> >>> +    {
>> >>> +        return logger.getName();
>> >>> +    }
>> >>> +
>> >>> +    public boolean isTraceEnabled()
>> >>> +    {
>> >>> +        return isDebugEnabled();
>> >>> +    }
>> >>> +
>> >>> +    public void trace( String msg )
>> >>> +    {
>> >>> +        debug( msg );
>> >>> +    }
>> >>> +
>> >>> +    public void trace( String format, Object arg )
>> >>> +    {
>> >>> +        debug( format, arg );
>> >>> +    }
>> >>> +
>> >>> +    public void trace( String format, Object arg1, Object arg2 )
>> >>> +    {
>> >>> +        debug( format, arg1, arg2 );
>> >>> +    }
>> >>> +
>> >>> +    public void trace( String format, Object[] argArray )
>> >>> +    {
>> >>> +        debug( format, argArray );
>> >>> +    }
>> >>> +
>> >>> +    public void trace( String msg, Throwable t )
>> >>> +    {
>> >>> +        debug( msg, t );
>> >>> +    }
>> >>> +
>> >>> +    public boolean isTraceEnabled( Marker marker )
>> >>> +    {
>> >>> +        return isTraceEnabled();
>> >>> +    }
>> >>> +
>> >>> +    public void trace( Marker marker, String msg )
>> >>> +    {
>> >>> +        trace( msg );
>> >>> +    }
>> >>> +
>> >>> +    public void trace( Marker marker, String format, Object arg )
>> >>> +    {
>> >>> +        trace( format, arg );
>> >>> +    }
>> >>> +
>> >>> +    public void trace( Marker marker, String format, Object arg1,
>> Object arg2 )
>> >>> +    {
>> >>> +        trace( format, arg1, arg2 );
>> >>> +    }
>> >>> +
>> >>> +    public void trace( Marker marker, String format, Object[]
>> argArray )
>> >>> +    {
>> >>> +        trace( format, argArray );
>> >>> +    }
>> >>> +
>> >>> +    public void trace( Marker marker, String msg, Throwable t )
>> >>> +    {
>> >>> +        trace( msg, t );
>> >>> +    }
>> >>> +
>> >>> +    public boolean isDebugEnabled()
>> >>> +    {
>> >>> +        return logger.isDebugEnabled();
>> >>> +    }
>> >>> +
>> >>> +    public void debug( String msg )
>> >>> +    {
>> >>> +        logger.debug( msg );
>> >>> +    }
>> >>> +
>> >>> +    public void debug( String format, Object arg )
>> >>> +    {
>> >>> +        FormattingTuple ft = MessageFormatter.format( format, arg );
>> >>> +        logger.debug( ft.getMessage(), ft.getThrowable() );
>> >>> +    }
>> >>> +
>> >>> +    public void debug( String format, Object arg1, Object arg2 )
>> >>> +    {
>> >>> +        FormattingTuple ft = MessageFormatter.format( format, arg1,
>> arg2 );
>> >>> +        logger.debug( ft.getMessage(), ft.getThrowable() );
>> >>> +    }
>> >>> +
>> >>> +    public void debug( String format, Object[] argArray )
>> >>> +    {
>> >>> +        FormattingTuple ft = MessageFormatter.arrayFormat( format,
>> argArray );
>> >>> +        logger.debug( ft.getMessage(), ft.getThrowable() );
>> >>> +    }
>> >>> +
>> >>> +    public void debug( String msg, Throwable t )
>> >>> +    {
>> >>> +        logger.debug( msg, t );
>> >>> +    }
>> >>> +
>> >>> +    public boolean isDebugEnabled( Marker marker )
>> >>> +    {
>> >>> +        return isDebugEnabled();
>> >>> +    }
>> >>> +
>> >>> +    public void debug( Marker marker, String msg )
>> >>> +    {
>> >>> +        debug( msg );
>> >>> +    }
>> >>> +
>> >>> +    public void debug( Marker marker, String format, Object arg )
>> >>> +    {
>> >>> +        debug( format, arg );
>> >>> +    }
>> >>> +
>> >>> +    public void debug( Marker marker, String format, Object arg1,
>> Object arg2 )
>> >>> +    {
>> >>> +        debug( format, arg1, arg2 );
>> >>> +    }
>> >>> +
>> >>> +    public void debug( Marker marker, String format, Object[]
>> argArray )
>> >>> +    {
>> >>> +        debug( format, argArray );
>> >>> +    }
>> >>> +
>> >>> +    public void debug( Marker marker, String msg, Throwable t )
>> >>> +    {
>> >>> +        debug( msg, t );
>> >>> +    }
>> >>> +
>> >>> +    public boolean isInfoEnabled()
>> >>> +    {
>> >>> +        return logger.isInfoEnabled();
>> >>> +    }
>> >>> +
>> >>> +    public void info( String msg )
>> >>> +    {
>> >>> +        logger.info( msg );
>> >>> +    }
>> >>> +
>> >>> +    public void info( String format, Object arg )
>> >>> +    {
>> >>> +        FormattingTuple ft = MessageFormatter.format( format, arg );
>> >>> +        logger.info( ft.getMessage(), ft.getThrowable() );
>> >>> +    }
>> >>> +
>> >>> +    public void info( String format, Object arg1, Object arg2 )
>> >>> +    {
>> >>> +        FormattingTuple ft = MessageFormatter.format( format, arg1,
>> arg2 );
>> >>> +        logger.info( ft.getMessage(), ft.getThrowable() );
>> >>> +    }
>> >>> +
>> >>> +    public void info( String format, Object[] argArray )
>> >>> +    {
>> >>> +        FormattingTuple ft = MessageFormatter.arrayFormat( format,
>> argArray );
>> >>> +        logger.info( ft.getMessage(), ft.getThrowable() );
>> >>> +    }
>> >>> +
>> >>> +    public void info( String msg, Throwable t )
>> >>> +    {
>> >>> +        logger.info( msg, t );
>> >>> +    }
>> >>> +
>> >>> +    public boolean isInfoEnabled( Marker marker )
>> >>> +    {
>> >>> +        return isInfoEnabled();
>> >>> +    }
>> >>> +
>> >>> +    public void info( Marker marker, String msg )
>> >>> +    {
>> >>> +        info( msg );
>> >>> +    }
>> >>> +
>> >>> +    public void info( Marker marker, String format, Object arg )
>> >>> +    {
>> >>> +        info( format, arg );
>> >>> +    }
>> >>> +
>> >>> +    public void info( Marker marker, String format, Object arg1,
>> Object arg2 )
>> >>> +    {
>> >>> +        info( format, arg1, arg2 );
>> >>> +    }
>> >>> +
>> >>> +    public void info( Marker marker, String format, Object[] argArray
>> )
>> >>> +    {
>> >>> +        info( format, argArray );
>> >>> +    }
>> >>> +
>> >>> +    public void info( Marker marker, String msg, Throwable t )
>> >>> +    {
>> >>> +        info( msg, t );
>> >>> +    }
>> >>> +
>> >>> +    public boolean isWarnEnabled()
>> >>> +    {
>> >>> +        return logger.isWarnEnabled();
>> >>> +    }
>> >>> +
>> >>> +    public void warn( String msg )
>> >>> +    {
>> >>> +        logger.warn( msg );
>> >>> +    }
>> >>> +
>> >>> +    public void warn( String format, Object arg )
>> >>> +    {
>> >>> +        FormattingTuple ft = MessageFormatter.format( format, arg );
>> >>> +        logger.warn( ft.getMessage(), ft.getThrowable() );
>> >>> +    }
>> >>> +
>> >>> +    public void warn( String format, Object arg1, Object arg2 )
>> >>> +    {
>> >>> +        FormattingTuple ft = MessageFormatter.format( format, arg1,
>> arg2 );
>> >>> +        logger.warn( ft.getMessage(), ft.getThrowable() );
>> >>> +    }
>> >>> +
>> >>> +    public void warn( String format, Object[] argArray )
>> >>> +    {
>> >>> +        FormattingTuple ft = MessageFormatter.arrayFormat( format,
>> argArray );
>> >>> +        logger.warn( ft.getMessage(), ft.getThrowable() );
>> >>> +    }
>> >>> +
>> >>> +    public void warn( String msg, Throwable t )
>> >>> +    {
>> >>> +        logger.warn( msg, t );
>> >>> +    }
>> >>> +
>> >>> +    public boolean isWarnEnabled( Marker marker )
>> >>> +    {
>> >>> +        return isWarnEnabled();
>> >>> +    }
>> >>> +
>> >>> +    public void warn( Marker marker, String msg )
>> >>> +    {
>> >>> +        warn( msg );
>> >>> +    }
>> >>> +
>> >>> +    public void warn( Marker marker, String format, Object arg )
>> >>> +    {
>> >>> +        warn( format, arg );
>> >>> +    }
>> >>> +
>> >>> +    public void warn( Marker marker, String format, Object arg1,
>> Object arg2 )
>> >>> +    {
>> >>> +        warn( format, arg1, arg2 );
>> >>> +    }
>> >>> +
>> >>> +    public void warn( Marker marker, String format, Object[] argArray
>> )
>> >>> +    {
>> >>> +        warn( format, argArray );
>> >>> +    }
>> >>> +
>> >>> +    public void warn( Marker marker, String msg, Throwable t )
>> >>> +    {
>> >>> +        warn( msg, t );
>> >>> +    }
>> >>> +
>> >>> +    public boolean isErrorEnabled()
>> >>> +    {
>> >>> +        return logger.isErrorEnabled();
>> >>> +    }
>> >>> +
>> >>> +    public void error( String msg )
>> >>> +    {
>> >>> +        logger.error( msg );
>> >>> +    }
>> >>> +
>> >>> +    public void error( String format, Object arg )
>> >>> +    {
>> >>> +        FormattingTuple ft = MessageFormatter.format( format, arg );
>> >>> +        logger.error( ft.getMessage(), ft.getThrowable() );
>> >>> +    }
>> >>> +
>> >>> +    public void error( String format, Object arg1, Object arg2 )
>> >>> +    {
>> >>> +        FormattingTuple ft = MessageFormatter.format( format, arg1,
>> arg2 );
>> >>> +        logger.error( ft.getMessage(), ft.getThrowable() );
>> >>> +    }
>> >>> +
>> >>> +    public void error( String format, Object[] argArray )
>> >>> +    {
>> >>> +        FormattingTuple ft = MessageFormatter.arrayFormat( format,
>> argArray );
>> >>> +        logger.error( ft.getMessage(), ft.getThrowable() );
>> >>> +    }
>> >>> +
>> >>> +    public void error( String msg, Throwable t )
>> >>> +    {
>> >>> +        logger.error( msg, t );
>> >>> +    }
>> >>> +
>> >>> +    public boolean isErrorEnabled( Marker marker )
>> >>> +    {
>> >>> +        return isErrorEnabled();
>> >>> +    }
>> >>> +
>> >>> +    public void error( Marker marker, String msg )
>> >>> +    {
>> >>> +        error( msg );
>> >>> +    }
>> >>> +
>> >>> +    public void error( Marker marker, String format, Object arg )
>> >>> +    {
>> >>> +        error( format, arg );
>> >>> +    }
>> >>> +
>> >>> +    public void error( Marker marker, String format, Object arg1,
>> Object arg2 )
>> >>> +    {
>> >>> +        error( format, arg1, arg2 );
>> >>> +    }
>> >>> +
>> >>> +    public void error( Marker marker, String format, Object[]
>> argArray )
>> >>> +    {
>> >>> +        error( format, argArray );
>> >>> +    }
>> >>> +
>> >>> +    public void error( Marker marker, String msg, Throwable t )
>> >>> +    {
>> >>> +        error( msg, t );
>> >>> +    }
>> >>> +
>> >>> +}
>> >>>
>> >>> Added:
>> >>>
>> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLoggerFactory.java
>> >>> URL:
>> >>>
>> http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLoggerFactory.java?rev=1380105&view=auto
>> >>>
>> ==============================================================================
>> >>> ---
>> >>>
>> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLoggerFactory.java
>> >>> (added)
>> >>> +++
>> >>>
>> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLoggerFactory.java
>> >>> Mon Sep  3 01:07:31 2012
>> >>> @@ -0,0 +1,50 @@
>> >>> +package org.apache.maven.cli;
>> >>> +
>> >>> +/*
>> >>> + * Licensed to the Apache Software Foundation (ASF) under one
>> >>> + * or more contributor license agreements.  See the NOTICE file
>> >>> + * distributed with this work for additional information
>> >>> + * regarding copyright ownership.  The ASF licenses this file
>> >>> + * to you under the Apache License, Version 2.0 (the
>> >>> + * "License"); you may not use this file except in compliance
>> >>> + * with the License.  You may obtain a copy of the License at
>> >>> + *
>> >>> + *  http://www.apache.org/licenses/LICENSE-2.0
>> >>> + *
>> >>> + * Unless required by applicable law or agreed to in writing,
>> >>> + * software distributed under the License is distributed on an
>> >>> + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>> >>> + * KIND, either express or implied.  See the License for the
>> >>> + * specific language governing permissions and limitations
>> >>> + * under the License.
>> >>> + */
>> >>> +
>> >>> +import org.codehaus.plexus.logging.LoggerManager;
>> >>> +import org.slf4j.ILoggerFactory;
>> >>> +import org.slf4j.Logger;
>> >>> +
>> >>> +/**
>> >>> + * A Slf4j logger factory bridged onto a Plexus logger manager.
>> >>> + */
>> >>> +public class PlexusLoggerFactory
>> >>> +    implements ILoggerFactory
>> >>> +{
>> >>> +
>> >>> +    private LoggerManager loggerManager;
>> >>> +
>> >>> +    public PlexusLoggerFactory( LoggerManager loggerManager )
>> >>> +    {
>> >>> +        this.loggerManager = loggerManager;
>> >>> +    }
>> >>> +
>> >>> +    public void setLoggerManager( LoggerManager loggerManager )
>> >>> +    {
>> >>> +        this.loggerManager = loggerManager;
>> >>> +    }
>> >>> +
>> >>> +    public Logger getLogger( String name )
>> >>> +    {
>> >>> +        return new PlexusLogger( loggerManager.getLoggerForComponent(
>> name,
>> >>> null ) );
>> >>> +    }
>> >>> +
>> >>> +}
>> >>>
>> >>> Modified: maven/maven-3/trunk/pom.xml
>> >>> URL:
>> >>>
>> http://svn.apache.org/viewvc/maven/maven-3/trunk/pom.xml?rev=1380105&r1=1380104&r2=1380105&view=diff
>> >>>
>> ==============================================================================
>> >>> --- maven/maven-3/trunk/pom.xml (original)
>> >>> +++ maven/maven-3/trunk/pom.xml Mon Sep  3 01:07:31 2012
>> >>> @@ -56,6 +56,7 @@
>> >>>      <modelloVersion>1.4.1</modelloVersion>
>> >>>      <jxpathVersion>1.3</jxpathVersion>
>> >>>      <aetherVersion>1.13.1</aetherVersion>
>> >>> +    <slf4jVersion>1.6.1</slf4jVersion>
>> >>>
>> >>>
>> <maven.test.redirectTestOutputToFile>true</maven.test.redirectTestOutputToFile>
>> >>>      <!-- Control the name of the distribution and information output
>> by mvn
>> >>> -->
>> >>>      <distributionId>apache-maven</distributionId>
>> >>> @@ -203,6 +204,17 @@
>> >>>          <artifactId>plexus-interpolation</artifactId>
>> >>>          <version>${plexusInterpolationVersion}</version>
>> >>>        </dependency>
>> >>> +      <dependency>
>> >>> +        <groupId>org.slf4j</groupId>
>> >>> +        <artifactId>slf4j-api</artifactId>
>> >>> +        <version>${slf4jVersion}</version>
>> >>> +      </dependency>
>> >>> +      <dependency>
>> >>> +        <groupId>org.slf4j</groupId>
>> >>> +        <artifactId>slf4j-nop</artifactId>
>> >>> +        <version>${slf4jVersion}</version>
>> >>> +        <scope>runtime</scope>
>> >>> +      </dependency>
>> >>>        <!--  Wagon -->
>> >>>        <dependency>
>> >>>          <groupId>org.apache.maven.wagon</groupId>
>> >>>
>> >>
>> >>---------------------------------------------------------------------
>> >>To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> >>For additional commands, e-mail: dev-help@maven.apache.org
>> >>
>> >>
>> >
>> >
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>>
>>
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: svn commit: r1380105 - in /maven/maven-3/trunk: ./ apache-maven/ maven-core/src/main/java/org/apache/maven/classrealm/ maven-embedder/ maven-embedder/src/main/java/org/apache/maven/cli/

Posted by Jason van Zyl <ja...@tesla.io>.
On Sep 3, 2012, at 5:55 AM, Stephen Connolly wrote:

> On 3 September 2012 09:59, Mark Struberg <st...@yahoo.de> wrote:
> 
>> 
>>> imports.put( "org.slf4j.*", coreRealm );
>> 
>> To me this looks like any org.slf4j sub package would be exported.
>> 
> 
> slf4j is such a ubiquitous logging framework that it seems to me that it
> would make sense to allow any plugins that have dependencies that use slf4j
> to log through to maven.

That is my thinking. It's easy enough to plugin any default implementation, and the funnels for all the logging systems work well. Ideally we pick an implementation and put in the funnels for JDK and commons-logging and we're set indefinitely, I think.

> 
> 
>> 
>> The whole goal of org.codehaus.plexus.logging.Logger was to shield the
>> user from ANY specific logging framework. That way we could back the plexus
>> Logger with any implementation the user wants.
>> 
>> 
>> We already HAVE a logging bridge. Imo there is just no need to introduce
>> another one!
>> 
> 
> That is fine for plugin code, but why should *everyone* else have to
> rewrite the same bridge from slf4j to our logging bridge?
> 
> And then that bridge routes back to slf4j?
> 
> 
>> To kind of hardcode this now to slf4j is frankly speaking nonsense imo.
>> 
>> 
> Perhaps. I have concerns about slf4j API stability having seen some issues
> with slf4j 1.5 vs 1.6 which I resolved and forgot about. A simpler approach
> would be to produce a bridge dependency: slf4j-maven so that everyone that
> has dependencies that use slf4j can trivially route their dependency
> logging through to maven
> 
> 
>> But maybe I just missed the point? What is the reason for it?
>> 
>> 
> Consider jetty:run... jetty sends its logging to slf4j... so to play
> properly the plugin *should* be picking up those logs and routing them
> through to Maven so that Maven's logging controls can correctly filter the
> logs... now tomcat:run needs to do the same, etc....
> 
> There is logging bridge madness all over the shop.
> 
> Logging bridges should be as close to the logger as possible, especially in
> a short lived tool such as Maven, where the JVM may not have had a chance
> to optimize out the bridge.
> 
> For server classes such as, e.g. MyFaces, the use of a bridge is less of an
> issue as the JVM will optimize it out of the code since there is only one
> trivial implementation and that can be in-lined and reduced away to a
> direct call.
> 
> But a build tool that is invoking other 3rd party libs on a short lived
> lifecycle will have a performance hit for the logging calls.
> 
> That is the argument for exposing directly.
> 
> The argument against is that slf4j's API sucks... though it sucks less than
> any other logging api out there at the moment... there are still issues
> with it ;-)

I think it's the best and most reasonable choice which is why I added it. With the funnel support and being able to pick any default implementation I think it satisfies core requirements and is helpful for extensions.

> 
> 
>> 
>> LieGrue,
>> strub
>> 
>> 
>>> ________________________________
>>> From: Stephen Connolly <st...@gmail.com>
>>> To: Maven Developers List <de...@maven.apache.org>; Mark Struberg <
>> struberg@yahoo.de>
>>> Sent: Monday, September 3, 2012 10:42 AM
>>> Subject: Re: svn commit: r1380105 - in /maven/maven-3/trunk: ./
>> apache-maven/ maven-core/src/main/java/org/apache/maven/classrealm/
>> maven-embedder/ maven-embedder/src/main/java/org/apache/maven/cli/
>>> 
>>> 
>>> I'm not seeing log4j-over-slf4j in the dependency tree there at all... so
>> where is the bridge?
>>> 
>>> 
>>> On 3 September 2012 08:10, Mark Struberg <st...@yahoo.de> wrote:
>>> 
>>> whats the reason for the slf4j bridge?
>>>> 
>>>> This is kown to trash old plugins which use log4j because it clashes
>> with it's namespace and only partly implements the log4j classes.
>>>> 
>>>> I personally ind slf4j nice, but for older projects which use
>> commons-logging or log4j already (and where you cant fiddle around with
>> their sources) this broke way too many things for me.
>>>> Why is this needed at all? Has nothing to do with JSR-330.
>>>> 
>>>> LieGrue,
>>>> strub
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> ----- Original Message -----
>>>>> From: "jvanzyl@apache.org" <jv...@apache.org>
>>>>> To: commits@maven.apache.org
>>>>> Cc:
>>>>> Sent: Monday, September 3, 2012 3:07 AM
>>>>> Subject: svn commit: r1380105 - in /maven/maven-3/trunk: ./
>> apache-maven/ maven-core/src/main/java/org/apache/maven/classrealm/
>> maven-embedder/ maven-embedder/src/main/java/org/apache/maven/cli/
>>>>> 
>>>>> Author: jvanzyl
>>>>> Date: Mon Sep  3 01:07:31 2012
>>>>> New Revision: 1380105
>>>>> 
>>>>> URL: http://svn.apache.org/viewvc?rev=1380105&view=rev
>>>>> Log:
>>>>> o Enabled support and discovery of JSR-330 components
>>>>> 
>>>>> o Added Slf4j logger factory to support generic JSR-330 logging
>>>>> 
>>>>> o Exported Guice package for components that access Guice (or better
>> it's
>>>>> injector) directly
>>>>> 
>>>>> Widen export of Guice packages (not ideal, need to look into ways to
>> avoid this)
>>>>> 
>>>>> o use specific exports
>>>>> 
>>>>> o for now we will attempt to hide all of Guice in plugin realms and
>> we'll do
>>>>> a bit of testing
>>>>> 
>>>>> closes #3
>>>>> 
>>>>> Added:
>>>>> 
>>>>> 
>> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLogger.java
>>>>> 
>>>>> 
>> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLoggerFactory.java
>>>>> Modified:
>>>>>    maven/maven-3/trunk/apache-maven/pom.xml
>>>>> 
>>>>> 
>> maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java
>>>>>    maven/maven-3/trunk/maven-embedder/pom.xml
>>>>> 
>>>>> 
>> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
>>>>>    maven/maven-3/trunk/pom.xml
>>>>> 
>>>>> Modified: maven/maven-3/trunk/apache-maven/pom.xml
>>>>> URL:
>>>>> 
>> http://svn.apache.org/viewvc/maven/maven-3/trunk/apache-maven/pom.xml?rev=1380105&r1=1380104&r2=1380105&view=diff
>>>>> 
>> ==============================================================================
>>>>> --- maven/maven-3/trunk/apache-maven/pom.xml (original)
>>>>> +++ maven/maven-3/trunk/apache-maven/pom.xml Mon Sep  3 01:07:31 2012
>>>>> @@ -83,6 +83,10 @@
>>>>>       <groupId>org.sonatype.aether</groupId>
>>>>>       <artifactId>aether-connector-wagon</artifactId>
>>>>>     </dependency>
>>>>> +    <dependency>
>>>>> +      <groupId>org.slf4j</groupId>
>>>>> +      <artifactId>slf4j-nop</artifactId>
>>>>> +    </dependency>
>>>>>   </dependencies>
>>>>> 
>>>>>   <build>
>>>>> 
>>>>> Modified:
>>>>> 
>> maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java
>>>>> URL:
>>>>> 
>> http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java?rev=1380105&r1=1380104&r2=1380105&view=diff
>>>>> 
>> ==============================================================================
>>>>> ---
>>>>> 
>> maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java
>>>>> (original)
>>>>> +++
>>>>> 
>> maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java
>>>>> Mon Sep  3 01:07:31 2012
>>>>> @@ -198,6 +198,26 @@ public class DefaultClassRealmManager
>>>>>         imports.put(
>>>>> "org.codehaus.plexus.util.xml.pull.XmlPullParser", coreRealm );
>>>>>         imports.put(
>>>>> "org.codehaus.plexus.util.xml.pull.XmlPullParserException", coreRealm
>>>>> );
>>>>>         imports.put(
>>>>> "org.codehaus.plexus.util.xml.pull.XmlSerializer", coreRealm );
>>>>> +
>>>>> +        // javax.inject, sisu-inject (JSR-330)
>>>>> +        imports.put( "javax.inject.*", coreRealm );
>>>>> +        imports.put( "javax.enterprise.inject.*", coreRealm );
>>>>> +        imports.put( "org.sonatype.inject.*", coreRealm );
>>>>> +        imports.put( "org.slf4j.*", coreRealm );
>>>>> +
>>>>> +        // com.google
>>>>> +        //
>>>>> +        // We may potentially want to export these, but right now I'm
>> not
>>>>> sure that anything Guice specific needs
>>>>> +        // to be made available to plugin authors. If we find people
>> are
>>>>> getting fancy and want to take advantage
>>>>> +        // of Guice specifics we can expose that later. Really some
>> testing
>>>>> needs to be done to see full hiding
>>>>> +        // of Guice has any impact on what we may categorize as a
>> standard
>>>>> JSR-330 based Tesla/Maven plugin.
>>>>> +        //
>>>>> +        // imports.put( "com.google.inject.*", coreRealm );
>>>>> +        // imports.put( "com.google.inject.binder.*", coreRealm );
>>>>> +        // imports.put( "com.google.inject.matcher.*", coreRealm );
>>>>> +        // imports.put( "com.google.inject.name.*", coreRealm );
>>>>> +        // imports.put( "com.google.inject.spi.*", coreRealm );
>>>>> +        // imports.put( "com.google.inject.util.*", coreRealm );
>>>>>     }
>>>>> 
>>>>>     /**
>>>>> 
>>>>> Modified: maven/maven-3/trunk/maven-embedder/pom.xml
>>>>> URL:
>>>>> 
>> http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-embedder/pom.xml?rev=1380105&r1=1380104&r2=1380105&view=diff
>>>>> 
>> ==============================================================================
>>>>> --- maven/maven-3/trunk/maven-embedder/pom.xml (original)
>>>>> +++ maven/maven-3/trunk/maven-embedder/pom.xml Mon Sep  3 01:07:31 2012
>>>>> @@ -70,6 +70,10 @@
>>>>>       <groupId>org.sonatype.plexus</groupId>
>>>>>       <artifactId>plexus-cipher</artifactId>
>>>>>     </dependency>
>>>>> +    <dependency>
>>>>> +      <groupId>org.slf4j</groupId>
>>>>> +      <artifactId>slf4j-api</artifactId>
>>>>> +    </dependency>
>>>>>     <!-- CLI -->
>>>>>     <dependency>
>>>>>       <groupId>commons-cli</groupId>
>>>>> 
>>>>> Modified:
>>>>> 
>> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
>>>>> URL:
>>>>> 
>> http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java?rev=1380105&r1=1380104&r2=1380105&view=diff
>>>>> 
>> ==============================================================================
>>>>> ---
>>>>> 
>> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
>>>>> (original)
>>>>> +++
>>>>> 
>> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
>>>>> Mon Sep  3 01:07:31 2012
>>>>> @@ -59,12 +59,14 @@ import org.apache.maven.settings.buildin
>>>>> import org.codehaus.plexus.ContainerConfiguration;
>>>>> import org.codehaus.plexus.DefaultContainerConfiguration;
>>>>> import org.codehaus.plexus.DefaultPlexusContainer;
>>>>> +import org.codehaus.plexus.PlexusConstants;
>>>>> import org.codehaus.plexus.PlexusContainer;
>>>>> import org.codehaus.plexus.classworlds.ClassWorld;
>>>>> import org.codehaus.plexus.classworlds.realm.ClassRealm;
>>>>> import
>>>>> 
>> org.codehaus.plexus.component.repository.exception.ComponentLookupException;
>>>>> import org.codehaus.plexus.logging.Logger;
>>>>> import org.codehaus.plexus.util.StringUtils;
>>>>> +import org.slf4j.ILoggerFactory;
>>>>> import org.sonatype.aether.transfer.TransferListener;
>>>>> import org.sonatype.plexus.components.cipher.DefaultPlexusCipher;
>>>>> import
>> org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher;
>>>>> @@ -72,6 +74,8 @@ import org.sonatype.plexus.components.se
>>>>> import org.sonatype.plexus.components.sec.dispatcher.SecUtil;
>>>>> import
>> org.sonatype.plexus.components.sec.dispatcher.model.SettingsSecurity;
>>>>> 
>>>>> +import com.google.inject.AbstractModule;
>>>>> +
>>>>> // TODO: push all common bits back to plexus cli and prepare for
>> transition to
>>>>> Guice. We don't need 50 ways to make CLIs
>>>>> 
>>>>> /**
>>>>> @@ -372,17 +376,29 @@ public class MavenCli
>>>>>         {
>>>>>             logger = setupLogger( cliRequest );
>>>>> 
>>>>> +            final MavenLoggerManager loggerManager = new
>> MavenLoggerManager(
>>>>> logger ) ;
>>>>> +
>>>>>             ContainerConfiguration cc = new
>> DefaultContainerConfiguration()
>>>>>                 .setClassWorld( cliRequest.classWorld )
>>>>>                 .setRealm( setupContainerRealm( cliRequest ) )
>>>>> +                .setClassPathScanning( PlexusConstants.SCANNING_INDEX
>> )
>>>>> +                .setAutoWiring( true )
>>>>>                 .setName( "maven" );
>>>>> 
>>>>> -            container = new DefaultPlexusContainer( cc );
>>>>> +            container = new DefaultPlexusContainer( cc, new
>> AbstractModule()
>>>>> +            {
>>>>> +
>>>>> +                protected void configure()
>>>>> +                {
>>>>> +                    bind( ILoggerFactory.class ).toInstance( new
>>>>> PlexusLoggerFactory( loggerManager ) );
>>>>> +                }
>>>>> +
>>>>> +            } );
>>>>> 
>>>>>             // NOTE: To avoid inconsistencies, we'll use the TCCL
>>>>> exclusively for lookups
>>>>>             container.setLookupRealm( null );
>>>>> 
>>>>> -            container.setLoggerManager( new MavenLoggerManager(
>> logger ) );
>>>>> +            container.setLoggerManager( loggerManager );
>>>>> 
>>>>>             customizeContainer( container );
>>>>> 
>>>>> 
>>>>> Added:
>>>>> 
>> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLogger.java
>>>>> URL:
>>>>> 
>> http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLogger.java?rev=1380105&view=auto
>>>>> 
>> ==============================================================================
>>>>> ---
>>>>> 
>> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLogger.java
>>>>> (added)
>>>>> +++
>>>>> 
>> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLogger.java
>>>>> Mon Sep  3 01:07:31 2012
>>>>> @@ -0,0 +1,358 @@
>>>>> +package org.apache.maven.cli;
>>>>> +
>>>>> +/*
>>>>> + * Licensed to the Apache Software Foundation (ASF) under one
>>>>> + * or more contributor license agreements.  See the NOTICE file
>>>>> + * distributed with this work for additional information
>>>>> + * regarding copyright ownership.  The ASF licenses this file
>>>>> + * to you under the Apache License, Version 2.0 (the
>>>>> + * "License"); you may not use this file except in compliance
>>>>> + * with the License.  You may obtain a copy of the License at
>>>>> + *
>>>>> + *  http://www.apache.org/licenses/LICENSE-2.0
>>>>> + *
>>>>> + * Unless required by applicable law or agreed to in writing,
>>>>> + * software distributed under the License is distributed on an
>>>>> + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>>>>> + * KIND, either express or implied.  See the License for the
>>>>> + * specific language governing permissions and limitations
>>>>> + * under the License.
>>>>> + */
>>>>> +
>>>>> +import org.slf4j.Logger;
>>>>> +import org.slf4j.Marker;
>>>>> +import org.slf4j.helpers.FormattingTuple;
>>>>> +import org.slf4j.helpers.MessageFormatter;
>>>>> +
>>>>> +/**
>>>>> + * A Slf4j logger bridged onto a Plexus logger.
>>>>> + */
>>>>> +class PlexusLogger
>>>>> +    implements Logger
>>>>> +{
>>>>> +
>>>>> +    private final org.codehaus.plexus.logging.Logger logger;
>>>>> +
>>>>> +    public PlexusLogger( org.codehaus.plexus.logging.Logger logger )
>>>>> +    {
>>>>> +        this.logger = logger;
>>>>> +    }
>>>>> +
>>>>> +    public String getName()
>>>>> +    {
>>>>> +        return logger.getName();
>>>>> +    }
>>>>> +
>>>>> +    public boolean isTraceEnabled()
>>>>> +    {
>>>>> +        return isDebugEnabled();
>>>>> +    }
>>>>> +
>>>>> +    public void trace( String msg )
>>>>> +    {
>>>>> +        debug( msg );
>>>>> +    }
>>>>> +
>>>>> +    public void trace( String format, Object arg )
>>>>> +    {
>>>>> +        debug( format, arg );
>>>>> +    }
>>>>> +
>>>>> +    public void trace( String format, Object arg1, Object arg2 )
>>>>> +    {
>>>>> +        debug( format, arg1, arg2 );
>>>>> +    }
>>>>> +
>>>>> +    public void trace( String format, Object[] argArray )
>>>>> +    {
>>>>> +        debug( format, argArray );
>>>>> +    }
>>>>> +
>>>>> +    public void trace( String msg, Throwable t )
>>>>> +    {
>>>>> +        debug( msg, t );
>>>>> +    }
>>>>> +
>>>>> +    public boolean isTraceEnabled( Marker marker )
>>>>> +    {
>>>>> +        return isTraceEnabled();
>>>>> +    }
>>>>> +
>>>>> +    public void trace( Marker marker, String msg )
>>>>> +    {
>>>>> +        trace( msg );
>>>>> +    }
>>>>> +
>>>>> +    public void trace( Marker marker, String format, Object arg )
>>>>> +    {
>>>>> +        trace( format, arg );
>>>>> +    }
>>>>> +
>>>>> +    public void trace( Marker marker, String format, Object arg1,
>> Object arg2 )
>>>>> +    {
>>>>> +        trace( format, arg1, arg2 );
>>>>> +    }
>>>>> +
>>>>> +    public void trace( Marker marker, String format, Object[]
>> argArray )
>>>>> +    {
>>>>> +        trace( format, argArray );
>>>>> +    }
>>>>> +
>>>>> +    public void trace( Marker marker, String msg, Throwable t )
>>>>> +    {
>>>>> +        trace( msg, t );
>>>>> +    }
>>>>> +
>>>>> +    public boolean isDebugEnabled()
>>>>> +    {
>>>>> +        return logger.isDebugEnabled();
>>>>> +    }
>>>>> +
>>>>> +    public void debug( String msg )
>>>>> +    {
>>>>> +        logger.debug( msg );
>>>>> +    }
>>>>> +
>>>>> +    public void debug( String format, Object arg )
>>>>> +    {
>>>>> +        FormattingTuple ft = MessageFormatter.format( format, arg );
>>>>> +        logger.debug( ft.getMessage(), ft.getThrowable() );
>>>>> +    }
>>>>> +
>>>>> +    public void debug( String format, Object arg1, Object arg2 )
>>>>> +    {
>>>>> +        FormattingTuple ft = MessageFormatter.format( format, arg1,
>> arg2 );
>>>>> +        logger.debug( ft.getMessage(), ft.getThrowable() );
>>>>> +    }
>>>>> +
>>>>> +    public void debug( String format, Object[] argArray )
>>>>> +    {
>>>>> +        FormattingTuple ft = MessageFormatter.arrayFormat( format,
>> argArray );
>>>>> +        logger.debug( ft.getMessage(), ft.getThrowable() );
>>>>> +    }
>>>>> +
>>>>> +    public void debug( String msg, Throwable t )
>>>>> +    {
>>>>> +        logger.debug( msg, t );
>>>>> +    }
>>>>> +
>>>>> +    public boolean isDebugEnabled( Marker marker )
>>>>> +    {
>>>>> +        return isDebugEnabled();
>>>>> +    }
>>>>> +
>>>>> +    public void debug( Marker marker, String msg )
>>>>> +    {
>>>>> +        debug( msg );
>>>>> +    }
>>>>> +
>>>>> +    public void debug( Marker marker, String format, Object arg )
>>>>> +    {
>>>>> +        debug( format, arg );
>>>>> +    }
>>>>> +
>>>>> +    public void debug( Marker marker, String format, Object arg1,
>> Object arg2 )
>>>>> +    {
>>>>> +        debug( format, arg1, arg2 );
>>>>> +    }
>>>>> +
>>>>> +    public void debug( Marker marker, String format, Object[]
>> argArray )
>>>>> +    {
>>>>> +        debug( format, argArray );
>>>>> +    }
>>>>> +
>>>>> +    public void debug( Marker marker, String msg, Throwable t )
>>>>> +    {
>>>>> +        debug( msg, t );
>>>>> +    }
>>>>> +
>>>>> +    public boolean isInfoEnabled()
>>>>> +    {
>>>>> +        return logger.isInfoEnabled();
>>>>> +    }
>>>>> +
>>>>> +    public void info( String msg )
>>>>> +    {
>>>>> +        logger.info( msg );
>>>>> +    }
>>>>> +
>>>>> +    public void info( String format, Object arg )
>>>>> +    {
>>>>> +        FormattingTuple ft = MessageFormatter.format( format, arg );
>>>>> +        logger.info( ft.getMessage(), ft.getThrowable() );
>>>>> +    }
>>>>> +
>>>>> +    public void info( String format, Object arg1, Object arg2 )
>>>>> +    {
>>>>> +        FormattingTuple ft = MessageFormatter.format( format, arg1,
>> arg2 );
>>>>> +        logger.info( ft.getMessage(), ft.getThrowable() );
>>>>> +    }
>>>>> +
>>>>> +    public void info( String format, Object[] argArray )
>>>>> +    {
>>>>> +        FormattingTuple ft = MessageFormatter.arrayFormat( format,
>> argArray );
>>>>> +        logger.info( ft.getMessage(), ft.getThrowable() );
>>>>> +    }
>>>>> +
>>>>> +    public void info( String msg, Throwable t )
>>>>> +    {
>>>>> +        logger.info( msg, t );
>>>>> +    }
>>>>> +
>>>>> +    public boolean isInfoEnabled( Marker marker )
>>>>> +    {
>>>>> +        return isInfoEnabled();
>>>>> +    }
>>>>> +
>>>>> +    public void info( Marker marker, String msg )
>>>>> +    {
>>>>> +        info( msg );
>>>>> +    }
>>>>> +
>>>>> +    public void info( Marker marker, String format, Object arg )
>>>>> +    {
>>>>> +        info( format, arg );
>>>>> +    }
>>>>> +
>>>>> +    public void info( Marker marker, String format, Object arg1,
>> Object arg2 )
>>>>> +    {
>>>>> +        info( format, arg1, arg2 );
>>>>> +    }
>>>>> +
>>>>> +    public void info( Marker marker, String format, Object[] argArray
>> )
>>>>> +    {
>>>>> +        info( format, argArray );
>>>>> +    }
>>>>> +
>>>>> +    public void info( Marker marker, String msg, Throwable t )
>>>>> +    {
>>>>> +        info( msg, t );
>>>>> +    }
>>>>> +
>>>>> +    public boolean isWarnEnabled()
>>>>> +    {
>>>>> +        return logger.isWarnEnabled();
>>>>> +    }
>>>>> +
>>>>> +    public void warn( String msg )
>>>>> +    {
>>>>> +        logger.warn( msg );
>>>>> +    }
>>>>> +
>>>>> +    public void warn( String format, Object arg )
>>>>> +    {
>>>>> +        FormattingTuple ft = MessageFormatter.format( format, arg );
>>>>> +        logger.warn( ft.getMessage(), ft.getThrowable() );
>>>>> +    }
>>>>> +
>>>>> +    public void warn( String format, Object arg1, Object arg2 )
>>>>> +    {
>>>>> +        FormattingTuple ft = MessageFormatter.format( format, arg1,
>> arg2 );
>>>>> +        logger.warn( ft.getMessage(), ft.getThrowable() );
>>>>> +    }
>>>>> +
>>>>> +    public void warn( String format, Object[] argArray )
>>>>> +    {
>>>>> +        FormattingTuple ft = MessageFormatter.arrayFormat( format,
>> argArray );
>>>>> +        logger.warn( ft.getMessage(), ft.getThrowable() );
>>>>> +    }
>>>>> +
>>>>> +    public void warn( String msg, Throwable t )
>>>>> +    {
>>>>> +        logger.warn( msg, t );
>>>>> +    }
>>>>> +
>>>>> +    public boolean isWarnEnabled( Marker marker )
>>>>> +    {
>>>>> +        return isWarnEnabled();
>>>>> +    }
>>>>> +
>>>>> +    public void warn( Marker marker, String msg )
>>>>> +    {
>>>>> +        warn( msg );
>>>>> +    }
>>>>> +
>>>>> +    public void warn( Marker marker, String format, Object arg )
>>>>> +    {
>>>>> +        warn( format, arg );
>>>>> +    }
>>>>> +
>>>>> +    public void warn( Marker marker, String format, Object arg1,
>> Object arg2 )
>>>>> +    {
>>>>> +        warn( format, arg1, arg2 );
>>>>> +    }
>>>>> +
>>>>> +    public void warn( Marker marker, String format, Object[] argArray
>> )
>>>>> +    {
>>>>> +        warn( format, argArray );
>>>>> +    }
>>>>> +
>>>>> +    public void warn( Marker marker, String msg, Throwable t )
>>>>> +    {
>>>>> +        warn( msg, t );
>>>>> +    }
>>>>> +
>>>>> +    public boolean isErrorEnabled()
>>>>> +    {
>>>>> +        return logger.isErrorEnabled();
>>>>> +    }
>>>>> +
>>>>> +    public void error( String msg )
>>>>> +    {
>>>>> +        logger.error( msg );
>>>>> +    }
>>>>> +
>>>>> +    public void error( String format, Object arg )
>>>>> +    {
>>>>> +        FormattingTuple ft = MessageFormatter.format( format, arg );
>>>>> +        logger.error( ft.getMessage(), ft.getThrowable() );
>>>>> +    }
>>>>> +
>>>>> +    public void error( String format, Object arg1, Object arg2 )
>>>>> +    {
>>>>> +        FormattingTuple ft = MessageFormatter.format( format, arg1,
>> arg2 );
>>>>> +        logger.error( ft.getMessage(), ft.getThrowable() );
>>>>> +    }
>>>>> +
>>>>> +    public void error( String format, Object[] argArray )
>>>>> +    {
>>>>> +        FormattingTuple ft = MessageFormatter.arrayFormat( format,
>> argArray );
>>>>> +        logger.error( ft.getMessage(), ft.getThrowable() );
>>>>> +    }
>>>>> +
>>>>> +    public void error( String msg, Throwable t )
>>>>> +    {
>>>>> +        logger.error( msg, t );
>>>>> +    }
>>>>> +
>>>>> +    public boolean isErrorEnabled( Marker marker )
>>>>> +    {
>>>>> +        return isErrorEnabled();
>>>>> +    }
>>>>> +
>>>>> +    public void error( Marker marker, String msg )
>>>>> +    {
>>>>> +        error( msg );
>>>>> +    }
>>>>> +
>>>>> +    public void error( Marker marker, String format, Object arg )
>>>>> +    {
>>>>> +        error( format, arg );
>>>>> +    }
>>>>> +
>>>>> +    public void error( Marker marker, String format, Object arg1,
>> Object arg2 )
>>>>> +    {
>>>>> +        error( format, arg1, arg2 );
>>>>> +    }
>>>>> +
>>>>> +    public void error( Marker marker, String format, Object[]
>> argArray )
>>>>> +    {
>>>>> +        error( format, argArray );
>>>>> +    }
>>>>> +
>>>>> +    public void error( Marker marker, String msg, Throwable t )
>>>>> +    {
>>>>> +        error( msg, t );
>>>>> +    }
>>>>> +
>>>>> +}
>>>>> 
>>>>> Added:
>>>>> 
>> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLoggerFactory.java
>>>>> URL:
>>>>> 
>> http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLoggerFactory.java?rev=1380105&view=auto
>>>>> 
>> ==============================================================================
>>>>> ---
>>>>> 
>> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLoggerFactory.java
>>>>> (added)
>>>>> +++
>>>>> 
>> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLoggerFactory.java
>>>>> Mon Sep  3 01:07:31 2012
>>>>> @@ -0,0 +1,50 @@
>>>>> +package org.apache.maven.cli;
>>>>> +
>>>>> +/*
>>>>> + * Licensed to the Apache Software Foundation (ASF) under one
>>>>> + * or more contributor license agreements.  See the NOTICE file
>>>>> + * distributed with this work for additional information
>>>>> + * regarding copyright ownership.  The ASF licenses this file
>>>>> + * to you under the Apache License, Version 2.0 (the
>>>>> + * "License"); you may not use this file except in compliance
>>>>> + * with the License.  You may obtain a copy of the License at
>>>>> + *
>>>>> + *  http://www.apache.org/licenses/LICENSE-2.0
>>>>> + *
>>>>> + * Unless required by applicable law or agreed to in writing,
>>>>> + * software distributed under the License is distributed on an
>>>>> + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>>>>> + * KIND, either express or implied.  See the License for the
>>>>> + * specific language governing permissions and limitations
>>>>> + * under the License.
>>>>> + */
>>>>> +
>>>>> +import org.codehaus.plexus.logging.LoggerManager;
>>>>> +import org.slf4j.ILoggerFactory;
>>>>> +import org.slf4j.Logger;
>>>>> +
>>>>> +/**
>>>>> + * A Slf4j logger factory bridged onto a Plexus logger manager.
>>>>> + */
>>>>> +public class PlexusLoggerFactory
>>>>> +    implements ILoggerFactory
>>>>> +{
>>>>> +
>>>>> +    private LoggerManager loggerManager;
>>>>> +
>>>>> +    public PlexusLoggerFactory( LoggerManager loggerManager )
>>>>> +    {
>>>>> +        this.loggerManager = loggerManager;
>>>>> +    }
>>>>> +
>>>>> +    public void setLoggerManager( LoggerManager loggerManager )
>>>>> +    {
>>>>> +        this.loggerManager = loggerManager;
>>>>> +    }
>>>>> +
>>>>> +    public Logger getLogger( String name )
>>>>> +    {
>>>>> +        return new PlexusLogger( loggerManager.getLoggerForComponent(
>> name,
>>>>> null ) );
>>>>> +    }
>>>>> +
>>>>> +}
>>>>> 
>>>>> Modified: maven/maven-3/trunk/pom.xml
>>>>> URL:
>>>>> 
>> http://svn.apache.org/viewvc/maven/maven-3/trunk/pom.xml?rev=1380105&r1=1380104&r2=1380105&view=diff
>>>>> 
>> ==============================================================================
>>>>> --- maven/maven-3/trunk/pom.xml (original)
>>>>> +++ maven/maven-3/trunk/pom.xml Mon Sep  3 01:07:31 2012
>>>>> @@ -56,6 +56,7 @@
>>>>>     <modelloVersion>1.4.1</modelloVersion>
>>>>>     <jxpathVersion>1.3</jxpathVersion>
>>>>>     <aetherVersion>1.13.1</aetherVersion>
>>>>> +    <slf4jVersion>1.6.1</slf4jVersion>
>>>>> 
>>>>> 
>> <maven.test.redirectTestOutputToFile>true</maven.test.redirectTestOutputToFile>
>>>>>     <!-- Control the name of the distribution and information output
>> by mvn
>>>>> -->
>>>>>     <distributionId>apache-maven</distributionId>
>>>>> @@ -203,6 +204,17 @@
>>>>>         <artifactId>plexus-interpolation</artifactId>
>>>>>         <version>${plexusInterpolationVersion}</version>
>>>>>       </dependency>
>>>>> +      <dependency>
>>>>> +        <groupId>org.slf4j</groupId>
>>>>> +        <artifactId>slf4j-api</artifactId>
>>>>> +        <version>${slf4jVersion}</version>
>>>>> +      </dependency>
>>>>> +      <dependency>
>>>>> +        <groupId>org.slf4j</groupId>
>>>>> +        <artifactId>slf4j-nop</artifactId>
>>>>> +        <version>${slf4jVersion}</version>
>>>>> +        <scope>runtime</scope>
>>>>> +      </dependency>
>>>>>       <!--  Wagon -->
>>>>>       <dependency>
>>>>>         <groupId>org.apache.maven.wagon</groupId>
>>>>> 
>>>> 
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>>>> For additional commands, e-mail: dev-help@maven.apache.org
>>>> 
>>>> 
>>> 
>>> 
>>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>> 
>> 

Thanks,

Jason

----------------------------------------------------------
Jason van Zyl
Founder & CTO, Sonatype
Founder,  Apache Maven
http://twitter.com/jvanzyl
---------------------------------------------------------

I never make the mistake of arguing with people for whose opinions I have no respect.

-- Edward Gibbon






Re: svn commit: r1380105 - in /maven/maven-3/trunk: ./ apache-maven/ maven-core/src/main/java/org/apache/maven/classrealm/ maven-embedder/ maven-embedder/src/main/java/org/apache/maven/cli/

Posted by Stephen Connolly <st...@gmail.com>.
On 3 September 2012 09:59, Mark Struberg <st...@yahoo.de> wrote:

>
> > imports.put( "org.slf4j.*", coreRealm );
>
> To me this looks like any org.slf4j sub package would be exported.
>

slf4j is such a ubiquitous logging framework that it seems to me that it
would make sense to allow any plugins that have dependencies that use slf4j
to log through to maven.


>
> The whole goal of org.codehaus.plexus.logging.Logger was to shield the
> user from ANY specific logging framework. That way we could back the plexus
> Logger with any implementation the user wants.
>
>
> We already HAVE a logging bridge. Imo there is just no need to introduce
> another one!
>

That is fine for plugin code, but why should *everyone* else have to
rewrite the same bridge from slf4j to our logging bridge?

And then that bridge routes back to slf4j?


> To kind of hardcode this now to slf4j is frankly speaking nonsense imo.
>
>
Perhaps. I have concerns about slf4j API stability having seen some issues
with slf4j 1.5 vs 1.6 which I resolved and forgot about. A simpler approach
would be to produce a bridge dependency: slf4j-maven so that everyone that
has dependencies that use slf4j can trivially route their dependency
logging through to maven


> But maybe I just missed the point? What is the reason for it?
>
>
Consider jetty:run... jetty sends its logging to slf4j... so to play
properly the plugin *should* be picking up those logs and routing them
through to Maven so that Maven's logging controls can correctly filter the
logs... now tomcat:run needs to do the same, etc....

There is logging bridge madness all over the shop.

Logging bridges should be as close to the logger as possible, especially in
a short lived tool such as Maven, where the JVM may not have had a chance
to optimize out the bridge.

For server classes such as, e.g. MyFaces, the use of a bridge is less of an
issue as the JVM will optimize it out of the code since there is only one
trivial implementation and that can be in-lined and reduced away to a
direct call.

But a build tool that is invoking other 3rd party libs on a short lived
lifecycle will have a performance hit for the logging calls.

That is the argument for exposing directly.

The argument against is that slf4j's API sucks... though it sucks less than
any other logging api out there at the moment... there are still issues
with it ;-)


>
> LieGrue,
> strub
>
>
> >________________________________
> > From: Stephen Connolly <st...@gmail.com>
> >To: Maven Developers List <de...@maven.apache.org>; Mark Struberg <
> struberg@yahoo.de>
> >Sent: Monday, September 3, 2012 10:42 AM
> >Subject: Re: svn commit: r1380105 - in /maven/maven-3/trunk: ./
> apache-maven/ maven-core/src/main/java/org/apache/maven/classrealm/
> maven-embedder/ maven-embedder/src/main/java/org/apache/maven/cli/
> >
> >
> >I'm not seeing log4j-over-slf4j in the dependency tree there at all... so
> where is the bridge?
> >
> >
> >On 3 September 2012 08:10, Mark Struberg <st...@yahoo.de> wrote:
> >
> >whats the reason for the slf4j bridge?
> >>
> >>This is kown to trash old plugins which use log4j because it clashes
> with it's namespace and only partly implements the log4j classes.
> >>
> >>I personally ind slf4j nice, but for older projects which use
> commons-logging or log4j already (and where you cant fiddle around with
> their sources) this broke way too many things for me.
> >>Why is this needed at all? Has nothing to do with JSR-330.
> >>
> >>LieGrue,
> >>strub
> >>
> >>
> >>
> >>
> >>
> >>----- Original Message -----
> >>> From: "jvanzyl@apache.org" <jv...@apache.org>
> >>> To: commits@maven.apache.org
> >>> Cc:
> >>> Sent: Monday, September 3, 2012 3:07 AM
> >>> Subject: svn commit: r1380105 - in /maven/maven-3/trunk: ./
> apache-maven/ maven-core/src/main/java/org/apache/maven/classrealm/
> maven-embedder/ maven-embedder/src/main/java/org/apache/maven/cli/
> >>>
> >>> Author: jvanzyl
> >>> Date: Mon Sep  3 01:07:31 2012
> >>> New Revision: 1380105
> >>>
> >>> URL: http://svn.apache.org/viewvc?rev=1380105&view=rev
> >>> Log:
> >>> o Enabled support and discovery of JSR-330 components
> >>>
> >>> o Added Slf4j logger factory to support generic JSR-330 logging
> >>>
> >>> o Exported Guice package for components that access Guice (or better
> it's
> >>> injector) directly
> >>>
> >>> Widen export of Guice packages (not ideal, need to look into ways to
> avoid this)
> >>>
> >>> o use specific exports
> >>>
> >>> o for now we will attempt to hide all of Guice in plugin realms and
> we'll do
> >>> a bit of testing
> >>>
> >>> closes #3
> >>>
> >>> Added:
> >>>
> >>>
> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLogger.java
> >>>
> >>>
> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLoggerFactory.java
> >>> Modified:
> >>>     maven/maven-3/trunk/apache-maven/pom.xml
> >>>
> >>>
> maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java
> >>>     maven/maven-3/trunk/maven-embedder/pom.xml
> >>>
> >>>
> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
> >>>     maven/maven-3/trunk/pom.xml
> >>>
> >>> Modified: maven/maven-3/trunk/apache-maven/pom.xml
> >>> URL:
> >>>
> http://svn.apache.org/viewvc/maven/maven-3/trunk/apache-maven/pom.xml?rev=1380105&r1=1380104&r2=1380105&view=diff
> >>>
> ==============================================================================
> >>> --- maven/maven-3/trunk/apache-maven/pom.xml (original)
> >>> +++ maven/maven-3/trunk/apache-maven/pom.xml Mon Sep  3 01:07:31 2012
> >>> @@ -83,6 +83,10 @@
> >>>        <groupId>org.sonatype.aether</groupId>
> >>>        <artifactId>aether-connector-wagon</artifactId>
> >>>      </dependency>
> >>> +    <dependency>
> >>> +      <groupId>org.slf4j</groupId>
> >>> +      <artifactId>slf4j-nop</artifactId>
> >>> +    </dependency>
> >>>    </dependencies>
> >>>
> >>>    <build>
> >>>
> >>> Modified:
> >>>
> maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java
> >>> URL:
> >>>
> http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java?rev=1380105&r1=1380104&r2=1380105&view=diff
> >>>
> ==============================================================================
> >>> ---
> >>>
> maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java
> >>> (original)
> >>> +++
> >>>
> maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java
> >>> Mon Sep  3 01:07:31 2012
> >>> @@ -198,6 +198,26 @@ public class DefaultClassRealmManager
> >>>          imports.put(
> >>> "org.codehaus.plexus.util.xml.pull.XmlPullParser", coreRealm );
> >>>          imports.put(
> >>> "org.codehaus.plexus.util.xml.pull.XmlPullParserException", coreRealm
> >>> );
> >>>          imports.put(
> >>> "org.codehaus.plexus.util.xml.pull.XmlSerializer", coreRealm );
> >>> +
> >>> +        // javax.inject, sisu-inject (JSR-330)
> >>> +        imports.put( "javax.inject.*", coreRealm );
> >>> +        imports.put( "javax.enterprise.inject.*", coreRealm );
> >>> +        imports.put( "org.sonatype.inject.*", coreRealm );
> >>> +        imports.put( "org.slf4j.*", coreRealm );
> >>> +
> >>> +        // com.google
> >>> +        //
> >>> +        // We may potentially want to export these, but right now I'm
> not
> >>> sure that anything Guice specific needs
> >>> +        // to be made available to plugin authors. If we find people
> are
> >>> getting fancy and want to take advantage
> >>> +        // of Guice specifics we can expose that later. Really some
> testing
> >>> needs to be done to see full hiding
> >>> +        // of Guice has any impact on what we may categorize as a
> standard
> >>> JSR-330 based Tesla/Maven plugin.
> >>> +        //
> >>> +        // imports.put( "com.google.inject.*", coreRealm );
> >>> +        // imports.put( "com.google.inject.binder.*", coreRealm );
> >>> +        // imports.put( "com.google.inject.matcher.*", coreRealm );
> >>> +        // imports.put( "com.google.inject.name.*", coreRealm );
> >>> +        // imports.put( "com.google.inject.spi.*", coreRealm );
> >>> +        // imports.put( "com.google.inject.util.*", coreRealm );
> >>>      }
> >>>
> >>>      /**
> >>>
> >>> Modified: maven/maven-3/trunk/maven-embedder/pom.xml
> >>> URL:
> >>>
> http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-embedder/pom.xml?rev=1380105&r1=1380104&r2=1380105&view=diff
> >>>
> ==============================================================================
> >>> --- maven/maven-3/trunk/maven-embedder/pom.xml (original)
> >>> +++ maven/maven-3/trunk/maven-embedder/pom.xml Mon Sep  3 01:07:31 2012
> >>> @@ -70,6 +70,10 @@
> >>>        <groupId>org.sonatype.plexus</groupId>
> >>>        <artifactId>plexus-cipher</artifactId>
> >>>      </dependency>
> >>> +    <dependency>
> >>> +      <groupId>org.slf4j</groupId>
> >>> +      <artifactId>slf4j-api</artifactId>
> >>> +    </dependency>
> >>>      <!-- CLI -->
> >>>      <dependency>
> >>>        <groupId>commons-cli</groupId>
> >>>
> >>> Modified:
> >>>
> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
> >>> URL:
> >>>
> http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java?rev=1380105&r1=1380104&r2=1380105&view=diff
> >>>
> ==============================================================================
> >>> ---
> >>>
> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
> >>> (original)
> >>> +++
> >>>
> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
> >>> Mon Sep  3 01:07:31 2012
> >>> @@ -59,12 +59,14 @@ import org.apache.maven.settings.buildin
> >>> import org.codehaus.plexus.ContainerConfiguration;
> >>> import org.codehaus.plexus.DefaultContainerConfiguration;
> >>> import org.codehaus.plexus.DefaultPlexusContainer;
> >>> +import org.codehaus.plexus.PlexusConstants;
> >>> import org.codehaus.plexus.PlexusContainer;
> >>> import org.codehaus.plexus.classworlds.ClassWorld;
> >>> import org.codehaus.plexus.classworlds.realm.ClassRealm;
> >>> import
> >>>
> org.codehaus.plexus.component.repository.exception.ComponentLookupException;
> >>> import org.codehaus.plexus.logging.Logger;
> >>> import org.codehaus.plexus.util.StringUtils;
> >>> +import org.slf4j.ILoggerFactory;
> >>> import org.sonatype.aether.transfer.TransferListener;
> >>> import org.sonatype.plexus.components.cipher.DefaultPlexusCipher;
> >>> import
> org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher;
> >>> @@ -72,6 +74,8 @@ import org.sonatype.plexus.components.se
> >>> import org.sonatype.plexus.components.sec.dispatcher.SecUtil;
> >>> import
> org.sonatype.plexus.components.sec.dispatcher.model.SettingsSecurity;
> >>>
> >>> +import com.google.inject.AbstractModule;
> >>> +
> >>> // TODO: push all common bits back to plexus cli and prepare for
> transition to
> >>> Guice. We don't need 50 ways to make CLIs
> >>>
> >>> /**
> >>> @@ -372,17 +376,29 @@ public class MavenCli
> >>>          {
> >>>              logger = setupLogger( cliRequest );
> >>>
> >>> +            final MavenLoggerManager loggerManager = new
> MavenLoggerManager(
> >>> logger ) ;
> >>> +
> >>>              ContainerConfiguration cc = new
> DefaultContainerConfiguration()
> >>>                  .setClassWorld( cliRequest.classWorld )
> >>>                  .setRealm( setupContainerRealm( cliRequest ) )
> >>> +                .setClassPathScanning( PlexusConstants.SCANNING_INDEX
> )
> >>> +                .setAutoWiring( true )
> >>>                  .setName( "maven" );
> >>>
> >>> -            container = new DefaultPlexusContainer( cc );
> >>> +            container = new DefaultPlexusContainer( cc, new
> AbstractModule()
> >>> +            {
> >>> +
> >>> +                protected void configure()
> >>> +                {
> >>> +                    bind( ILoggerFactory.class ).toInstance( new
> >>> PlexusLoggerFactory( loggerManager ) );
> >>> +                }
> >>> +
> >>> +            } );
> >>>
> >>>              // NOTE: To avoid inconsistencies, we'll use the TCCL
> >>> exclusively for lookups
> >>>              container.setLookupRealm( null );
> >>>
> >>> -            container.setLoggerManager( new MavenLoggerManager(
> logger ) );
> >>> +            container.setLoggerManager( loggerManager );
> >>>
> >>>              customizeContainer( container );
> >>>
> >>>
> >>> Added:
> >>>
> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLogger.java
> >>> URL:
> >>>
> http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLogger.java?rev=1380105&view=auto
> >>>
> ==============================================================================
> >>> ---
> >>>
> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLogger.java
> >>> (added)
> >>> +++
> >>>
> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLogger.java
> >>> Mon Sep  3 01:07:31 2012
> >>> @@ -0,0 +1,358 @@
> >>> +package org.apache.maven.cli;
> >>> +
> >>> +/*
> >>> + * Licensed to the Apache Software Foundation (ASF) under one
> >>> + * or more contributor license agreements.  See the NOTICE file
> >>> + * distributed with this work for additional information
> >>> + * regarding copyright ownership.  The ASF licenses this file
> >>> + * to you under the Apache License, Version 2.0 (the
> >>> + * "License"); you may not use this file except in compliance
> >>> + * with the License.  You may obtain a copy of the License at
> >>> + *
> >>> + *  http://www.apache.org/licenses/LICENSE-2.0
> >>> + *
> >>> + * Unless required by applicable law or agreed to in writing,
> >>> + * software distributed under the License is distributed on an
> >>> + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> >>> + * KIND, either express or implied.  See the License for the
> >>> + * specific language governing permissions and limitations
> >>> + * under the License.
> >>> + */
> >>> +
> >>> +import org.slf4j.Logger;
> >>> +import org.slf4j.Marker;
> >>> +import org.slf4j.helpers.FormattingTuple;
> >>> +import org.slf4j.helpers.MessageFormatter;
> >>> +
> >>> +/**
> >>> + * A Slf4j logger bridged onto a Plexus logger.
> >>> + */
> >>> +class PlexusLogger
> >>> +    implements Logger
> >>> +{
> >>> +
> >>> +    private final org.codehaus.plexus.logging.Logger logger;
> >>> +
> >>> +    public PlexusLogger( org.codehaus.plexus.logging.Logger logger )
> >>> +    {
> >>> +        this.logger = logger;
> >>> +    }
> >>> +
> >>> +    public String getName()
> >>> +    {
> >>> +        return logger.getName();
> >>> +    }
> >>> +
> >>> +    public boolean isTraceEnabled()
> >>> +    {
> >>> +        return isDebugEnabled();
> >>> +    }
> >>> +
> >>> +    public void trace( String msg )
> >>> +    {
> >>> +        debug( msg );
> >>> +    }
> >>> +
> >>> +    public void trace( String format, Object arg )
> >>> +    {
> >>> +        debug( format, arg );
> >>> +    }
> >>> +
> >>> +    public void trace( String format, Object arg1, Object arg2 )
> >>> +    {
> >>> +        debug( format, arg1, arg2 );
> >>> +    }
> >>> +
> >>> +    public void trace( String format, Object[] argArray )
> >>> +    {
> >>> +        debug( format, argArray );
> >>> +    }
> >>> +
> >>> +    public void trace( String msg, Throwable t )
> >>> +    {
> >>> +        debug( msg, t );
> >>> +    }
> >>> +
> >>> +    public boolean isTraceEnabled( Marker marker )
> >>> +    {
> >>> +        return isTraceEnabled();
> >>> +    }
> >>> +
> >>> +    public void trace( Marker marker, String msg )
> >>> +    {
> >>> +        trace( msg );
> >>> +    }
> >>> +
> >>> +    public void trace( Marker marker, String format, Object arg )
> >>> +    {
> >>> +        trace( format, arg );
> >>> +    }
> >>> +
> >>> +    public void trace( Marker marker, String format, Object arg1,
> Object arg2 )
> >>> +    {
> >>> +        trace( format, arg1, arg2 );
> >>> +    }
> >>> +
> >>> +    public void trace( Marker marker, String format, Object[]
> argArray )
> >>> +    {
> >>> +        trace( format, argArray );
> >>> +    }
> >>> +
> >>> +    public void trace( Marker marker, String msg, Throwable t )
> >>> +    {
> >>> +        trace( msg, t );
> >>> +    }
> >>> +
> >>> +    public boolean isDebugEnabled()
> >>> +    {
> >>> +        return logger.isDebugEnabled();
> >>> +    }
> >>> +
> >>> +    public void debug( String msg )
> >>> +    {
> >>> +        logger.debug( msg );
> >>> +    }
> >>> +
> >>> +    public void debug( String format, Object arg )
> >>> +    {
> >>> +        FormattingTuple ft = MessageFormatter.format( format, arg );
> >>> +        logger.debug( ft.getMessage(), ft.getThrowable() );
> >>> +    }
> >>> +
> >>> +    public void debug( String format, Object arg1, Object arg2 )
> >>> +    {
> >>> +        FormattingTuple ft = MessageFormatter.format( format, arg1,
> arg2 );
> >>> +        logger.debug( ft.getMessage(), ft.getThrowable() );
> >>> +    }
> >>> +
> >>> +    public void debug( String format, Object[] argArray )
> >>> +    {
> >>> +        FormattingTuple ft = MessageFormatter.arrayFormat( format,
> argArray );
> >>> +        logger.debug( ft.getMessage(), ft.getThrowable() );
> >>> +    }
> >>> +
> >>> +    public void debug( String msg, Throwable t )
> >>> +    {
> >>> +        logger.debug( msg, t );
> >>> +    }
> >>> +
> >>> +    public boolean isDebugEnabled( Marker marker )
> >>> +    {
> >>> +        return isDebugEnabled();
> >>> +    }
> >>> +
> >>> +    public void debug( Marker marker, String msg )
> >>> +    {
> >>> +        debug( msg );
> >>> +    }
> >>> +
> >>> +    public void debug( Marker marker, String format, Object arg )
> >>> +    {
> >>> +        debug( format, arg );
> >>> +    }
> >>> +
> >>> +    public void debug( Marker marker, String format, Object arg1,
> Object arg2 )
> >>> +    {
> >>> +        debug( format, arg1, arg2 );
> >>> +    }
> >>> +
> >>> +    public void debug( Marker marker, String format, Object[]
> argArray )
> >>> +    {
> >>> +        debug( format, argArray );
> >>> +    }
> >>> +
> >>> +    public void debug( Marker marker, String msg, Throwable t )
> >>> +    {
> >>> +        debug( msg, t );
> >>> +    }
> >>> +
> >>> +    public boolean isInfoEnabled()
> >>> +    {
> >>> +        return logger.isInfoEnabled();
> >>> +    }
> >>> +
> >>> +    public void info( String msg )
> >>> +    {
> >>> +        logger.info( msg );
> >>> +    }
> >>> +
> >>> +    public void info( String format, Object arg )
> >>> +    {
> >>> +        FormattingTuple ft = MessageFormatter.format( format, arg );
> >>> +        logger.info( ft.getMessage(), ft.getThrowable() );
> >>> +    }
> >>> +
> >>> +    public void info( String format, Object arg1, Object arg2 )
> >>> +    {
> >>> +        FormattingTuple ft = MessageFormatter.format( format, arg1,
> arg2 );
> >>> +        logger.info( ft.getMessage(), ft.getThrowable() );
> >>> +    }
> >>> +
> >>> +    public void info( String format, Object[] argArray )
> >>> +    {
> >>> +        FormattingTuple ft = MessageFormatter.arrayFormat( format,
> argArray );
> >>> +        logger.info( ft.getMessage(), ft.getThrowable() );
> >>> +    }
> >>> +
> >>> +    public void info( String msg, Throwable t )
> >>> +    {
> >>> +        logger.info( msg, t );
> >>> +    }
> >>> +
> >>> +    public boolean isInfoEnabled( Marker marker )
> >>> +    {
> >>> +        return isInfoEnabled();
> >>> +    }
> >>> +
> >>> +    public void info( Marker marker, String msg )
> >>> +    {
> >>> +        info( msg );
> >>> +    }
> >>> +
> >>> +    public void info( Marker marker, String format, Object arg )
> >>> +    {
> >>> +        info( format, arg );
> >>> +    }
> >>> +
> >>> +    public void info( Marker marker, String format, Object arg1,
> Object arg2 )
> >>> +    {
> >>> +        info( format, arg1, arg2 );
> >>> +    }
> >>> +
> >>> +    public void info( Marker marker, String format, Object[] argArray
> )
> >>> +    {
> >>> +        info( format, argArray );
> >>> +    }
> >>> +
> >>> +    public void info( Marker marker, String msg, Throwable t )
> >>> +    {
> >>> +        info( msg, t );
> >>> +    }
> >>> +
> >>> +    public boolean isWarnEnabled()
> >>> +    {
> >>> +        return logger.isWarnEnabled();
> >>> +    }
> >>> +
> >>> +    public void warn( String msg )
> >>> +    {
> >>> +        logger.warn( msg );
> >>> +    }
> >>> +
> >>> +    public void warn( String format, Object arg )
> >>> +    {
> >>> +        FormattingTuple ft = MessageFormatter.format( format, arg );
> >>> +        logger.warn( ft.getMessage(), ft.getThrowable() );
> >>> +    }
> >>> +
> >>> +    public void warn( String format, Object arg1, Object arg2 )
> >>> +    {
> >>> +        FormattingTuple ft = MessageFormatter.format( format, arg1,
> arg2 );
> >>> +        logger.warn( ft.getMessage(), ft.getThrowable() );
> >>> +    }
> >>> +
> >>> +    public void warn( String format, Object[] argArray )
> >>> +    {
> >>> +        FormattingTuple ft = MessageFormatter.arrayFormat( format,
> argArray );
> >>> +        logger.warn( ft.getMessage(), ft.getThrowable() );
> >>> +    }
> >>> +
> >>> +    public void warn( String msg, Throwable t )
> >>> +    {
> >>> +        logger.warn( msg, t );
> >>> +    }
> >>> +
> >>> +    public boolean isWarnEnabled( Marker marker )
> >>> +    {
> >>> +        return isWarnEnabled();
> >>> +    }
> >>> +
> >>> +    public void warn( Marker marker, String msg )
> >>> +    {
> >>> +        warn( msg );
> >>> +    }
> >>> +
> >>> +    public void warn( Marker marker, String format, Object arg )
> >>> +    {
> >>> +        warn( format, arg );
> >>> +    }
> >>> +
> >>> +    public void warn( Marker marker, String format, Object arg1,
> Object arg2 )
> >>> +    {
> >>> +        warn( format, arg1, arg2 );
> >>> +    }
> >>> +
> >>> +    public void warn( Marker marker, String format, Object[] argArray
> )
> >>> +    {
> >>> +        warn( format, argArray );
> >>> +    }
> >>> +
> >>> +    public void warn( Marker marker, String msg, Throwable t )
> >>> +    {
> >>> +        warn( msg, t );
> >>> +    }
> >>> +
> >>> +    public boolean isErrorEnabled()
> >>> +    {
> >>> +        return logger.isErrorEnabled();
> >>> +    }
> >>> +
> >>> +    public void error( String msg )
> >>> +    {
> >>> +        logger.error( msg );
> >>> +    }
> >>> +
> >>> +    public void error( String format, Object arg )
> >>> +    {
> >>> +        FormattingTuple ft = MessageFormatter.format( format, arg );
> >>> +        logger.error( ft.getMessage(), ft.getThrowable() );
> >>> +    }
> >>> +
> >>> +    public void error( String format, Object arg1, Object arg2 )
> >>> +    {
> >>> +        FormattingTuple ft = MessageFormatter.format( format, arg1,
> arg2 );
> >>> +        logger.error( ft.getMessage(), ft.getThrowable() );
> >>> +    }
> >>> +
> >>> +    public void error( String format, Object[] argArray )
> >>> +    {
> >>> +        FormattingTuple ft = MessageFormatter.arrayFormat( format,
> argArray );
> >>> +        logger.error( ft.getMessage(), ft.getThrowable() );
> >>> +    }
> >>> +
> >>> +    public void error( String msg, Throwable t )
> >>> +    {
> >>> +        logger.error( msg, t );
> >>> +    }
> >>> +
> >>> +    public boolean isErrorEnabled( Marker marker )
> >>> +    {
> >>> +        return isErrorEnabled();
> >>> +    }
> >>> +
> >>> +    public void error( Marker marker, String msg )
> >>> +    {
> >>> +        error( msg );
> >>> +    }
> >>> +
> >>> +    public void error( Marker marker, String format, Object arg )
> >>> +    {
> >>> +        error( format, arg );
> >>> +    }
> >>> +
> >>> +    public void error( Marker marker, String format, Object arg1,
> Object arg2 )
> >>> +    {
> >>> +        error( format, arg1, arg2 );
> >>> +    }
> >>> +
> >>> +    public void error( Marker marker, String format, Object[]
> argArray )
> >>> +    {
> >>> +        error( format, argArray );
> >>> +    }
> >>> +
> >>> +    public void error( Marker marker, String msg, Throwable t )
> >>> +    {
> >>> +        error( msg, t );
> >>> +    }
> >>> +
> >>> +}
> >>>
> >>> Added:
> >>>
> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLoggerFactory.java
> >>> URL:
> >>>
> http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLoggerFactory.java?rev=1380105&view=auto
> >>>
> ==============================================================================
> >>> ---
> >>>
> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLoggerFactory.java
> >>> (added)
> >>> +++
> >>>
> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLoggerFactory.java
> >>> Mon Sep  3 01:07:31 2012
> >>> @@ -0,0 +1,50 @@
> >>> +package org.apache.maven.cli;
> >>> +
> >>> +/*
> >>> + * Licensed to the Apache Software Foundation (ASF) under one
> >>> + * or more contributor license agreements.  See the NOTICE file
> >>> + * distributed with this work for additional information
> >>> + * regarding copyright ownership.  The ASF licenses this file
> >>> + * to you under the Apache License, Version 2.0 (the
> >>> + * "License"); you may not use this file except in compliance
> >>> + * with the License.  You may obtain a copy of the License at
> >>> + *
> >>> + *  http://www.apache.org/licenses/LICENSE-2.0
> >>> + *
> >>> + * Unless required by applicable law or agreed to in writing,
> >>> + * software distributed under the License is distributed on an
> >>> + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> >>> + * KIND, either express or implied.  See the License for the
> >>> + * specific language governing permissions and limitations
> >>> + * under the License.
> >>> + */
> >>> +
> >>> +import org.codehaus.plexus.logging.LoggerManager;
> >>> +import org.slf4j.ILoggerFactory;
> >>> +import org.slf4j.Logger;
> >>> +
> >>> +/**
> >>> + * A Slf4j logger factory bridged onto a Plexus logger manager.
> >>> + */
> >>> +public class PlexusLoggerFactory
> >>> +    implements ILoggerFactory
> >>> +{
> >>> +
> >>> +    private LoggerManager loggerManager;
> >>> +
> >>> +    public PlexusLoggerFactory( LoggerManager loggerManager )
> >>> +    {
> >>> +        this.loggerManager = loggerManager;
> >>> +    }
> >>> +
> >>> +    public void setLoggerManager( LoggerManager loggerManager )
> >>> +    {
> >>> +        this.loggerManager = loggerManager;
> >>> +    }
> >>> +
> >>> +    public Logger getLogger( String name )
> >>> +    {
> >>> +        return new PlexusLogger( loggerManager.getLoggerForComponent(
> name,
> >>> null ) );
> >>> +    }
> >>> +
> >>> +}
> >>>
> >>> Modified: maven/maven-3/trunk/pom.xml
> >>> URL:
> >>>
> http://svn.apache.org/viewvc/maven/maven-3/trunk/pom.xml?rev=1380105&r1=1380104&r2=1380105&view=diff
> >>>
> ==============================================================================
> >>> --- maven/maven-3/trunk/pom.xml (original)
> >>> +++ maven/maven-3/trunk/pom.xml Mon Sep  3 01:07:31 2012
> >>> @@ -56,6 +56,7 @@
> >>>      <modelloVersion>1.4.1</modelloVersion>
> >>>      <jxpathVersion>1.3</jxpathVersion>
> >>>      <aetherVersion>1.13.1</aetherVersion>
> >>> +    <slf4jVersion>1.6.1</slf4jVersion>
> >>>
> >>>
> <maven.test.redirectTestOutputToFile>true</maven.test.redirectTestOutputToFile>
> >>>      <!-- Control the name of the distribution and information output
> by mvn
> >>> -->
> >>>      <distributionId>apache-maven</distributionId>
> >>> @@ -203,6 +204,17 @@
> >>>          <artifactId>plexus-interpolation</artifactId>
> >>>          <version>${plexusInterpolationVersion}</version>
> >>>        </dependency>
> >>> +      <dependency>
> >>> +        <groupId>org.slf4j</groupId>
> >>> +        <artifactId>slf4j-api</artifactId>
> >>> +        <version>${slf4jVersion}</version>
> >>> +      </dependency>
> >>> +      <dependency>
> >>> +        <groupId>org.slf4j</groupId>
> >>> +        <artifactId>slf4j-nop</artifactId>
> >>> +        <version>${slf4jVersion}</version>
> >>> +        <scope>runtime</scope>
> >>> +      </dependency>
> >>>        <!--  Wagon -->
> >>>        <dependency>
> >>>          <groupId>org.apache.maven.wagon</groupId>
> >>>
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> >>For additional commands, e-mail: dev-help@maven.apache.org
> >>
> >>
> >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>

Re: svn commit: r1380105 - in /maven/maven-3/trunk: ./ apache-maven/ maven-core/src/main/java/org/apache/maven/classrealm/ maven-embedder/ maven-embedder/src/main/java/org/apache/maven/cli/

Posted by Mark Struberg <st...@yahoo.de>.
> imports.put( "org.slf4j.*", coreRealm );

To me this looks like any org.slf4j sub package would be exported. 

The whole goal of org.codehaus.plexus.logging.Logger was to shield the user from ANY specific logging framework. That way we could back the plexus Logger with any implementation the user wants. 


We already HAVE a logging bridge. Imo there is just no need to introduce another one!
To kind of hardcode this now to slf4j is frankly speaking nonsense imo.

But maybe I just missed the point? What is the reason for it? 


LieGrue,
strub


>________________________________
> From: Stephen Connolly <st...@gmail.com>
>To: Maven Developers List <de...@maven.apache.org>; Mark Struberg <st...@yahoo.de> 
>Sent: Monday, September 3, 2012 10:42 AM
>Subject: Re: svn commit: r1380105 - in /maven/maven-3/trunk: ./ apache-maven/ maven-core/src/main/java/org/apache/maven/classrealm/ maven-embedder/ maven-embedder/src/main/java/org/apache/maven/cli/
> 
>
>I'm not seeing log4j-over-slf4j in the dependency tree there at all... so where is the bridge?
>
>
>On 3 September 2012 08:10, Mark Struberg <st...@yahoo.de> wrote:
>
>whats the reason for the slf4j bridge?
>>
>>This is kown to trash old plugins which use log4j because it clashes with it's namespace and only partly implements the log4j classes.
>>
>>I personally ind slf4j nice, but for older projects which use commons-logging or log4j already (and where you cant fiddle around with their sources) this broke way too many things for me.
>>Why is this needed at all? Has nothing to do with JSR-330.
>>
>>LieGrue,
>>strub
>>
>>
>>
>>
>>
>>----- Original Message -----
>>> From: "jvanzyl@apache.org" <jv...@apache.org>
>>> To: commits@maven.apache.org
>>> Cc:
>>> Sent: Monday, September 3, 2012 3:07 AM
>>> Subject: svn commit: r1380105 - in /maven/maven-3/trunk: ./ apache-maven/ maven-core/src/main/java/org/apache/maven/classrealm/ maven-embedder/ maven-embedder/src/main/java/org/apache/maven/cli/
>>>
>>> Author: jvanzyl
>>> Date: Mon Sep  3 01:07:31 2012
>>> New Revision: 1380105
>>>
>>> URL: http://svn.apache.org/viewvc?rev=1380105&view=rev
>>> Log:
>>> o Enabled support and discovery of JSR-330 components
>>>
>>> o Added Slf4j logger factory to support generic JSR-330 logging
>>>
>>> o Exported Guice package for components that access Guice (or better it's
>>> injector) directly
>>>
>>> Widen export of Guice packages (not ideal, need to look into ways to avoid this)
>>>
>>> o use specific exports
>>>
>>> o for now we will attempt to hide all of Guice in plugin realms and we'll do
>>> a bit of testing
>>>
>>> closes #3
>>>
>>> Added:
>>>    
>>> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLogger.java
>>>    
>>> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLoggerFactory.java
>>> Modified:
>>>     maven/maven-3/trunk/apache-maven/pom.xml
>>>    
>>> maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java
>>>     maven/maven-3/trunk/maven-embedder/pom.xml
>>>    
>>> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
>>>     maven/maven-3/trunk/pom.xml
>>>
>>> Modified: maven/maven-3/trunk/apache-maven/pom.xml
>>> URL:
>>> http://svn.apache.org/viewvc/maven/maven-3/trunk/apache-maven/pom.xml?rev=1380105&r1=1380104&r2=1380105&view=diff
>>> ==============================================================================
>>> --- maven/maven-3/trunk/apache-maven/pom.xml (original)
>>> +++ maven/maven-3/trunk/apache-maven/pom.xml Mon Sep  3 01:07:31 2012
>>> @@ -83,6 +83,10 @@
>>>        <groupId>org.sonatype.aether</groupId>
>>>        <artifactId>aether-connector-wagon</artifactId>
>>>      </dependency>
>>> +    <dependency>
>>> +      <groupId>org.slf4j</groupId>
>>> +      <artifactId>slf4j-nop</artifactId>
>>> +    </dependency>
>>>    </dependencies>
>>>
>>>    <build>
>>>
>>> Modified:
>>> maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java
>>> URL:
>>> http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java?rev=1380105&r1=1380104&r2=1380105&view=diff
>>> ==============================================================================
>>> ---
>>> maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java
>>> (original)
>>> +++
>>> maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java
>>> Mon Sep  3 01:07:31 2012
>>> @@ -198,6 +198,26 @@ public class DefaultClassRealmManager
>>>          imports.put(
>>> "org.codehaus.plexus.util.xml.pull.XmlPullParser", coreRealm );
>>>          imports.put(
>>> "org.codehaus.plexus.util.xml.pull.XmlPullParserException", coreRealm
>>> );
>>>          imports.put(
>>> "org.codehaus.plexus.util.xml.pull.XmlSerializer", coreRealm );
>>> +
>>> +        // javax.inject, sisu-inject (JSR-330)
>>> +        imports.put( "javax.inject.*", coreRealm );
>>> +        imports.put( "javax.enterprise.inject.*", coreRealm );
>>> +        imports.put( "org.sonatype.inject.*", coreRealm );
>>> +        imports.put( "org.slf4j.*", coreRealm );
>>> +       
>>> +        // com.google
>>> +        //
>>> +        // We may potentially want to export these, but right now I'm not
>>> sure that anything Guice specific needs
>>> +        // to be made available to plugin authors. If we find people are
>>> getting fancy and want to take advantage
>>> +        // of Guice specifics we can expose that later. Really some testing
>>> needs to be done to see full hiding
>>> +        // of Guice has any impact on what we may categorize as a standard
>>> JSR-330 based Tesla/Maven plugin.
>>> +        //
>>> +        // imports.put( "com.google.inject.*", coreRealm );
>>> +        // imports.put( "com.google.inject.binder.*", coreRealm );
>>> +        // imports.put( "com.google.inject.matcher.*", coreRealm );
>>> +        // imports.put( "com.google.inject.name.*", coreRealm );
>>> +        // imports.put( "com.google.inject.spi.*", coreRealm );
>>> +        // imports.put( "com.google.inject.util.*", coreRealm );
>>>      }
>>>
>>>      /**
>>>
>>> Modified: maven/maven-3/trunk/maven-embedder/pom.xml
>>> URL:
>>> http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-embedder/pom.xml?rev=1380105&r1=1380104&r2=1380105&view=diff
>>> ==============================================================================
>>> --- maven/maven-3/trunk/maven-embedder/pom.xml (original)
>>> +++ maven/maven-3/trunk/maven-embedder/pom.xml Mon Sep  3 01:07:31 2012
>>> @@ -70,6 +70,10 @@
>>>        <groupId>org.sonatype.plexus</groupId>
>>>        <artifactId>plexus-cipher</artifactId>
>>>      </dependency>
>>> +    <dependency>
>>> +      <groupId>org.slf4j</groupId>
>>> +      <artifactId>slf4j-api</artifactId>
>>> +    </dependency>
>>>      <!-- CLI -->
>>>      <dependency>
>>>        <groupId>commons-cli</groupId>
>>>
>>> Modified:
>>> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
>>> URL:
>>> http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java?rev=1380105&r1=1380104&r2=1380105&view=diff
>>> ==============================================================================
>>> ---
>>> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
>>> (original)
>>> +++
>>> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
>>> Mon Sep  3 01:07:31 2012
>>> @@ -59,12 +59,14 @@ import org.apache.maven.settings.buildin
>>> import org.codehaus.plexus.ContainerConfiguration;
>>> import org.codehaus.plexus.DefaultContainerConfiguration;
>>> import org.codehaus.plexus.DefaultPlexusContainer;
>>> +import org.codehaus.plexus.PlexusConstants;
>>> import org.codehaus.plexus.PlexusContainer;
>>> import org.codehaus.plexus.classworlds.ClassWorld;
>>> import org.codehaus.plexus.classworlds.realm.ClassRealm;
>>> import
>>> org.codehaus.plexus.component.repository.exception.ComponentLookupException;
>>> import org.codehaus.plexus.logging.Logger;
>>> import org.codehaus.plexus.util.StringUtils;
>>> +import org.slf4j.ILoggerFactory;
>>> import org.sonatype.aether.transfer.TransferListener;
>>> import org.sonatype.plexus.components.cipher.DefaultPlexusCipher;
>>> import org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher;
>>> @@ -72,6 +74,8 @@ import org.sonatype.plexus.components.se
>>> import org.sonatype.plexus.components.sec.dispatcher.SecUtil;
>>> import org.sonatype.plexus.components.sec.dispatcher.model.SettingsSecurity;
>>>
>>> +import com.google.inject.AbstractModule;
>>> +
>>> // TODO: push all common bits back to plexus cli and prepare for transition to
>>> Guice. We don't need 50 ways to make CLIs
>>>
>>> /**
>>> @@ -372,17 +376,29 @@ public class MavenCli
>>>          {
>>>              logger = setupLogger( cliRequest );
>>>
>>> +            final MavenLoggerManager loggerManager = new MavenLoggerManager(
>>> logger ) ;
>>> +
>>>              ContainerConfiguration cc = new DefaultContainerConfiguration()
>>>                  .setClassWorld( cliRequest.classWorld )
>>>                  .setRealm( setupContainerRealm( cliRequest ) )
>>> +                .setClassPathScanning( PlexusConstants.SCANNING_INDEX )
>>> +                .setAutoWiring( true )
>>>                  .setName( "maven" );
>>>
>>> -            container = new DefaultPlexusContainer( cc );
>>> +            container = new DefaultPlexusContainer( cc, new AbstractModule()
>>> +            {
>>> +
>>> +                protected void configure()
>>> +                {
>>> +                    bind( ILoggerFactory.class ).toInstance( new
>>> PlexusLoggerFactory( loggerManager ) );
>>> +                }
>>> +
>>> +            } );
>>>
>>>              // NOTE: To avoid inconsistencies, we'll use the TCCL
>>> exclusively for lookups
>>>              container.setLookupRealm( null );
>>>
>>> -            container.setLoggerManager( new MavenLoggerManager( logger ) );
>>> +            container.setLoggerManager( loggerManager );
>>>
>>>              customizeContainer( container );
>>>
>>>
>>> Added:
>>> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLogger.java
>>> URL:
>>> http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLogger.java?rev=1380105&view=auto
>>> ==============================================================================
>>> ---
>>> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLogger.java
>>> (added)
>>> +++
>>> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLogger.java
>>> Mon Sep  3 01:07:31 2012
>>> @@ -0,0 +1,358 @@
>>> +package org.apache.maven.cli;
>>> +
>>> +/*
>>> + * Licensed to the Apache Software Foundation (ASF) under one
>>> + * or more contributor license agreements.  See the NOTICE file
>>> + * distributed with this work for additional information
>>> + * regarding copyright ownership.  The ASF licenses this file
>>> + * to you under the Apache License, Version 2.0 (the
>>> + * "License"); you may not use this file except in compliance
>>> + * with the License.  You may obtain a copy of the License at
>>> + *
>>> + *  http://www.apache.org/licenses/LICENSE-2.0
>>> + *
>>> + * Unless required by applicable law or agreed to in writing,
>>> + * software distributed under the License is distributed on an
>>> + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>>> + * KIND, either express or implied.  See the License for the
>>> + * specific language governing permissions and limitations
>>> + * under the License.
>>> + */
>>> +
>>> +import org.slf4j.Logger;
>>> +import org.slf4j.Marker;
>>> +import org.slf4j.helpers.FormattingTuple;
>>> +import org.slf4j.helpers.MessageFormatter;
>>> +
>>> +/**
>>> + * A Slf4j logger bridged onto a Plexus logger.
>>> + */
>>> +class PlexusLogger
>>> +    implements Logger
>>> +{
>>> +
>>> +    private final org.codehaus.plexus.logging.Logger logger;
>>> +
>>> +    public PlexusLogger( org.codehaus.plexus.logging.Logger logger )
>>> +    {
>>> +        this.logger = logger;
>>> +    }
>>> +
>>> +    public String getName()
>>> +    {
>>> +        return logger.getName();
>>> +    }
>>> +
>>> +    public boolean isTraceEnabled()
>>> +    {
>>> +        return isDebugEnabled();
>>> +    }
>>> +
>>> +    public void trace( String msg )
>>> +    {
>>> +        debug( msg );
>>> +    }
>>> +
>>> +    public void trace( String format, Object arg )
>>> +    {
>>> +        debug( format, arg );
>>> +    }
>>> +
>>> +    public void trace( String format, Object arg1, Object arg2 )
>>> +    {
>>> +        debug( format, arg1, arg2 );
>>> +    }
>>> +
>>> +    public void trace( String format, Object[] argArray )
>>> +    {
>>> +        debug( format, argArray );
>>> +    }
>>> +
>>> +    public void trace( String msg, Throwable t )
>>> +    {
>>> +        debug( msg, t );
>>> +    }
>>> +
>>> +    public boolean isTraceEnabled( Marker marker )
>>> +    {
>>> +        return isTraceEnabled();
>>> +    }
>>> +
>>> +    public void trace( Marker marker, String msg )
>>> +    {
>>> +        trace( msg );
>>> +    }
>>> +
>>> +    public void trace( Marker marker, String format, Object arg )
>>> +    {
>>> +        trace( format, arg );
>>> +    }
>>> +
>>> +    public void trace( Marker marker, String format, Object arg1, Object arg2 )
>>> +    {
>>> +        trace( format, arg1, arg2 );
>>> +    }
>>> +
>>> +    public void trace( Marker marker, String format, Object[] argArray )
>>> +    {
>>> +        trace( format, argArray );
>>> +    }
>>> +
>>> +    public void trace( Marker marker, String msg, Throwable t )
>>> +    {
>>> +        trace( msg, t );
>>> +    }
>>> +
>>> +    public boolean isDebugEnabled()
>>> +    {
>>> +        return logger.isDebugEnabled();
>>> +    }
>>> +
>>> +    public void debug( String msg )
>>> +    {
>>> +        logger.debug( msg );
>>> +    }
>>> +
>>> +    public void debug( String format, Object arg )
>>> +    {
>>> +        FormattingTuple ft = MessageFormatter.format( format, arg );
>>> +        logger.debug( ft.getMessage(), ft.getThrowable() );
>>> +    }
>>> +
>>> +    public void debug( String format, Object arg1, Object arg2 )
>>> +    {
>>> +        FormattingTuple ft = MessageFormatter.format( format, arg1, arg2 );
>>> +        logger.debug( ft.getMessage(), ft.getThrowable() );
>>> +    }
>>> +
>>> +    public void debug( String format, Object[] argArray )
>>> +    {
>>> +        FormattingTuple ft = MessageFormatter.arrayFormat( format, argArray );
>>> +        logger.debug( ft.getMessage(), ft.getThrowable() );
>>> +    }
>>> +
>>> +    public void debug( String msg, Throwable t )
>>> +    {
>>> +        logger.debug( msg, t );
>>> +    }
>>> +
>>> +    public boolean isDebugEnabled( Marker marker )
>>> +    {
>>> +        return isDebugEnabled();
>>> +    }
>>> +
>>> +    public void debug( Marker marker, String msg )
>>> +    {
>>> +        debug( msg );
>>> +    }
>>> +
>>> +    public void debug( Marker marker, String format, Object arg )
>>> +    {
>>> +        debug( format, arg );
>>> +    }
>>> +
>>> +    public void debug( Marker marker, String format, Object arg1, Object arg2 )
>>> +    {
>>> +        debug( format, arg1, arg2 );
>>> +    }
>>> +
>>> +    public void debug( Marker marker, String format, Object[] argArray )
>>> +    {
>>> +        debug( format, argArray );
>>> +    }
>>> +
>>> +    public void debug( Marker marker, String msg, Throwable t )
>>> +    {
>>> +        debug( msg, t );
>>> +    }
>>> +
>>> +    public boolean isInfoEnabled()
>>> +    {
>>> +        return logger.isInfoEnabled();
>>> +    }
>>> +
>>> +    public void info( String msg )
>>> +    {
>>> +        logger.info( msg );
>>> +    }
>>> +
>>> +    public void info( String format, Object arg )
>>> +    {
>>> +        FormattingTuple ft = MessageFormatter.format( format, arg );
>>> +        logger.info( ft.getMessage(), ft.getThrowable() );
>>> +    }
>>> +
>>> +    public void info( String format, Object arg1, Object arg2 )
>>> +    {
>>> +        FormattingTuple ft = MessageFormatter.format( format, arg1, arg2 );
>>> +        logger.info( ft.getMessage(), ft.getThrowable() );
>>> +    }
>>> +
>>> +    public void info( String format, Object[] argArray )
>>> +    {
>>> +        FormattingTuple ft = MessageFormatter.arrayFormat( format, argArray );
>>> +        logger.info( ft.getMessage(), ft.getThrowable() );
>>> +    }
>>> +
>>> +    public void info( String msg, Throwable t )
>>> +    {
>>> +        logger.info( msg, t );
>>> +    }
>>> +
>>> +    public boolean isInfoEnabled( Marker marker )
>>> +    {
>>> +        return isInfoEnabled();
>>> +    }
>>> +
>>> +    public void info( Marker marker, String msg )
>>> +    {
>>> +        info( msg );
>>> +    }
>>> +
>>> +    public void info( Marker marker, String format, Object arg )
>>> +    {
>>> +        info( format, arg );
>>> +    }
>>> +
>>> +    public void info( Marker marker, String format, Object arg1, Object arg2 )
>>> +    {
>>> +        info( format, arg1, arg2 );
>>> +    }
>>> +
>>> +    public void info( Marker marker, String format, Object[] argArray )
>>> +    {
>>> +        info( format, argArray );
>>> +    }
>>> +
>>> +    public void info( Marker marker, String msg, Throwable t )
>>> +    {
>>> +        info( msg, t );
>>> +    }
>>> +
>>> +    public boolean isWarnEnabled()
>>> +    {
>>> +        return logger.isWarnEnabled();
>>> +    }
>>> +
>>> +    public void warn( String msg )
>>> +    {
>>> +        logger.warn( msg );
>>> +    }
>>> +
>>> +    public void warn( String format, Object arg )
>>> +    {
>>> +        FormattingTuple ft = MessageFormatter.format( format, arg );
>>> +        logger.warn( ft.getMessage(), ft.getThrowable() );
>>> +    }
>>> +
>>> +    public void warn( String format, Object arg1, Object arg2 )
>>> +    {
>>> +        FormattingTuple ft = MessageFormatter.format( format, arg1, arg2 );
>>> +        logger.warn( ft.getMessage(), ft.getThrowable() );
>>> +    }
>>> +
>>> +    public void warn( String format, Object[] argArray )
>>> +    {
>>> +        FormattingTuple ft = MessageFormatter.arrayFormat( format, argArray );
>>> +        logger.warn( ft.getMessage(), ft.getThrowable() );
>>> +    }
>>> +
>>> +    public void warn( String msg, Throwable t )
>>> +    {
>>> +        logger.warn( msg, t );
>>> +    }
>>> +
>>> +    public boolean isWarnEnabled( Marker marker )
>>> +    {
>>> +        return isWarnEnabled();
>>> +    }
>>> +
>>> +    public void warn( Marker marker, String msg )
>>> +    {
>>> +        warn( msg );
>>> +    }
>>> +
>>> +    public void warn( Marker marker, String format, Object arg )
>>> +    {
>>> +        warn( format, arg );
>>> +    }
>>> +
>>> +    public void warn( Marker marker, String format, Object arg1, Object arg2 )
>>> +    {
>>> +        warn( format, arg1, arg2 );
>>> +    }
>>> +
>>> +    public void warn( Marker marker, String format, Object[] argArray )
>>> +    {
>>> +        warn( format, argArray );
>>> +    }
>>> +
>>> +    public void warn( Marker marker, String msg, Throwable t )
>>> +    {
>>> +        warn( msg, t );
>>> +    }
>>> +
>>> +    public boolean isErrorEnabled()
>>> +    {
>>> +        return logger.isErrorEnabled();
>>> +    }
>>> +
>>> +    public void error( String msg )
>>> +    {
>>> +        logger.error( msg );
>>> +    }
>>> +
>>> +    public void error( String format, Object arg )
>>> +    {
>>> +        FormattingTuple ft = MessageFormatter.format( format, arg );
>>> +        logger.error( ft.getMessage(), ft.getThrowable() );
>>> +    }
>>> +
>>> +    public void error( String format, Object arg1, Object arg2 )
>>> +    {
>>> +        FormattingTuple ft = MessageFormatter.format( format, arg1, arg2 );
>>> +        logger.error( ft.getMessage(), ft.getThrowable() );
>>> +    }
>>> +
>>> +    public void error( String format, Object[] argArray )
>>> +    {
>>> +        FormattingTuple ft = MessageFormatter.arrayFormat( format, argArray );
>>> +        logger.error( ft.getMessage(), ft.getThrowable() );
>>> +    }
>>> +
>>> +    public void error( String msg, Throwable t )
>>> +    {
>>> +        logger.error( msg, t );
>>> +    }
>>> +
>>> +    public boolean isErrorEnabled( Marker marker )
>>> +    {
>>> +        return isErrorEnabled();
>>> +    }
>>> +
>>> +    public void error( Marker marker, String msg )
>>> +    {
>>> +        error( msg );
>>> +    }
>>> +
>>> +    public void error( Marker marker, String format, Object arg )
>>> +    {
>>> +        error( format, arg );
>>> +    }
>>> +
>>> +    public void error( Marker marker, String format, Object arg1, Object arg2 )
>>> +    {
>>> +        error( format, arg1, arg2 );
>>> +    }
>>> +
>>> +    public void error( Marker marker, String format, Object[] argArray )
>>> +    {
>>> +        error( format, argArray );
>>> +    }
>>> +
>>> +    public void error( Marker marker, String msg, Throwable t )
>>> +    {
>>> +        error( msg, t );
>>> +    }
>>> +
>>> +}
>>>
>>> Added:
>>> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLoggerFactory.java
>>> URL:
>>> http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLoggerFactory.java?rev=1380105&view=auto
>>> ==============================================================================
>>> ---
>>> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLoggerFactory.java
>>> (added)
>>> +++
>>> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLoggerFactory.java
>>> Mon Sep  3 01:07:31 2012
>>> @@ -0,0 +1,50 @@
>>> +package org.apache.maven.cli;
>>> +
>>> +/*
>>> + * Licensed to the Apache Software Foundation (ASF) under one
>>> + * or more contributor license agreements.  See the NOTICE file
>>> + * distributed with this work for additional information
>>> + * regarding copyright ownership.  The ASF licenses this file
>>> + * to you under the Apache License, Version 2.0 (the
>>> + * "License"); you may not use this file except in compliance
>>> + * with the License.  You may obtain a copy of the License at
>>> + *
>>> + *  http://www.apache.org/licenses/LICENSE-2.0
>>> + *
>>> + * Unless required by applicable law or agreed to in writing,
>>> + * software distributed under the License is distributed on an
>>> + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>>> + * KIND, either express or implied.  See the License for the
>>> + * specific language governing permissions and limitations
>>> + * under the License.
>>> + */
>>> +
>>> +import org.codehaus.plexus.logging.LoggerManager;
>>> +import org.slf4j.ILoggerFactory;
>>> +import org.slf4j.Logger;
>>> +
>>> +/**
>>> + * A Slf4j logger factory bridged onto a Plexus logger manager.
>>> + */
>>> +public class PlexusLoggerFactory
>>> +    implements ILoggerFactory
>>> +{
>>> +
>>> +    private LoggerManager loggerManager;
>>> +
>>> +    public PlexusLoggerFactory( LoggerManager loggerManager )
>>> +    {
>>> +        this.loggerManager = loggerManager;
>>> +    }
>>> +
>>> +    public void setLoggerManager( LoggerManager loggerManager )
>>> +    {
>>> +        this.loggerManager = loggerManager;
>>> +    }
>>> +
>>> +    public Logger getLogger( String name )
>>> +    {
>>> +        return new PlexusLogger( loggerManager.getLoggerForComponent( name,
>>> null ) );
>>> +    }
>>> +
>>> +}
>>>
>>> Modified: maven/maven-3/trunk/pom.xml
>>> URL:
>>> http://svn.apache.org/viewvc/maven/maven-3/trunk/pom.xml?rev=1380105&r1=1380104&r2=1380105&view=diff
>>> ==============================================================================
>>> --- maven/maven-3/trunk/pom.xml (original)
>>> +++ maven/maven-3/trunk/pom.xml Mon Sep  3 01:07:31 2012
>>> @@ -56,6 +56,7 @@
>>>      <modelloVersion>1.4.1</modelloVersion>
>>>      <jxpathVersion>1.3</jxpathVersion>
>>>      <aetherVersion>1.13.1</aetherVersion>
>>> +    <slf4jVersion>1.6.1</slf4jVersion>
>>>    
>>> <maven.test.redirectTestOutputToFile>true</maven.test.redirectTestOutputToFile>
>>>      <!-- Control the name of the distribution and information output by mvn
>>> -->
>>>      <distributionId>apache-maven</distributionId>
>>> @@ -203,6 +204,17 @@
>>>          <artifactId>plexus-interpolation</artifactId>
>>>          <version>${plexusInterpolationVersion}</version>
>>>        </dependency>
>>> +      <dependency>
>>> +        <groupId>org.slf4j</groupId>
>>> +        <artifactId>slf4j-api</artifactId>
>>> +        <version>${slf4jVersion}</version>
>>> +      </dependency>
>>> +      <dependency>
>>> +        <groupId>org.slf4j</groupId>
>>> +        <artifactId>slf4j-nop</artifactId>
>>> +        <version>${slf4jVersion}</version>
>>> +        <scope>runtime</scope>
>>> +      </dependency>
>>>        <!--  Wagon -->
>>>        <dependency>
>>>          <groupId>org.apache.maven.wagon</groupId>
>>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>>For additional commands, e-mail: dev-help@maven.apache.org
>>
>>
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: svn commit: r1380105 - in /maven/maven-3/trunk: ./ apache-maven/ maven-core/src/main/java/org/apache/maven/classrealm/ maven-embedder/ maven-embedder/src/main/java/org/apache/maven/cli/

Posted by Stephen Connolly <st...@gmail.com>.
I'm not seeing log4j-over-slf4j in the dependency tree there at all... so
where is the bridge?

On 3 September 2012 08:10, Mark Struberg <st...@yahoo.de> wrote:

> whats the reason for the slf4j bridge?
>
> This is kown to trash old plugins which use log4j because it clashes with
> it's namespace and only partly implements the log4j classes.
>
> I personally ind slf4j nice, but for older projects which use
> commons-logging or log4j already (and where you cant fiddle around with
> their sources) this broke way too many things for me.
> Why is this needed at all? Has nothing to do with JSR-330.
>
> LieGrue,
> strub
>
>
>
>
> ----- Original Message -----
> > From: "jvanzyl@apache.org" <jv...@apache.org>
> > To: commits@maven.apache.org
> > Cc:
> > Sent: Monday, September 3, 2012 3:07 AM
> > Subject: svn commit: r1380105 - in /maven/maven-3/trunk: ./
> apache-maven/ maven-core/src/main/java/org/apache/maven/classrealm/
> maven-embedder/ maven-embedder/src/main/java/org/apache/maven/cli/
> >
> > Author: jvanzyl
> > Date: Mon Sep  3 01:07:31 2012
> > New Revision: 1380105
> >
> > URL: http://svn.apache.org/viewvc?rev=1380105&view=rev
> > Log:
> > o Enabled support and discovery of JSR-330 components
> >
> > o Added Slf4j logger factory to support generic JSR-330 logging
> >
> > o Exported Guice package for components that access Guice (or better it's
> > injector) directly
> >
> > Widen export of Guice packages (not ideal, need to look into ways to
> avoid this)
> >
> > o use specific exports
> >
> > o for now we will attempt to hide all of Guice in plugin realms and
> we'll do
> > a bit of testing
> >
> > closes #3
> >
> > Added:
> >
> >
> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLogger.java
> >
> >
> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLoggerFactory.java
> > Modified:
> >     maven/maven-3/trunk/apache-maven/pom.xml
> >
> >
> maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java
> >     maven/maven-3/trunk/maven-embedder/pom.xml
> >
> >
> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
> >     maven/maven-3/trunk/pom.xml
> >
> > Modified: maven/maven-3/trunk/apache-maven/pom.xml
> > URL:
> >
> http://svn.apache.org/viewvc/maven/maven-3/trunk/apache-maven/pom.xml?rev=1380105&r1=1380104&r2=1380105&view=diff
> >
> ==============================================================================
> > --- maven/maven-3/trunk/apache-maven/pom.xml (original)
> > +++ maven/maven-3/trunk/apache-maven/pom.xml Mon Sep  3 01:07:31 2012
> > @@ -83,6 +83,10 @@
> >        <groupId>org.sonatype.aether</groupId>
> >        <artifactId>aether-connector-wagon</artifactId>
> >      </dependency>
> > +    <dependency>
> > +      <groupId>org.slf4j</groupId>
> > +      <artifactId>slf4j-nop</artifactId>
> > +    </dependency>
> >    </dependencies>
> >
> >    <build>
> >
> > Modified:
> >
> maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java
> > URL:
> >
> http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java?rev=1380105&r1=1380104&r2=1380105&view=diff
> >
> ==============================================================================
> > ---
> >
> maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java
> > (original)
> > +++
> >
> maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java
> > Mon Sep  3 01:07:31 2012
> > @@ -198,6 +198,26 @@ public class DefaultClassRealmManager
> >          imports.put(
> > "org.codehaus.plexus.util.xml.pull.XmlPullParser", coreRealm );
> >          imports.put(
> > "org.codehaus.plexus.util.xml.pull.XmlPullParserException", coreRealm
> > );
> >          imports.put(
> > "org.codehaus.plexus.util.xml.pull.XmlSerializer", coreRealm );
> > +
> > +        // javax.inject, sisu-inject (JSR-330)
> > +        imports.put( "javax.inject.*", coreRealm );
> > +        imports.put( "javax.enterprise.inject.*", coreRealm );
> > +        imports.put( "org.sonatype.inject.*", coreRealm );
> > +        imports.put( "org.slf4j.*", coreRealm );
> > +
> > +        // com.google
> > +        //
> > +        // We may potentially want to export these, but right now I'm
> not
> > sure that anything Guice specific needs
> > +        // to be made available to plugin authors. If we find people are
> > getting fancy and want to take advantage
> > +        // of Guice specifics we can expose that later. Really some
> testing
> > needs to be done to see full hiding
> > +        // of Guice has any impact on what we may categorize as a
> standard
> > JSR-330 based Tesla/Maven plugin.
> > +        //
> > +        // imports.put( "com.google.inject.*", coreRealm );
> > +        // imports.put( "com.google.inject.binder.*", coreRealm );
> > +        // imports.put( "com.google.inject.matcher.*", coreRealm );
> > +        // imports.put( "com.google.inject.name.*", coreRealm );
> > +        // imports.put( "com.google.inject.spi.*", coreRealm );
> > +        // imports.put( "com.google.inject.util.*", coreRealm );
> >      }
> >
> >      /**
> >
> > Modified: maven/maven-3/trunk/maven-embedder/pom.xml
> > URL:
> >
> http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-embedder/pom.xml?rev=1380105&r1=1380104&r2=1380105&view=diff
> >
> ==============================================================================
> > --- maven/maven-3/trunk/maven-embedder/pom.xml (original)
> > +++ maven/maven-3/trunk/maven-embedder/pom.xml Mon Sep  3 01:07:31 2012
> > @@ -70,6 +70,10 @@
> >        <groupId>org.sonatype.plexus</groupId>
> >        <artifactId>plexus-cipher</artifactId>
> >      </dependency>
> > +    <dependency>
> > +      <groupId>org.slf4j</groupId>
> > +      <artifactId>slf4j-api</artifactId>
> > +    </dependency>
> >      <!-- CLI -->
> >      <dependency>
> >        <groupId>commons-cli</groupId>
> >
> > Modified:
> >
> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
> > URL:
> >
> http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java?rev=1380105&r1=1380104&r2=1380105&view=diff
> >
> ==============================================================================
> > ---
> >
> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
> > (original)
> > +++
> >
> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
> > Mon Sep  3 01:07:31 2012
> > @@ -59,12 +59,14 @@ import org.apache.maven.settings.buildin
> > import org.codehaus.plexus.ContainerConfiguration;
> > import org.codehaus.plexus.DefaultContainerConfiguration;
> > import org.codehaus.plexus.DefaultPlexusContainer;
> > +import org.codehaus.plexus.PlexusConstants;
> > import org.codehaus.plexus.PlexusContainer;
> > import org.codehaus.plexus.classworlds.ClassWorld;
> > import org.codehaus.plexus.classworlds.realm.ClassRealm;
> > import
> >
> org.codehaus.plexus.component.repository.exception.ComponentLookupException;
> > import org.codehaus.plexus.logging.Logger;
> > import org.codehaus.plexus.util.StringUtils;
> > +import org.slf4j.ILoggerFactory;
> > import org.sonatype.aether.transfer.TransferListener;
> > import org.sonatype.plexus.components.cipher.DefaultPlexusCipher;
> > import
> org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher;
> > @@ -72,6 +74,8 @@ import org.sonatype.plexus.components.se
> > import org.sonatype.plexus.components.sec.dispatcher.SecUtil;
> > import
> org.sonatype.plexus.components.sec.dispatcher.model.SettingsSecurity;
> >
> > +import com.google.inject.AbstractModule;
> > +
> > // TODO: push all common bits back to plexus cli and prepare for
> transition to
> > Guice. We don't need 50 ways to make CLIs
> >
> > /**
> > @@ -372,17 +376,29 @@ public class MavenCli
> >          {
> >              logger = setupLogger( cliRequest );
> >
> > +            final MavenLoggerManager loggerManager = new
> MavenLoggerManager(
> > logger ) ;
> > +
> >              ContainerConfiguration cc = new
> DefaultContainerConfiguration()
> >                  .setClassWorld( cliRequest.classWorld )
> >                  .setRealm( setupContainerRealm( cliRequest ) )
> > +                .setClassPathScanning( PlexusConstants.SCANNING_INDEX )
> > +                .setAutoWiring( true )
> >                  .setName( "maven" );
> >
> > -            container = new DefaultPlexusContainer( cc );
> > +            container = new DefaultPlexusContainer( cc, new
> AbstractModule()
> > +            {
> > +
> > +                protected void configure()
> > +                {
> > +                    bind( ILoggerFactory.class ).toInstance( new
> > PlexusLoggerFactory( loggerManager ) );
> > +                }
> > +
> > +            } );
> >
> >              // NOTE: To avoid inconsistencies, we'll use the TCCL
> > exclusively for lookups
> >              container.setLookupRealm( null );
> >
> > -            container.setLoggerManager( new MavenLoggerManager( logger
> ) );
> > +            container.setLoggerManager( loggerManager );
> >
> >              customizeContainer( container );
> >
> >
> > Added:
> >
> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLogger.java
> > URL:
> >
> http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLogger.java?rev=1380105&view=auto
> >
> ==============================================================================
> > ---
> >
> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLogger.java
> > (added)
> > +++
> >
> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLogger.java
> > Mon Sep  3 01:07:31 2012
> > @@ -0,0 +1,358 @@
> > +package org.apache.maven.cli;
> > +
> > +/*
> > + * Licensed to the Apache Software Foundation (ASF) under one
> > + * or more contributor license agreements.  See the NOTICE file
> > + * distributed with this work for additional information
> > + * regarding copyright ownership.  The ASF licenses this file
> > + * to you under the Apache License, Version 2.0 (the
> > + * "License"); you may not use this file except in compliance
> > + * with the License.  You may obtain a copy of the License at
> > + *
> > + *  http://www.apache.org/licenses/LICENSE-2.0
> > + *
> > + * Unless required by applicable law or agreed to in writing,
> > + * software distributed under the License is distributed on an
> > + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> > + * KIND, either express or implied.  See the License for the
> > + * specific language governing permissions and limitations
> > + * under the License.
> > + */
> > +
> > +import org.slf4j.Logger;
> > +import org.slf4j.Marker;
> > +import org.slf4j.helpers.FormattingTuple;
> > +import org.slf4j.helpers.MessageFormatter;
> > +
> > +/**
> > + * A Slf4j logger bridged onto a Plexus logger.
> > + */
> > +class PlexusLogger
> > +    implements Logger
> > +{
> > +
> > +    private final org.codehaus.plexus.logging.Logger logger;
> > +
> > +    public PlexusLogger( org.codehaus.plexus.logging.Logger logger )
> > +    {
> > +        this.logger = logger;
> > +    }
> > +
> > +    public String getName()
> > +    {
> > +        return logger.getName();
> > +    }
> > +
> > +    public boolean isTraceEnabled()
> > +    {
> > +        return isDebugEnabled();
> > +    }
> > +
> > +    public void trace( String msg )
> > +    {
> > +        debug( msg );
> > +    }
> > +
> > +    public void trace( String format, Object arg )
> > +    {
> > +        debug( format, arg );
> > +    }
> > +
> > +    public void trace( String format, Object arg1, Object arg2 )
> > +    {
> > +        debug( format, arg1, arg2 );
> > +    }
> > +
> > +    public void trace( String format, Object[] argArray )
> > +    {
> > +        debug( format, argArray );
> > +    }
> > +
> > +    public void trace( String msg, Throwable t )
> > +    {
> > +        debug( msg, t );
> > +    }
> > +
> > +    public boolean isTraceEnabled( Marker marker )
> > +    {
> > +        return isTraceEnabled();
> > +    }
> > +
> > +    public void trace( Marker marker, String msg )
> > +    {
> > +        trace( msg );
> > +    }
> > +
> > +    public void trace( Marker marker, String format, Object arg )
> > +    {
> > +        trace( format, arg );
> > +    }
> > +
> > +    public void trace( Marker marker, String format, Object arg1,
> Object arg2 )
> > +    {
> > +        trace( format, arg1, arg2 );
> > +    }
> > +
> > +    public void trace( Marker marker, String format, Object[] argArray )
> > +    {
> > +        trace( format, argArray );
> > +    }
> > +
> > +    public void trace( Marker marker, String msg, Throwable t )
> > +    {
> > +        trace( msg, t );
> > +    }
> > +
> > +    public boolean isDebugEnabled()
> > +    {
> > +        return logger.isDebugEnabled();
> > +    }
> > +
> > +    public void debug( String msg )
> > +    {
> > +        logger.debug( msg );
> > +    }
> > +
> > +    public void debug( String format, Object arg )
> > +    {
> > +        FormattingTuple ft = MessageFormatter.format( format, arg );
> > +        logger.debug( ft.getMessage(), ft.getThrowable() );
> > +    }
> > +
> > +    public void debug( String format, Object arg1, Object arg2 )
> > +    {
> > +        FormattingTuple ft = MessageFormatter.format( format, arg1,
> arg2 );
> > +        logger.debug( ft.getMessage(), ft.getThrowable() );
> > +    }
> > +
> > +    public void debug( String format, Object[] argArray )
> > +    {
> > +        FormattingTuple ft = MessageFormatter.arrayFormat( format,
> argArray );
> > +        logger.debug( ft.getMessage(), ft.getThrowable() );
> > +    }
> > +
> > +    public void debug( String msg, Throwable t )
> > +    {
> > +        logger.debug( msg, t );
> > +    }
> > +
> > +    public boolean isDebugEnabled( Marker marker )
> > +    {
> > +        return isDebugEnabled();
> > +    }
> > +
> > +    public void debug( Marker marker, String msg )
> > +    {
> > +        debug( msg );
> > +    }
> > +
> > +    public void debug( Marker marker, String format, Object arg )
> > +    {
> > +        debug( format, arg );
> > +    }
> > +
> > +    public void debug( Marker marker, String format, Object arg1,
> Object arg2 )
> > +    {
> > +        debug( format, arg1, arg2 );
> > +    }
> > +
> > +    public void debug( Marker marker, String format, Object[] argArray )
> > +    {
> > +        debug( format, argArray );
> > +    }
> > +
> > +    public void debug( Marker marker, String msg, Throwable t )
> > +    {
> > +        debug( msg, t );
> > +    }
> > +
> > +    public boolean isInfoEnabled()
> > +    {
> > +        return logger.isInfoEnabled();
> > +    }
> > +
> > +    public void info( String msg )
> > +    {
> > +        logger.info( msg );
> > +    }
> > +
> > +    public void info( String format, Object arg )
> > +    {
> > +        FormattingTuple ft = MessageFormatter.format( format, arg );
> > +        logger.info( ft.getMessage(), ft.getThrowable() );
> > +    }
> > +
> > +    public void info( String format, Object arg1, Object arg2 )
> > +    {
> > +        FormattingTuple ft = MessageFormatter.format( format, arg1,
> arg2 );
> > +        logger.info( ft.getMessage(), ft.getThrowable() );
> > +    }
> > +
> > +    public void info( String format, Object[] argArray )
> > +    {
> > +        FormattingTuple ft = MessageFormatter.arrayFormat( format,
> argArray );
> > +        logger.info( ft.getMessage(), ft.getThrowable() );
> > +    }
> > +
> > +    public void info( String msg, Throwable t )
> > +    {
> > +        logger.info( msg, t );
> > +    }
> > +
> > +    public boolean isInfoEnabled( Marker marker )
> > +    {
> > +        return isInfoEnabled();
> > +    }
> > +
> > +    public void info( Marker marker, String msg )
> > +    {
> > +        info( msg );
> > +    }
> > +
> > +    public void info( Marker marker, String format, Object arg )
> > +    {
> > +        info( format, arg );
> > +    }
> > +
> > +    public void info( Marker marker, String format, Object arg1, Object
> arg2 )
> > +    {
> > +        info( format, arg1, arg2 );
> > +    }
> > +
> > +    public void info( Marker marker, String format, Object[] argArray )
> > +    {
> > +        info( format, argArray );
> > +    }
> > +
> > +    public void info( Marker marker, String msg, Throwable t )
> > +    {
> > +        info( msg, t );
> > +    }
> > +
> > +    public boolean isWarnEnabled()
> > +    {
> > +        return logger.isWarnEnabled();
> > +    }
> > +
> > +    public void warn( String msg )
> > +    {
> > +        logger.warn( msg );
> > +    }
> > +
> > +    public void warn( String format, Object arg )
> > +    {
> > +        FormattingTuple ft = MessageFormatter.format( format, arg );
> > +        logger.warn( ft.getMessage(), ft.getThrowable() );
> > +    }
> > +
> > +    public void warn( String format, Object arg1, Object arg2 )
> > +    {
> > +        FormattingTuple ft = MessageFormatter.format( format, arg1,
> arg2 );
> > +        logger.warn( ft.getMessage(), ft.getThrowable() );
> > +    }
> > +
> > +    public void warn( String format, Object[] argArray )
> > +    {
> > +        FormattingTuple ft = MessageFormatter.arrayFormat( format,
> argArray );
> > +        logger.warn( ft.getMessage(), ft.getThrowable() );
> > +    }
> > +
> > +    public void warn( String msg, Throwable t )
> > +    {
> > +        logger.warn( msg, t );
> > +    }
> > +
> > +    public boolean isWarnEnabled( Marker marker )
> > +    {
> > +        return isWarnEnabled();
> > +    }
> > +
> > +    public void warn( Marker marker, String msg )
> > +    {
> > +        warn( msg );
> > +    }
> > +
> > +    public void warn( Marker marker, String format, Object arg )
> > +    {
> > +        warn( format, arg );
> > +    }
> > +
> > +    public void warn( Marker marker, String format, Object arg1, Object
> arg2 )
> > +    {
> > +        warn( format, arg1, arg2 );
> > +    }
> > +
> > +    public void warn( Marker marker, String format, Object[] argArray )
> > +    {
> > +        warn( format, argArray );
> > +    }
> > +
> > +    public void warn( Marker marker, String msg, Throwable t )
> > +    {
> > +        warn( msg, t );
> > +    }
> > +
> > +    public boolean isErrorEnabled()
> > +    {
> > +        return logger.isErrorEnabled();
> > +    }
> > +
> > +    public void error( String msg )
> > +    {
> > +        logger.error( msg );
> > +    }
> > +
> > +    public void error( String format, Object arg )
> > +    {
> > +        FormattingTuple ft = MessageFormatter.format( format, arg );
> > +        logger.error( ft.getMessage(), ft.getThrowable() );
> > +    }
> > +
> > +    public void error( String format, Object arg1, Object arg2 )
> > +    {
> > +        FormattingTuple ft = MessageFormatter.format( format, arg1,
> arg2 );
> > +        logger.error( ft.getMessage(), ft.getThrowable() );
> > +    }
> > +
> > +    public void error( String format, Object[] argArray )
> > +    {
> > +        FormattingTuple ft = MessageFormatter.arrayFormat( format,
> argArray );
> > +        logger.error( ft.getMessage(), ft.getThrowable() );
> > +    }
> > +
> > +    public void error( String msg, Throwable t )
> > +    {
> > +        logger.error( msg, t );
> > +    }
> > +
> > +    public boolean isErrorEnabled( Marker marker )
> > +    {
> > +        return isErrorEnabled();
> > +    }
> > +
> > +    public void error( Marker marker, String msg )
> > +    {
> > +        error( msg );
> > +    }
> > +
> > +    public void error( Marker marker, String format, Object arg )
> > +    {
> > +        error( format, arg );
> > +    }
> > +
> > +    public void error( Marker marker, String format, Object arg1,
> Object arg2 )
> > +    {
> > +        error( format, arg1, arg2 );
> > +    }
> > +
> > +    public void error( Marker marker, String format, Object[] argArray )
> > +    {
> > +        error( format, argArray );
> > +    }
> > +
> > +    public void error( Marker marker, String msg, Throwable t )
> > +    {
> > +        error( msg, t );
> > +    }
> > +
> > +}
> >
> > Added:
> >
> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLoggerFactory.java
> > URL:
> >
> http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLoggerFactory.java?rev=1380105&view=auto
> >
> ==============================================================================
> > ---
> >
> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLoggerFactory.java
> > (added)
> > +++
> >
> maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/PlexusLoggerFactory.java
> > Mon Sep  3 01:07:31 2012
> > @@ -0,0 +1,50 @@
> > +package org.apache.maven.cli;
> > +
> > +/*
> > + * Licensed to the Apache Software Foundation (ASF) under one
> > + * or more contributor license agreements.  See the NOTICE file
> > + * distributed with this work for additional information
> > + * regarding copyright ownership.  The ASF licenses this file
> > + * to you under the Apache License, Version 2.0 (the
> > + * "License"); you may not use this file except in compliance
> > + * with the License.  You may obtain a copy of the License at
> > + *
> > + *  http://www.apache.org/licenses/LICENSE-2.0
> > + *
> > + * Unless required by applicable law or agreed to in writing,
> > + * software distributed under the License is distributed on an
> > + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> > + * KIND, either express or implied.  See the License for the
> > + * specific language governing permissions and limitations
> > + * under the License.
> > + */
> > +
> > +import org.codehaus.plexus.logging.LoggerManager;
> > +import org.slf4j.ILoggerFactory;
> > +import org.slf4j.Logger;
> > +
> > +/**
> > + * A Slf4j logger factory bridged onto a Plexus logger manager.
> > + */
> > +public class PlexusLoggerFactory
> > +    implements ILoggerFactory
> > +{
> > +
> > +    private LoggerManager loggerManager;
> > +
> > +    public PlexusLoggerFactory( LoggerManager loggerManager )
> > +    {
> > +        this.loggerManager = loggerManager;
> > +    }
> > +
> > +    public void setLoggerManager( LoggerManager loggerManager )
> > +    {
> > +        this.loggerManager = loggerManager;
> > +    }
> > +
> > +    public Logger getLogger( String name )
> > +    {
> > +        return new PlexusLogger( loggerManager.getLoggerForComponent(
> name,
> > null ) );
> > +    }
> > +
> > +}
> >
> > Modified: maven/maven-3/trunk/pom.xml
> > URL:
> >
> http://svn.apache.org/viewvc/maven/maven-3/trunk/pom.xml?rev=1380105&r1=1380104&r2=1380105&view=diff
> >
> ==============================================================================
> > --- maven/maven-3/trunk/pom.xml (original)
> > +++ maven/maven-3/trunk/pom.xml Mon Sep  3 01:07:31 2012
> > @@ -56,6 +56,7 @@
> >      <modelloVersion>1.4.1</modelloVersion>
> >      <jxpathVersion>1.3</jxpathVersion>
> >      <aetherVersion>1.13.1</aetherVersion>
> > +    <slf4jVersion>1.6.1</slf4jVersion>
> >
> >
> <maven.test.redirectTestOutputToFile>true</maven.test.redirectTestOutputToFile>
> >      <!-- Control the name of the distribution and information output by
> mvn
> > -->
> >      <distributionId>apache-maven</distributionId>
> > @@ -203,6 +204,17 @@
> >          <artifactId>plexus-interpolation</artifactId>
> >          <version>${plexusInterpolationVersion}</version>
> >        </dependency>
> > +      <dependency>
> > +        <groupId>org.slf4j</groupId>
> > +        <artifactId>slf4j-api</artifactId>
> > +        <version>${slf4jVersion}</version>
> > +      </dependency>
> > +      <dependency>
> > +        <groupId>org.slf4j</groupId>
> > +        <artifactId>slf4j-nop</artifactId>
> > +        <version>${slf4jVersion}</version>
> > +        <scope>runtime</scope>
> > +      </dependency>
> >        <!--  Wagon -->
> >        <dependency>
> >          <groupId>org.apache.maven.wagon</groupId>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>