You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by bt...@apache.org on 2022/11/25 15:58:41 UTC

[james-project] branch master updated: JAMES-3862: Switch to SLF4J 2.0.x compatible Log4j Adapter. Copy log4j-core dependency jar to appassembler lib dir. (#1333)

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

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git


The following commit(s) were added to refs/heads/master by this push:
     new 57b73a0950 JAMES-3862: Switch to SLF4J 2.0.x compatible Log4j Adapter. Copy log4j-core dependency jar to appassembler lib dir. (#1333)
57b73a0950 is described below

commit 57b73a0950871ba061c32663ba0bb98f1a8f0749
Author: Bernd Bartke <bb...@users.noreply.github.com>
AuthorDate: Fri Nov 25 16:58:35 2022 +0100

    JAMES-3862: Switch to SLF4J 2.0.x compatible Log4j Adapter. Copy log4j-core dependency jar to appassembler lib dir. (#1333)
---
 pom.xml                         | 10 +++++++---
 server/apps/spring-app/pom.xml  | 28 +++++++++++++++++++++++++++-
 server/container/spring/pom.xml |  5 ++---
 3 files changed, 36 insertions(+), 7 deletions(-)

diff --git a/pom.xml b/pom.xml
index 3947601c50..e9ab5c9434 100644
--- a/pom.xml
+++ b/pom.xml
@@ -2596,13 +2596,17 @@
             </dependency>
             <dependency>
                 <groupId>org.apache.logging.log4j</groupId>
-                <artifactId>log4j</artifactId>
+                <artifactId>log4j-api</artifactId>
+                <version>${log4j2.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.logging.log4j</groupId>
+                <artifactId>log4j-core</artifactId>
                 <version>${log4j2.version}</version>
-                <type>pom</type>
             </dependency>
             <dependency>
                 <groupId>org.apache.logging.log4j</groupId>
-                <artifactId>log4j-slf4j-impl</artifactId>
+                <artifactId>log4j-slf4j2-impl</artifactId>
                 <version>${log4j2.version}</version>
             </dependency>
             <dependency>
diff --git a/server/apps/spring-app/pom.xml b/server/apps/spring-app/pom.xml
index f5cc698a87..a1b9634d5b 100644
--- a/server/apps/spring-app/pom.xml
+++ b/server/apps/spring-app/pom.xml
@@ -506,9 +506,18 @@
         </dependency>
         <dependency>
             <groupId>org.apache.logging.log4j</groupId>
-            <artifactId>log4j-slf4j-impl</artifactId>
+            <artifactId>log4j-api</artifactId>
             <scope>runtime</scope>
         </dependency>
+        <dependency>
+            <groupId>org.apache.logging.log4j</groupId>
+            <artifactId>log4j-core</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.logging.log4j</groupId>
+            <artifactId>log4j-slf4j2-impl</artifactId>
+        </dependency>
         <dependency>
             <groupId>org.apache.xbean</groupId>
             <artifactId>xbean-spring</artifactId>
@@ -850,6 +859,23 @@
                     </execution>
                 </executions>
             </plugin>
+            <!-- Copy runtime dependency log4j-core to appassembler/lib -->
+            <plugin>
+                <artifactId>maven-dependency-plugin</artifactId>
+                <configuration>
+                    <includeArtifactIds>log4j-core</includeArtifactIds>
+                    <includeScope>runtime</includeScope>
+                    <outputDirectory>${project.build.directory}/appassembler/lib</outputDirectory>
+                </configuration>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>copy-dependencies</goal>
+                        </goals>
+                        <phase>prepare-package</phase>
+                    </execution>
+                </executions>
+            </plugin>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
diff --git a/server/container/spring/pom.xml b/server/container/spring/pom.xml
index f5abc4e4a1..059f191448 100644
--- a/server/container/spring/pom.xml
+++ b/server/container/spring/pom.xml
@@ -157,12 +157,11 @@
         </dependency>
         <dependency>
             <groupId>org.apache.logging.log4j</groupId>
-            <artifactId>log4j</artifactId>
-            <type>pom</type>
+            <artifactId>log4j-api</artifactId>
         </dependency>
         <dependency>
             <groupId>org.apache.logging.log4j</groupId>
-            <artifactId>log4j-slf4j-impl</artifactId>
+            <artifactId>log4j-slf4j2-impl</artifactId>
         </dependency>
         <dependency>
             <groupId>org.slf4j</groupId>


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org