Skip to content

Commit 0469f89

Browse files
committed
Workaround Coursier/Ivy dependency resolution bug
Workaround a Coursier/Ivy dependency resolution bug that affects `log4j-slf4j-impl` and `log4j-mongodb3`. This bug also affects popular sites like MvnRepository (cf. [`log4j-mongodb3:2.22.0`](https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-mongodb3/2.22.0)). Closes #2065
1 parent 9bb87d1 commit 0469f89

File tree

2 files changed

+37
-5
lines changed

2 files changed

+37
-5
lines changed

log4j-slf4j-impl/pom.xml

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,19 @@
3131
<properties>
3232
<slf4j.version>1.7.36</slf4j.version>
3333
</properties>
34+
35+
<!-- Use explicit versions as a temporary workaround to a Coursier/Ivy bug:
36+
https://github.com/apache/logging-log4j2/issues/2065 -->
37+
<dependencyManagement>
38+
<dependencies>
39+
<dependency>
40+
<groupId>org.slf4j</groupId>
41+
<artifactId>slf4j-api</artifactId>
42+
<version>${slf4j.version}</version>
43+
</dependency>
44+
</dependencies>
45+
</dependencyManagement>
46+
3447
<dependencies>
3548
<dependency>
3649
<groupId>org.osgi</groupId>
@@ -54,6 +67,12 @@
5467
<groupId>org.apache.logging.log4j</groupId>
5568
<artifactId>log4j-api-test</artifactId>
5669
<scope>test</scope>
70+
<exclusions>
71+
<exclusion>
72+
<groupId>org.slf4j</groupId>
73+
<artifactId>slf4j-api</artifactId>
74+
</exclusion>
75+
</exclusions>
5776
</dependency>
5877
<dependency>
5978
<groupId>org.apache.logging.log4j</groupId>
@@ -64,6 +83,12 @@
6483
<groupId>org.apache.logging.log4j</groupId>
6584
<artifactId>log4j-to-slf4j</artifactId>
6685
<scope>test</scope>
86+
<exclusions>
87+
<exclusion>
88+
<groupId>org.slf4j</groupId>
89+
<artifactId>slf4j-api</artifactId>
90+
</exclusion>
91+
</exclusions>
6792
</dependency>
6893
<dependency>
6994
<groupId>org.apache.commons</groupId>
@@ -75,11 +100,6 @@
75100
<artifactId>commons-lang3</artifactId>
76101
<scope>test</scope>
77102
</dependency>
78-
<dependency>
79-
<groupId>org.hamcrest</groupId>
80-
<artifactId>hamcrest</artifactId>
81-
<scope>test</scope>
82-
</dependency>
83103
<dependency>
84104
<groupId>org.junit.jupiter</groupId>
85105
<artifactId>junit-jupiter-engine</artifactId>
@@ -93,6 +113,7 @@
93113
</dependencies>
94114
<build>
95115
<plugins>
116+
96117
<plugin>
97118
<groupId>org.apache.maven.plugins</groupId>
98119
<artifactId>maven-surefire-plugin</artifactId>
@@ -129,6 +150,7 @@
129150
</execution>
130151
</executions>
131152
</plugin>
153+
132154
</plugins>
133155
</build>
134156
</project>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<entry xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xmlns="http://logging.apache.org/log4j/changelog"
4+
xsi:schemaLocation="http://logging.apache.org/log4j/changelog https://logging.apache.org/log4j/changelog-0.1.2.xsd"
5+
type="fixed">
6+
<issue id="2065" link="https://github.com/apache/logging-log4j2/pull/2065"/>
7+
<description format="asciidoc">
8+
Workaround a Coursier/Ivy dependency resolution bug affecting `log4j-slf4j-impl` and `log4j-mongodb3`.
9+
</description>
10+
</entry>

0 commit comments

Comments
 (0)