Skip to content

Commit f303f2d

Browse files
committed
Ban dependencies interfering with our tests
1 parent a73c4fa commit f303f2d

File tree

11 files changed

+151
-48
lines changed

11 files changed

+151
-48
lines changed

log4j-cassandra/pom.xml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -86,16 +86,6 @@
8686
<groupId>org.apache.cassandra</groupId>
8787
<artifactId>cassandra-all</artifactId>
8888
<scope>test</scope>
89-
<exclusions>
90-
<exclusion>
91-
<groupId>ch.qos.logback</groupId>
92-
<artifactId>logback-classic</artifactId>
93-
</exclusion>
94-
<exclusion>
95-
<groupId>ch.qos.logback</groupId>
96-
<artifactId>logback-core</artifactId>
97-
</exclusion>
98-
</exclusions>
9989
</dependency>
10090
<dependency>
10191
<groupId>org.apache.cassandra</groupId>

log4j-core-its/pom.xml

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -153,17 +153,6 @@
153153
<artifactId>log4j</artifactId>
154154
<scope>test</scope>
155155
</dependency>
156-
<dependency>
157-
<groupId>ch.qos.logback</groupId>
158-
<artifactId>logback-classic</artifactId>
159-
<scope>test</scope>
160-
</dependency>
161-
<!-- Logback performance tests -->
162-
<dependency>
163-
<groupId>ch.qos.logback</groupId>
164-
<artifactId>logback-core</artifactId>
165-
<scope>test</scope>
166-
</dependency>
167156
<!-- SLF4J tests -->
168157
<dependency>
169158
<groupId>org.slf4j</groupId>
@@ -179,7 +168,12 @@
179168
<dependency>
180169
<groupId>org.springframework</groupId>
181170
<artifactId>spring-test</artifactId>
182-
<scope>test</scope>
171+
<exclusions>
172+
<exclusion>
173+
<groupId>org.springframework</groupId>
174+
<artifactId>spring-jcl</artifactId>
175+
</exclusion>
176+
</exclusions>
183177
</dependency>
184178
</dependencies>
185179
<build>

log4j-core-test/pom.xml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,12 @@
108108
<dependency>
109109
<groupId>org.springframework</groupId>
110110
<artifactId>spring-test</artifactId>
111+
<exclusions>
112+
<exclusion>
113+
<groupId>org.springframework</groupId>
114+
<artifactId>spring-jcl</artifactId>
115+
</exclusion>
116+
</exclusions>
111117
</dependency>
112118
<!-- JNDI and JMS tests -->
113119
<dependency>
@@ -278,17 +284,6 @@
278284
<artifactId>kafka-clients</artifactId>
279285
<scope>test</scope>
280286
</dependency>
281-
<dependency>
282-
<groupId>ch.qos.logback</groupId>
283-
<artifactId>logback-classic</artifactId>
284-
<scope>test</scope>
285-
</dependency>
286-
<!-- Logback performance tests -->
287-
<dependency>
288-
<groupId>ch.qos.logback</groupId>
289-
<artifactId>logback-core</artifactId>
290-
<scope>test</scope>
291-
</dependency>
292287
<dependency>
293288
<groupId>org.apache.maven</groupId>
294289
<artifactId>maven-core</artifactId>

log4j-jakarta-web/pom.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,12 @@
8282
<dependency>
8383
<groupId>org.springframework</groupId>
8484
<artifactId>spring-test</artifactId>
85-
<scope>test</scope>
85+
<exclusions>
86+
<exclusion>
87+
<groupId>org.springframework</groupId>
88+
<artifactId>spring-jcl</artifactId>
89+
</exclusion>
90+
</exclusions>
8691
</dependency>
8792
</dependencies>
8893

log4j-osgi-test/pom.xml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -86,16 +86,6 @@
8686
<artifactId>junit-vintage-engine</artifactId>
8787
<scope>test</scope>
8888
</dependency>
89-
<dependency>
90-
<groupId>ch.qos.logback</groupId>
91-
<artifactId>logback-classic</artifactId>
92-
<scope>test</scope>
93-
</dependency>
94-
<dependency>
95-
<groupId>ch.qos.logback</groupId>
96-
<artifactId>logback-core</artifactId>
97-
<scope>test</scope>
98-
</dependency>
9989
<dependency>
10090
<groupId>org.apache.felix</groupId>
10191
<artifactId>org.apache.felix.framework</artifactId>

log4j-parent/pom.xml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,24 @@
326326
<groupId>org.apache.cassandra</groupId>
327327
<artifactId>cassandra-all</artifactId>
328328
<version>${cassandra.version}</version>
329+
<exclusions>
330+
<exclusion>
331+
<groupId>org.slf4j</groupId>
332+
<artifactId>jcl-over-slf4j</artifactId>
333+
</exclusion>
334+
<exclusion>
335+
<groupId>org.slf4j</groupId>
336+
<artifactId>log4j-over-slf4j</artifactId>
337+
</exclusion>
338+
<exclusion>
339+
<groupId>ch.qos.logback</groupId>
340+
<artifactId>logback-classic</artifactId>
341+
</exclusion>
342+
<exclusion>
343+
<groupId>ch.qos.logback</groupId>
344+
<artifactId>logback-core</artifactId>
345+
</exclusion>
346+
</exclusions>
329347
</dependency>
330348

331349
<dependency>
@@ -338,6 +356,16 @@
338356
<groupId>org.apache.cassandra</groupId>
339357
<artifactId>cassandra-thrift</artifactId>
340358
<version>${cassandra.version}</version>
359+
<exclusions>
360+
<exclusion>
361+
<groupId>org.slf4j</groupId>
362+
<artifactId>jcl-over-slf4j</artifactId>
363+
</exclusion>
364+
<exclusion>
365+
<groupId>org.slf4j</groupId>
366+
<artifactId>log4j-over-slf4j</artifactId>
367+
</exclusion>
368+
</exclusions>
341369
</dependency>
342370

343371
<dependency>
@@ -1077,6 +1105,45 @@
10771105

10781106
</plugins>
10791107
</pluginManagement>
1108+
1109+
<plugins>
1110+
<!--
1111+
~ Some external logging bridges can interfere with our tests, giving false negatives.
1112+
-->
1113+
<plugin>
1114+
<groupId>org.apache.maven.plugins</groupId>
1115+
<artifactId>maven-enforcer-plugin</artifactId>
1116+
<executions>
1117+
<execution>
1118+
<id>ban-logging-dependencies</id>
1119+
<goals>
1120+
<goal>enforce</goal>
1121+
</goals>
1122+
<configuration>
1123+
<rules>
1124+
<bannedDependencies>
1125+
<excludes>
1126+
<!-- JCL replacements -->
1127+
<exclude>org.slf4j:jcl-over-slf4j</exclude>
1128+
<exclude>org.springframework:spring-jcl</exclude>
1129+
<!-- Log4j 1.x replacements -->
1130+
<exclude>org.slf4j:log4j-over-slf4j</exclude>
1131+
<exclude>ch.qos.reload4j:reload4j</exclude>
1132+
<!-- Bridges to Log4j 1.x -->
1133+
<exclude>org.slf4j:slf4j-log4j12</exclude>
1134+
<exclude>org.slf4j:slf4j-reload4j</exclude>
1135+
<!-- PAX Logging just to be safe -->
1136+
<exclude>org.ops4j.pax.logging:*</exclude>
1137+
<!-- Logback -->
1138+
<exclude>ch.qos.logback:*</exclude>
1139+
</excludes>
1140+
</bannedDependencies>
1141+
</rules>
1142+
</configuration>
1143+
</execution>
1144+
</executions>
1145+
</plugin>
1146+
</plugins>
10801147
</build>
10811148

10821149
</project>

log4j-perf-test/pom.xml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,10 @@
120120
<dependency>
121121
<groupId>ch.qos.logback</groupId>
122122
<artifactId>logback-classic</artifactId>
123-
<scope>compile</scope>
124123
</dependency>
125124
<dependency>
126125
<groupId>ch.qos.logback</groupId>
127126
<artifactId>logback-core</artifactId>
128-
<scope>compile</scope>
129127
</dependency>
130128
<dependency>
131129
<groupId>org.eclipse.persistence</groupId>
@@ -144,6 +142,28 @@
144142
<build>
145143
<plugins>
146144

145+
<!--
146+
~ Unban Logback.
147+
-->
148+
<plugin>
149+
<groupId>org.apache.maven.plugins</groupId>
150+
<artifactId>maven-enforcer-plugin</artifactId>
151+
<executions>
152+
<execution>
153+
<id>ban-logging-dependencies</id>
154+
<configuration>
155+
<rules>
156+
<bannedDependencies>
157+
<includes>
158+
<include>ch.qos.logback:*</include>
159+
</includes>
160+
</bannedDependencies>
161+
</rules>
162+
</configuration>
163+
</execution>
164+
</executions>
165+
</plugin>
166+
147167
<plugin>
148168
<groupId>org.apache.maven.plugins</groupId>
149169
<artifactId>maven-shade-plugin</artifactId>

log4j-spring-boot/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@
5454
<dependency>
5555
<groupId>org.springframework</groupId>
5656
<artifactId>spring-core</artifactId>
57+
<exclusions>
58+
<exclusion>
59+
<groupId>org.springframework</groupId>
60+
<artifactId>spring-jcl</artifactId>
61+
</exclusion>
62+
</exclusions>
5763
</dependency>
5864
<dependency>
5965
<groupId>org.springframework</groupId>

log4j-taglib/pom.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,12 @@
8484
<dependency>
8585
<groupId>org.springframework</groupId>
8686
<artifactId>spring-test</artifactId>
87-
<scope>test</scope>
87+
<exclusions>
88+
<exclusion>
89+
<groupId>org.springframework</groupId>
90+
<artifactId>spring-jcl</artifactId>
91+
</exclusion>
92+
</exclusions>
8893
</dependency>
8994
</dependencies>
9095
</project>

log4j-to-slf4j/pom.xml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,30 @@
9696
<scope>test</scope>
9797
</dependency>
9898
</dependencies>
99+
100+
<build>
101+
<plugins>
102+
<!--
103+
~ Unban Logback.
104+
-->
105+
<plugin>
106+
<groupId>org.apache.maven.plugins</groupId>
107+
<artifactId>maven-enforcer-plugin</artifactId>
108+
<executions>
109+
<execution>
110+
<id>ban-logging-dependencies</id>
111+
<configuration>
112+
<rules>
113+
<bannedDependencies>
114+
<includes>
115+
<include>ch.qos.logback:*:*:*:test</include>
116+
</includes>
117+
</bannedDependencies>
118+
</rules>
119+
</configuration>
120+
</execution>
121+
</executions>
122+
</plugin>
123+
</plugins>
124+
</build>
99125
</project>

0 commit comments

Comments
 (0)