You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sl...@apache.org on 2022/08/23 15:03:50 UTC

[maven] branch MNG-7531 updated (428966ac2 -> d54576822)

This is an automated email from the ASF dual-hosted git repository.

slachiewicz pushed a change to branch MNG-7531
in repository https://gitbox.apache.org/repos/asf/maven.git


 discard 428966ac2 [MNG-7531] Upgrade to SLF4J 2.0.0
 discard 05d1f5581 [MNG-7502] Upgrade to Guice 5.1.0
     add 29c53d674 [MNG-7193] Introduce MAVEN_ARGS environment variable
     add b762fa9d5 [3.9.x] [MNG-7401] [MNG-7474] Keep a single maven session and fix session scope (#743)
     new d54576822 [MNG-7531] Upgrade to SLF4J 2.0.0

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (428966ac2)
            \
             N -- N -- N   refs/heads/MNG-7531 (d54576822)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 apache-maven/src/bin/mvn                           |   3 +-
 apache-maven/src/bin/mvn.cmd                       |   3 +-
 apache-maven/src/bin/mvnDebug                      |   1 +
 apache-maven/src/bin/mvnDebug.cmd                  |   1 +
 apache-maven/src/bin/mvnyjp                        |   1 +
 .../src/main/appended-resources/META-INF/NOTICE.vm |   5 +-
 .../licenses/unrecognized-aopalliance-1.0.txt      |   1 -
 maven-core/pom.xml                                 |   1 +
 .../org/apache/maven/execution/MavenSession.java   |  20 ++-
 .../lifecycle/internal/BuildListCalculator.java    |   7 +-
 .../lifecycle/internal/LifecycleModuleBuilder.java |  10 --
 .../maven/lifecycle/internal/LifecycleStarter.java |   4 +-
 .../maven/lifecycle/internal/ReactorContext.java   |  14 +-
 .../maven/session/scope/internal/SessionScope.java | 148 +++++++++------------
 .../internal/BuildListCalculatorTest.java          |   5 +
 .../internal/LifecycleModuleBuilderTest.java       | 101 ++++++++++++++
 maven-embedder/pom.xml                             |   5 +
 maven-model-builder/pom.xml                        |   1 +
 maven-resolver-provider/pom.xml                    |   1 +
 pom.xml                                            |   4 +-
 20 files changed, 207 insertions(+), 129 deletions(-)
 delete mode 100644 apache-maven/src/main/appended-resources/licenses/unrecognized-aopalliance-1.0.txt
 create mode 100644 maven-core/src/test/java/org/apache/maven/lifecycle/internal/LifecycleModuleBuilderTest.java


[maven] 01/01: [MNG-7531] Upgrade to SLF4J 2.0.0

Posted by sl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

slachiewicz pushed a commit to branch MNG-7531
in repository https://gitbox.apache.org/repos/asf/maven.git

commit d54576822151e89b51381c839529e6af6b24ad87
Author: Sylwester Lachiewicz <sl...@apache.org>
AuthorDate: Tue Aug 23 16:46:31 2022 +0200

    [MNG-7531] Upgrade to SLF4J 2.0.0
---
 ...lf4j-api-1.7.36.txt => MIT-slf4j-api-2.0.0.txt} |   4 +-
 .../cli/logging/impl/Slf4jSimpleConfiguration.java |   2 +-
 .../{impl => simple}/MavenSlf4jSimpleFriend.java   |   2 +-
 .../META-INF/maven/slf4j-configuration.properties  |   4 +-
 maven-slf4j-provider/pom.xml                       |   4 +-
 .../java/org/slf4j/impl/MavenSimpleLogger.java     | 120 ---------
 .../java/org/slf4j/simple/MavenSimpleLogger.java   | 269 +++++++++++++++++++++
 .../{impl => simple}/MavenSimpleLoggerFactory.java |   4 +-
 .../MavenSimpleServiceProvider.java}               |  77 +++---
 .../services/org.slf4j.spi.SLF4JServiceProvider    |   1 +
 pom.xml                                            |   3 +-
 11 files changed, 318 insertions(+), 172 deletions(-)

diff --git a/apache-maven/src/main/appended-resources/licenses/MIT-slf4j-api-1.7.36.txt b/apache-maven/src/main/appended-resources/licenses/MIT-slf4j-api-2.0.0.txt
similarity index 90%
rename from apache-maven/src/main/appended-resources/licenses/MIT-slf4j-api-1.7.36.txt
rename to apache-maven/src/main/appended-resources/licenses/MIT-slf4j-api-2.0.0.txt
index 712cd8c14..8daf2be5c 100644
--- a/apache-maven/src/main/appended-resources/licenses/MIT-slf4j-api-1.7.36.txt
+++ b/apache-maven/src/main/appended-resources/licenses/MIT-slf4j-api-2.0.0.txt
@@ -1,6 +1,6 @@
-https://raw.githubusercontent.com/qos-ch/slf4j/v_1.7.32/LICENSE.txt
+https://raw.githubusercontent.com/qos-ch/slf4j/v_2.0.0/LICENSE.txt
 
-Copyright (c) 2004-2017 QOS.ch
+Copyright (c) 2004-2022 QOS.ch Sarl (Switzerland)
 All rights reserved.
 
 Permission is hereby granted, free  of charge, to any person obtaining
diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/logging/impl/Slf4jSimpleConfiguration.java b/maven-embedder/src/main/java/org/apache/maven/cli/logging/impl/Slf4jSimpleConfiguration.java
index 3961059db..b0eff7bab 100644
--- a/maven-embedder/src/main/java/org/apache/maven/cli/logging/impl/Slf4jSimpleConfiguration.java
+++ b/maven-embedder/src/main/java/org/apache/maven/cli/logging/impl/Slf4jSimpleConfiguration.java
@@ -21,7 +21,7 @@ package org.apache.maven.cli.logging.impl;
 
 import org.apache.maven.cli.logging.BaseSlf4jConfiguration;
 import org.slf4j.MavenSlf4jFriend;
-import org.slf4j.impl.MavenSlf4jSimpleFriend;
+import org.slf4j.simple.MavenSlf4jSimpleFriend;
 
 /**
  * Configuration for slf4j-simple.
diff --git a/maven-embedder/src/main/java/org/slf4j/impl/MavenSlf4jSimpleFriend.java b/maven-embedder/src/main/java/org/slf4j/simple/MavenSlf4jSimpleFriend.java
similarity index 98%
rename from maven-embedder/src/main/java/org/slf4j/impl/MavenSlf4jSimpleFriend.java
rename to maven-embedder/src/main/java/org/slf4j/simple/MavenSlf4jSimpleFriend.java
index bffd18c67..1b6ee890d 100644
--- a/maven-embedder/src/main/java/org/slf4j/impl/MavenSlf4jSimpleFriend.java
+++ b/maven-embedder/src/main/java/org/slf4j/simple/MavenSlf4jSimpleFriend.java
@@ -1,4 +1,4 @@
-package org.slf4j.impl;
+package org.slf4j.simple;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
diff --git a/maven-embedder/src/main/resources/META-INF/maven/slf4j-configuration.properties b/maven-embedder/src/main/resources/META-INF/maven/slf4j-configuration.properties
index ff865bcca..85c7d0200 100644
--- a/maven-embedder/src/main/resources/META-INF/maven/slf4j-configuration.properties
+++ b/maven-embedder/src/main/resources/META-INF/maven/slf4j-configuration.properties
@@ -17,7 +17,7 @@
 
 # key = Slf4j effective logger factory implementation
 # value = corresponding o.a.m.cli.logging.Slf4jConfiguration class
-org.slf4j.impl.SimpleLoggerFactory org.apache.maven.cli.logging.impl.Slf4jSimpleConfiguration
-org.slf4j.impl.MavenSimpleLoggerFactory org.apache.maven.cli.logging.impl.Slf4jSimpleConfiguration
+org.slf4j.simple.SimpleLoggerFactory org.apache.maven.cli.logging.impl.Slf4jSimpleConfiguration
+org.slf4j.simple.MavenSimpleLoggerFactory org.apache.maven.cli.logging.impl.Slf4jSimpleConfiguration
 org.apache.logging.slf4j.Log4jLoggerFactory org.apache.maven.cli.logging.impl.Log4j2Configuration
 ch.qos.logback.classic.LoggerContext org.apache.maven.cli.logging.impl.LogbackConfiguration
diff --git a/maven-slf4j-provider/pom.xml b/maven-slf4j-provider/pom.xml
index 1ffc40f58..37d27068d 100644
--- a/maven-slf4j-provider/pom.xml
+++ b/maven-slf4j-provider/pom.xml
@@ -62,8 +62,8 @@ under the License.
               <classifier>sources</classifier>
               <overWrite>false</overWrite>
               <outputDirectory>${project.build.directory}/generated-sources/slf4j-simple</outputDirectory>
-              <includes>org/slf4j/impl/*.java</includes>
-              <excludes>org/slf4j/impl/StaticLoggerBinder*</excludes>
+              <includes>org/slf4j/simple/*.java</includes>
+              <excludes>org/slf4j/simple/SimpleServiceProvider*</excludes>
             </artifactItem>
           </artifactItems>
         </configuration>
diff --git a/maven-slf4j-provider/src/main/java/org/slf4j/impl/MavenSimpleLogger.java b/maven-slf4j-provider/src/main/java/org/slf4j/impl/MavenSimpleLogger.java
deleted file mode 100644
index 9366687ed..000000000
--- a/maven-slf4j-provider/src/main/java/org/slf4j/impl/MavenSimpleLogger.java
+++ /dev/null
@@ -1,120 +0,0 @@
-package org.slf4j.impl;
-
-/*
- * 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 static org.apache.maven.shared.utils.logging.MessageUtils.level;
-import static org.apache.maven.shared.utils.logging.MessageUtils.buffer;
-
-import java.io.PrintStream;
-
-/**
- * Logger for Maven, that support colorization of levels and stacktraces.
- * This class implements 2 methods introduced in slf4j-simple provider local copy.
- * @since 3.5.0
- */
-public class MavenSimpleLogger
-    extends SimpleLogger
-{
-    MavenSimpleLogger( String name )
-    {
-        super( name );
-    }
-
-    @Override
-    protected String renderLevel( int level )
-    {
-        switch ( level )
-        {
-            case LOG_LEVEL_TRACE:
-                return level().debug( "TRACE" ).toString();
-            case LOG_LEVEL_DEBUG:
-                return level().debug( "DEBUG" ).toString();
-            case LOG_LEVEL_INFO:
-                return level().info( "INFO" ).toString();
-            case LOG_LEVEL_WARN:
-                return level().warning( "WARNING" ).toString();
-            case LOG_LEVEL_ERROR:
-            default:
-                return level().error( "ERROR" ).toString();
-        }
-    }
-
-    @Override
-    protected void writeThrowable( Throwable t, PrintStream stream )
-    {
-        if ( t == null )
-        {
-            return;
-        }
-        stream.print( buffer().failure( t.getClass().getName() ) );
-        if ( t.getMessage() != null )
-        {
-            stream.print( ": " );
-            stream.print( buffer().failure( t.getMessage() ) );
-        }
-        stream.println();
-
-        while ( t != null )
-        {
-            for ( StackTraceElement e : t.getStackTrace() )
-            {
-                stream.print( "    " );
-                stream.print( buffer().strong( "at" ) );
-                stream.print( " " + e.getClassName() + "." + e.getMethodName() );
-                stream.print( buffer().a( " (" ).strong( getLocation( e ) ).a( ")" ) );
-                stream.println();
-            }
-
-            t = t.getCause();
-            if ( t != null )
-            {
-                stream.print( buffer().strong( "Caused by" ).a( ": " ).a( t.getClass().getName() ) );
-                if ( t.getMessage() != null )
-                {
-                    stream.print( ": " );
-                    stream.print( buffer().failure( t.getMessage() ) );
-                }
-                stream.println();
-            }
-        }
-    }
-
-    protected String getLocation( final StackTraceElement e )
-    {
-        assert e != null;
-
-        if ( e.isNativeMethod() )
-        {
-            return "Native Method";
-        }
-        else if ( e.getFileName() == null )
-        {
-            return "Unknown Source";
-        }
-        else if ( e.getLineNumber() >= 0 )
-        {
-            return String.format( "%s:%s", e.getFileName(), e.getLineNumber() );
-        }
-        else
-        {
-            return e.getFileName();
-        }
-    }
-}
diff --git a/maven-slf4j-provider/src/main/java/org/slf4j/simple/MavenSimpleLogger.java b/maven-slf4j-provider/src/main/java/org/slf4j/simple/MavenSimpleLogger.java
new file mode 100644
index 000000000..22b727bf3
--- /dev/null
+++ b/maven-slf4j-provider/src/main/java/org/slf4j/simple/MavenSimpleLogger.java
@@ -0,0 +1,269 @@
+package org.slf4j.simple;
+
+/*
+ * 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 java.io.PrintStream;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import org.slf4j.Marker;
+import org.slf4j.event.Level;
+import org.slf4j.event.LoggingEvent;
+import org.slf4j.helpers.MessageFormatter;
+import org.slf4j.helpers.NormalizedParameters;
+
+import static org.apache.maven.shared.utils.logging.MessageUtils.buffer;
+import static org.apache.maven.shared.utils.logging.MessageUtils.level;
+
+/**
+ * Logger for Maven, that support colorization of levels and stacktraces.
+ * This class implements 2 methods introduced in slf4j-simple provider local copy.
+ *
+ * @since 3.5.0
+ */
+public class MavenSimpleLogger
+        extends SimpleLogger
+{
+
+    private static final long START_TIME = System.currentTimeMillis();
+    private transient String shortLogName = null;
+
+    MavenSimpleLogger( String name )
+    {
+        super( name );
+    }
+
+    /**
+     * This is our internal implementation for logging regular (non-parameterized)
+     * log messages.
+     *
+     * @param level          One of the LOG_LEVEL_XXX constants defining the log level
+     * @param messagePattern The message itself
+     * @param t              The exception whose stack trace should be logged
+     */
+    @Override
+    protected void handleNormalizedLoggingCall( Level level, Marker marker, String messagePattern, Object[] arguments,
+                                                Throwable t )
+    {
+
+        List<Marker> markers = null;
+
+        if ( marker != null )
+        {
+            markers = new ArrayList<>();
+            markers.add( marker );
+        }
+
+        innerHandleNormalizedLoggingCall( level, markers, messagePattern, arguments, t );
+    }
+
+    public void log( LoggingEvent event )
+    {
+        int levelInt = event.getLevel().toInt();
+
+        if ( !isLevelEnabled( levelInt ) )
+        {
+            return;
+        }
+
+        NormalizedParameters np = NormalizedParameters.normalize( event );
+
+        innerHandleNormalizedLoggingCall( event.getLevel(), event.getMarkers(), np.getMessage(), np.getArguments(),
+                event.getThrowable() );
+    }
+
+    private void innerHandleNormalizedLoggingCall( Level level, List<Marker> markers, String messagePattern,
+                                                   Object[] arguments, Throwable t )
+    {
+
+        StringBuilder buf = new StringBuilder( 32 );
+
+        // Append date-time if so configured
+        if ( CONFIG_PARAMS.showDateTime )
+        {
+            if ( CONFIG_PARAMS.dateFormatter != null )
+            {
+                buf.append( getFormattedDate() );
+                buf.append( SP );
+            }
+            else
+            {
+                buf.append( System.currentTimeMillis() - START_TIME );
+                buf.append( SP );
+            }
+        }
+
+        // Append current thread name if so configured
+        if ( CONFIG_PARAMS.showThreadName )
+        {
+            buf.append( '[' );
+            buf.append( Thread.currentThread().getName() );
+            buf.append( "] " );
+        }
+
+        if ( CONFIG_PARAMS.showThreadId )
+        {
+            buf.append( TID_PREFIX );
+            buf.append( Thread.currentThread().getId() );
+            buf.append( SP );
+        }
+
+        if ( CONFIG_PARAMS.levelInBrackets )
+        {
+            buf.append( '[' );
+        }
+
+        // Append a readable representation of the log level
+        buf.append( renderLevel( level ) );
+        if ( CONFIG_PARAMS.levelInBrackets )
+        {
+            buf.append( ']' );
+        }
+        buf.append( SP );
+
+        // Append the name of the log instance if so configured
+        if ( CONFIG_PARAMS.showShortLogName )
+        {
+            if ( shortLogName == null )
+            {
+                shortLogName = computeShortName();
+            }
+            buf.append( shortLogName ).append( " - " );
+        }
+        else if ( CONFIG_PARAMS.showLogName )
+        {
+            buf.append( String.valueOf( name ) ).append( " - " );
+        }
+
+        if ( markers != null )
+        {
+            buf.append( SP );
+            for ( Marker marker : markers )
+            {
+                buf.append( marker.getName() ).append( SP );
+            }
+        }
+
+        String formattedMessage = MessageFormatter.basicArrayFormat( messagePattern, arguments );
+
+        // Append the message
+        buf.append( formattedMessage );
+
+        write( buf, t );
+    }
+
+    //    @Override
+    protected String renderLevel( Level level )
+    {
+        switch ( level )
+        {
+            case TRACE:
+                return level().debug( "TRACE" );
+            case DEBUG:
+                return level().debug( "DEBUG" );
+            case INFO:
+                return level().info( "INFO" );
+            case WARN:
+                return level().warning( "WARNING" );
+            case ERROR:
+            default:
+                return level().error( "ERROR" );
+        }
+    }
+
+    @Override
+    protected void writeThrowable( Throwable t, PrintStream stream )
+    {
+        if ( t == null )
+        {
+            return;
+        }
+        stream.print( buffer().failure( t.getClass().getName() ) );
+        if ( t.getMessage() != null )
+        {
+            stream.print( ": " );
+            stream.print( buffer().failure( t.getMessage() ) );
+        }
+        stream.println();
+
+        while ( t != null )
+        {
+            for ( StackTraceElement e : t.getStackTrace() )
+            {
+                stream.print( "    " );
+                stream.print( buffer().strong( "at" ) );
+                stream.print( " " + e.getClassName() + "." + e.getMethodName() );
+                stream.print( buffer().a( " (" ).strong( getLocation( e ) ).a( ")" ) );
+                stream.println();
+            }
+
+            t = t.getCause();
+            if ( t != null )
+            {
+                stream.print( buffer().strong( "Caused by" ).a( ": " ).a( t.getClass().getName() ) );
+                if ( t.getMessage() != null )
+                {
+                    stream.print( ": " );
+                    stream.print( buffer().failure( t.getMessage() ) );
+                }
+                stream.println();
+            }
+        }
+    }
+
+    private String getLocation( final StackTraceElement e )
+    {
+        assert e != null;
+
+        if ( e.isNativeMethod() )
+        {
+            return "Native Method";
+        }
+        else if ( e.getFileName() == null )
+        {
+            return "Unknown Source";
+        }
+        else if ( e.getLineNumber() >= 0 )
+        {
+            return String.format( "%s:%s", e.getFileName(), e.getLineNumber() );
+        }
+        else
+        {
+            return e.getFileName();
+        }
+    }
+
+    private String computeShortName()
+    {
+        return name.substring( name.lastIndexOf( "." ) + 1 );
+    }
+
+    private String getFormattedDate()
+    {
+        Date now = new Date();
+        String dateText;
+        synchronized ( CONFIG_PARAMS.dateFormatter )
+        {
+            dateText = CONFIG_PARAMS.dateFormatter.format( now );
+        }
+        return dateText;
+    }
+}
diff --git a/maven-slf4j-provider/src/main/java/org/slf4j/impl/MavenSimpleLoggerFactory.java b/maven-slf4j-provider/src/main/java/org/slf4j/simple/MavenSimpleLoggerFactory.java
similarity index 95%
rename from maven-slf4j-provider/src/main/java/org/slf4j/impl/MavenSimpleLoggerFactory.java
rename to maven-slf4j-provider/src/main/java/org/slf4j/simple/MavenSimpleLoggerFactory.java
index 4adfdbe05..787c65a3f 100644
--- a/maven-slf4j-provider/src/main/java/org/slf4j/impl/MavenSimpleLoggerFactory.java
+++ b/maven-slf4j-provider/src/main/java/org/slf4j/simple/MavenSimpleLoggerFactory.java
@@ -1,4 +1,4 @@
-package org.slf4j.impl;
+package org.slf4j.simple;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -25,7 +25,7 @@ import org.slf4j.Logger;
  * MavenSimpleLoggerFactory
  */
 public class MavenSimpleLoggerFactory
-    extends SimpleLoggerFactory
+        extends SimpleLoggerFactory
 {
     /**
      * Return an appropriate {@link MavenSimpleLogger} instance by name.
diff --git a/maven-slf4j-provider/src/main/java/org/slf4j/impl/StaticLoggerBinder.java b/maven-slf4j-provider/src/main/java/org/slf4j/simple/MavenSimpleServiceProvider.java
similarity index 50%
rename from maven-slf4j-provider/src/main/java/org/slf4j/impl/StaticLoggerBinder.java
rename to maven-slf4j-provider/src/main/java/org/slf4j/simple/MavenSimpleServiceProvider.java
index ba01d8322..bfd903c5b 100644
--- a/maven-slf4j-provider/src/main/java/org/slf4j/impl/StaticLoggerBinder.java
+++ b/maven-slf4j-provider/src/main/java/org/slf4j/simple/MavenSimpleServiceProvider.java
@@ -1,4 +1,4 @@
-package org.slf4j.impl;
+package org.slf4j.simple;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -20,70 +20,65 @@ package org.slf4j.impl;
  */
 
 import org.slf4j.ILoggerFactory;
-import org.slf4j.spi.LoggerFactoryBinder;
+import org.slf4j.IMarkerFactory;
+import org.slf4j.helpers.BasicMarkerFactory;
+import org.slf4j.helpers.NOPMDCAdapter;
+import org.slf4j.spi.MDCAdapter;
+import org.slf4j.spi.SLF4JServiceProvider;
 
 /**
- * SLF4J LoggerFactoryBinder implementation using MavenSimpleLogger.
+ * SLF4J ServiceProvider implementation based on MavenSimpleLoggerFactory.
  * This class is part of the required classes used to specify an
  * SLF4J logger provider implementation.
+ * <p>
+ * Initialy introduced in 3.5.1
  *
- * @since 3.5.1
+ * @since 3.9.0
  */
-public final class StaticLoggerBinder
-    implements LoggerFactoryBinder
+public class MavenSimpleServiceProvider implements SLF4JServiceProvider
 {
     /**
-     * Declare the version of the SLF4J API this implementation is compiled
-     * against. The value of this field is usually modified with each release.
+     * Declare the version of the SLF4J API this implementation is compiled against.
+     * The value of this field is modified with each major release.
      */
     // to avoid constant folding by the compiler, this field must *not* be final
-    @SuppressWarnings( { "checkstyle:staticvariablename", "checkstyle:visibilitymodifier" } )
-    public static String REQUESTED_API_VERSION = "1.7.25"; // !final
+    @SuppressWarnings( {"checkstyle:staticvariablename", "checkstyle:visibilitymodifier"} )
+    public static String REQUESTED_API_VERSION = "2.0.99"; // !final
 
-    private static final String LOGGER_FACTORY_CLASS_STR = MavenSimpleLoggerFactory.class.getName();
+    private ILoggerFactory loggerFactory;
+    private IMarkerFactory markerFactory;
+    private MDCAdapter mdcAdapter;
 
-    /**
-     * The unique instance of this class.
-     */
-    private static final StaticLoggerBinder SINGLETON = new StaticLoggerBinder();
-
-    /**
-     * The ILoggerFactory instance returned by the {@link #getLoggerFactory}
-     * method should always be the same object
-     */
-    private final ILoggerFactory loggerFactory;
+    public ILoggerFactory getLoggerFactory()
+    {
+        return loggerFactory;
+    }
 
-    /**
-     * Private constructor to prevent instantiation
-     */
-    private StaticLoggerBinder()
+    @Override
+    public IMarkerFactory getMarkerFactory()
     {
-        loggerFactory = new MavenSimpleLoggerFactory();
+        return markerFactory;
     }
 
-    /**
-     * Returns the singleton of this class.
-     */
-    public static StaticLoggerBinder getSingleton()
+    @Override
+    public MDCAdapter getMDCAdapter()
     {
-        return SINGLETON;
+        return mdcAdapter;
     }
 
-    /**
-     * Returns the factory.
-     */
     @Override
-    public ILoggerFactory getLoggerFactory()
+    public String getRequestedApiVersion()
     {
-        return loggerFactory;
+        return REQUESTED_API_VERSION;
     }
 
-    /**
-     * Returns the class name.
-     */
     @Override
-    public String getLoggerFactoryClassStr()
+    public void initialize()
     {
-        return LOGGER_FACTORY_CLASS_STR;
+
+        loggerFactory = new MavenSimpleLoggerFactory();
+        markerFactory = new BasicMarkerFactory();
+        mdcAdapter = new NOPMDCAdapter();
     }
+
 }
diff --git a/maven-slf4j-provider/src/main/resources/META-INF/services/org.slf4j.spi.SLF4JServiceProvider b/maven-slf4j-provider/src/main/resources/META-INF/services/org.slf4j.spi.SLF4JServiceProvider
new file mode 100644
index 000000000..d52528d1b
--- /dev/null
+++ b/maven-slf4j-provider/src/main/resources/META-INF/services/org.slf4j.spi.SLF4JServiceProvider
@@ -0,0 +1 @@
+org.slf4j.simple.MavenSimpleServiceProvider
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index ae5e77637..a9261080b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -66,7 +66,7 @@ under the License.
     <modelloVersion>2.0.0</modelloVersion>
     <jxpathVersion>1.3</jxpathVersion>
     <resolverVersion>1.8.2</resolverVersion>
-    <slf4jVersion>1.7.36</slf4jVersion>
+    <slf4jVersion>2.0.0</slf4jVersion>
     <xmlunitVersion>2.2.1</xmlunitVersion>
     <powermockVersion>1.7.4</powermockVersion>
     <maven.test.redirectTestOutputToFile>true</maven.test.redirectTestOutputToFile>
@@ -600,6 +600,7 @@ under the License.
               -->
               <exclude>src/main/appended-resources/licenses/EPL-1.0.txt</exclude>
               <exclude>src/main/appended-resources/licenses/unrecognized-javax.annotation-api-1.3.2.txt</exclude>
+              <exclude>src/main/resources/META-INF/services/org.slf4j.spi.SLF4JServiceProvider</exclude>
             </excludes>
           </configuration>
         </plugin>