#41 Port to slf4j 2.0.0
Opened 5 months ago by mkoncek. Modified 5 months ago
rpms/ mkoncek/maven rawhide  into  rawhide

@@ -0,0 +1,110 @@ 

+ From 9c37d9ed62e0f881df445ee49772392d1a5a2356 Mon Sep 17 00:00:00 2001

+ From: Marian Koncek <mkoncek@redhat.com>

+ Date: Fri, 2 Sep 2022 12:49:45 +0200

+ Subject: [PATCH] Port to slf4j 2.0.0

+ 

+ ---

+  .../impl/Slf4jSimpleConfiguration.java        |  2 +-

+  .../MavenSlf4jSimpleFriend.java               |  2 +-

+  .../org/slf4j/impl/StaticLoggerBinder.java    |  2 ++

+  .../{impl => simple}/MavenSimpleLogger.java   | 21 +------------------

+  .../MavenSimpleLoggerFactory.java             |  2 +-

+  5 files changed, 6 insertions(+), 23 deletions(-)

+  rename maven-embedder/src/main/java/org/slf4j/{impl => simple}/MavenSlf4jSimpleFriend.java (98%)

+  rename maven-slf4j-provider/src/main/java/org/slf4j/{impl => simple}/MavenSimpleLogger.java (82%)

+  rename maven-slf4j-provider/src/main/java/org/slf4j/{impl => simple}/MavenSimpleLoggerFactory.java (98%)

+ 

+ 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 3961059..b0eff7b 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 bffd18c..1b6ee89 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-slf4j-provider/src/main/java/org/slf4j/impl/StaticLoggerBinder.java b/maven-slf4j-provider/src/main/java/org/slf4j/impl/StaticLoggerBinder.java

+ index ba01d83..5601c68 100644

+ --- a/maven-slf4j-provider/src/main/java/org/slf4j/impl/StaticLoggerBinder.java

+ +++ b/maven-slf4j-provider/src/main/java/org/slf4j/impl/StaticLoggerBinder.java

+ @@ -20,6 +20,8 @@ package org.slf4j.impl;

+   */

+  

+  import org.slf4j.ILoggerFactory;

+ +import org.slf4j.simple.MavenSimpleLogger;

+ +import org.slf4j.simple.MavenSimpleLoggerFactory;

+  import org.slf4j.spi.LoggerFactoryBinder;

+  

+  /**

+ diff --git a/maven-slf4j-provider/src/main/java/org/slf4j/impl/MavenSimpleLogger.java b/maven-slf4j-provider/src/main/java/org/slf4j/simple/MavenSimpleLogger.java

+ similarity index 82%

+ rename from maven-slf4j-provider/src/main/java/org/slf4j/impl/MavenSimpleLogger.java

+ rename to maven-slf4j-provider/src/main/java/org/slf4j/simple/MavenSimpleLogger.java

+ index 9366687..c84b1c5 100644

+ --- a/maven-slf4j-provider/src/main/java/org/slf4j/impl/MavenSimpleLogger.java

+ +++ b/maven-slf4j-provider/src/main/java/org/slf4j/simple/MavenSimpleLogger.java

+ @@ -1,4 +1,4 @@

+ -package org.slf4j.impl;

+ +package org.slf4j.simple;

+  

+  /*

+   * Licensed to the Apache Software Foundation (ASF) under one

+ @@ -37,25 +37,6 @@ public class MavenSimpleLogger

+          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 )

+      {

+ 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 98%

+ 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 4adfdbe..68a772f 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

+ -- 

+ 2.37.2

+ 

file modified
+6 -1
@@ -7,7 +7,7 @@ 

  Name:           maven

  Epoch:          1

  Version:        3.8.5

- Release:        3%{?dist}

+ Release:        4%{?dist}

  Summary:        Java project management and project comprehension tool

  # maven itself is ASL 2.0

  # bundled slf4j is MIT
@@ -30,6 +30,7 @@ 

  # XMvn needs to be ported to Maven 3.8.5

  # For now restore backwards compatibility with Maven 3.8.4

  Patch6:         0006-Restore-DefaultModelValidator-compatibility-with-Mav.patch

+ Patch7:         0007-Port-to-slf4j-2.0.0.patch

  

  %if %{with bootstrap}

  BuildRequires:  javapackages-bootstrap-openjdk8
@@ -158,6 +159,7 @@ 

  %patch4 -p1

  %patch5 -p1

  %patch6 -p1

+ %patch7 -p1

  

  # not really used during build, but a precaution

  find -name '*.jar' -not -path '*/test/*' -delete
@@ -299,6 +301,9 @@ 

  %config %{_javaconfdir}/maven.conf-openjdk17

  

  %changelog

+ * Fri Sep 02 2022 Marian Koncek <mkoncek@redhat.com> - 1:3.8.5-4

+ - Port to slf4j 2.0.0

+ 

  * Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.8.5-3

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild