You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by jv...@apache.org on 2013/03/18 19:10:30 UTC

[1/2] git commit: o using slf4j 1.7.4 which adds the method to clear the logger cache o update the code to use slf4j 1.7.4 o the logging failures in the embedded ITs are now fixed

o using slf4j 1.7.4 which adds the method to clear the logger cache
o update the code to use slf4j 1.7.4
o the logging failures in the embedded ITs are now fixed


Project: http://git-wip-us.apache.org/repos/asf/maven/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/cc2da2fa
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/cc2da2fa
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/cc2da2fa

Branch: refs/heads/master
Commit: cc2da2fabe0c89a975dd472661af5e3c7b1b7538
Parents: 4849df9
Author: Jason van Zyl <ja...@tesla.io>
Authored: Mon Mar 18 11:01:40 2013 -0700
Committer: Jason van Zyl <ja...@tesla.io>
Committed: Mon Mar 18 11:01:40 2013 -0700

----------------------------------------------------------------------
 .../cli/logging/impl/Slf4jSimpleConfiguration.java |   15 +++++++++++++++
 .../org/slf4j/impl/MavenSlf4jSimpleFriend.java     |    1 +
 pom.xml                                            |    2 +-
 3 files changed, 17 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven/blob/cc2da2fa/maven-embedder/src/main/java/org/apache/maven/cli/logging/impl/Slf4jSimpleConfiguration.java
----------------------------------------------------------------------
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 6a7f385..402d562 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
@@ -58,5 +58,20 @@ public class Slf4jSimpleConfiguration
         // property for root logger level or System.out redirection need to be taken into account
         MavenSlf4jFriend.reset();
         MavenSlf4jSimpleFriend.init();
+        
+        try
+        {
+             org.slf4j.ILoggerFactory loggerFactory = org.slf4j.LoggerFactory.getILoggerFactory();
+             synchronized ( loggerFactory )
+             {
+                 java.lang.reflect.Field loggerMap = loggerFactory.getClass().getDeclaredField( "loggerMap" );
+                 loggerMap.setAccessible( true );
+                 ( (java.util.Map) loggerMap.get( loggerFactory ) ).clear();
+             }
+        }
+        catch ( Exception e )
+        {
+            // ignore for now...
+        }        
     }
 }

http://git-wip-us.apache.org/repos/asf/maven/blob/cc2da2fa/maven-embedder/src/main/java/org/slf4j/impl/MavenSlf4jSimpleFriend.java
----------------------------------------------------------------------
diff --git a/maven-embedder/src/main/java/org/slf4j/impl/MavenSlf4jSimpleFriend.java b/maven-embedder/src/main/java/org/slf4j/impl/MavenSlf4jSimpleFriend.java
index 097ad68..3299fc8 100644
--- a/maven-embedder/src/main/java/org/slf4j/impl/MavenSlf4jSimpleFriend.java
+++ b/maven-embedder/src/main/java/org/slf4j/impl/MavenSlf4jSimpleFriend.java
@@ -28,5 +28,6 @@ public class MavenSlf4jSimpleFriend
     public static void init()
     {
         SimpleLogger.init();
+        SimpleLoggerFactory.INSTANCE.reset();
     }
 }

http://git-wip-us.apache.org/repos/asf/maven/blob/cc2da2fa/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index aab1179..7da7bec 100644
--- a/pom.xml
+++ b/pom.xml
@@ -59,7 +59,7 @@
     <modelloVersion>1.7</modelloVersion>
     <jxpathVersion>1.3</jxpathVersion>
     <aetherVersion>1.13.1</aetherVersion>
-    <slf4jVersion>1.7.2</slf4jVersion>
+    <slf4jVersion>1.7.4</slf4jVersion>
     <maven.test.redirectTestOutputToFile>true</maven.test.redirectTestOutputToFile>
     <!-- Control the name of the distribution and information output by mvn -->
     <distributionId>apache-maven</distributionId>