Skip to content

Commit bb29376

Browse files
committed
Clean up log4j-spring-cloud-config-client dependencies
We minimize the dependencies of `log4j-spring-cloud-config-client` to those really required: `spring-context` and `spring-cloud-context`. The dependency on `spring-boot-autoconfigure` is optional (its just used in annotations) and the artifact can be also used without Spring Boot. Fixes #2157.
1 parent 64226fe commit bb29376

File tree

3 files changed

+81
-70
lines changed

3 files changed

+81
-70
lines changed

log4j-parent/pom.xml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,9 @@
153153
<pax-exam.version>4.13.5</pax-exam.version>
154154
<plexus-utils.version>3.5.1</plexus-utils.version>
155155
<slf4j.version>2.0.10</slf4j.version>
156+
<spring-boot.version>3.2.1</spring-boot.version>
157+
<spring-cloud.version>4.1.0</spring-cloud.version>
158+
<spring-framework.version>6.1.2</spring-framework.version>
156159
<system-stubs.version>2.1.5</system-stubs.version>
157160
<tomcat-juli.version>10.1.17</tomcat-juli.version>
158161
<velocity.version>1.7</velocity.version>
@@ -268,6 +271,14 @@
268271
<scope>import</scope>
269272
</dependency>
270273

274+
<dependency>
275+
<groupId>org.springframework</groupId>
276+
<artifactId>spring-framework-bom</artifactId>
277+
<version>${spring-framework.version}</version>
278+
<type>pom</type>
279+
<scope>import</scope>
280+
</dependency>
281+
271282
<dependency>
272283
<groupId>org.eclipse.angus</groupId>
273284
<artifactId>angus-activation</artifactId>
@@ -813,6 +824,42 @@
813824
<version>${slf4j.version}</version>
814825
</dependency>
815826

827+
<dependency>
828+
<groupId>org.springframework.boot</groupId>
829+
<artifactId>spring-boot-autoconfigure</artifactId>
830+
<version>${spring-boot.version}</version>
831+
</dependency>
832+
833+
<dependency>
834+
<groupId>org.springframework.boot</groupId>
835+
<artifactId>spring-boot-starter-test</artifactId>
836+
<version>${spring-boot.version}</version>
837+
<exclusions>
838+
<exclusion>
839+
<groupId>org.springframework.boot</groupId>
840+
<artifactId>spring-boot-starter-logging</artifactId>
841+
</exclusion>
842+
</exclusions>
843+
</dependency>
844+
845+
<dependency>
846+
<groupId>org.springframework</groupId>
847+
<artifactId>spring-core</artifactId>
848+
<version>${spring-framework.version}</version>
849+
<exclusions>
850+
<exclusion>
851+
<groupId>org.springframework</groupId>
852+
<artifactId>spring-jcl</artifactId>
853+
</exclusion>
854+
</exclusions>
855+
</dependency>
856+
857+
<dependency>
858+
<groupId>org.springframework.cloud</groupId>
859+
<artifactId>spring-cloud-context</artifactId>
860+
<version>${spring-cloud.version}</version>
861+
</dependency>
862+
816863
<dependency>
817864
<groupId>uk.org.webcompere</groupId>
818865
<artifactId>system-stubs-core</artifactId>

log4j-spring-cloud-config-client/pom.xml

Lines changed: 24 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -38,79 +38,45 @@
3838
~ OSGi and JPMS options
3939
-->
4040
<bnd-module-name>org.apache.logging.log4j.spring.cloud.config.client</bnd-module-name>
41+
<bnd-extra-packages-options>
42+
<!-- Used only for annotations -->
43+
org.springframework.boot.autoconfigure;resolution:=optional
44+
</bnd-extra-packages-options>
4145
<bnd-extra-module-options>
46+
<!-- Optional dependencies should not be transitive -->
47+
spring.boot.autoconfigure;transitive=false,
4248
<!-- Filebased module names: MUST be static -->
4349
spring.cloud.context;substitute="spring-cloud-context";static=true;transitive=false
4450
</bnd-extra-module-options>
4551
<Fragment-Host>org.apache.logging.log4j.core</Fragment-Host>
46-
47-
<!-- dependency versions -->
48-
<spring-boot.version>3.2.1</spring-boot.version>
49-
<spring-cloud.version>2022.0.4</spring-cloud.version>
50-
5152
</properties>
5253

53-
<dependencyManagement>
54-
<dependencies>
55-
56-
<dependency>
57-
<groupId>org.springframework.boot</groupId>
58-
<artifactId>spring-boot-dependencies</artifactId>
59-
<version>${spring-boot.version}</version>
60-
<type>pom</type>
61-
<scope>import</scope>
62-
</dependency>
63-
64-
<dependency>
65-
<groupId>org.springframework.cloud</groupId>
66-
<artifactId>spring-cloud-dependencies</artifactId>
67-
<version>${spring-cloud.version}</version>
68-
<type>pom</type>
69-
<scope>import</scope>
70-
</dependency>
71-
72-
<dependency>
73-
<groupId>org.springframework.boot</groupId>
74-
<artifactId>spring-boot-starter-test</artifactId>
75-
<version>${spring-boot.version}</version>
76-
<exclusions>
77-
<exclusion>
78-
<groupId>org.springframework.boot</groupId>
79-
<artifactId>spring-boot-starter-logging</artifactId>
80-
</exclusion>
81-
</exclusions>
82-
</dependency>
83-
84-
</dependencies>
85-
</dependencyManagement>
86-
8754
<dependencies>
8855

56+
<dependency>
57+
<groupId>org.springframework.boot</groupId>
58+
<artifactId>spring-boot-autoconfigure</artifactId>
59+
<scope>provided</scope>
60+
</dependency>
61+
8962
<dependency>
9063
<groupId>org.apache.logging.log4j</groupId>
91-
<artifactId>log4j-core</artifactId>
64+
<artifactId>log4j-api</artifactId>
9265
</dependency>
9366

9467
<dependency>
95-
<groupId>org.springframework.cloud</groupId>
96-
<artifactId>spring-cloud-config-client</artifactId>
97-
<exclusions>
98-
<exclusion>
99-
<groupId>org.springframework</groupId>
100-
<artifactId>spring-jcl</artifactId>
101-
</exclusion>
102-
</exclusions>
68+
<groupId>org.apache.logging.log4j</groupId>
69+
<artifactId>log4j-core</artifactId>
10370
</dependency>
10471

10572
<dependency>
106-
<groupId>org.springframework.cloud</groupId>
107-
<artifactId>spring-cloud-starter-bootstrap</artifactId>
73+
<groupId>org.springframework</groupId>
74+
<artifactId>spring-context</artifactId>
10875
</dependency>
10976

11077
<dependency>
111-
<groupId>commons-logging</groupId>
112-
<artifactId>commons-logging</artifactId>
113-
<scope>runtime</scope>
78+
<groupId>org.springframework.cloud</groupId>
79+
<artifactId>spring-cloud-context</artifactId>
11480
</dependency>
11581

11682
<dependency>
@@ -120,33 +86,21 @@
12086
</dependency>
12187

12288
<dependency>
123-
<groupId>org.junit.vintage</groupId>
124-
<artifactId>junit-vintage-engine</artifactId>
89+
<groupId>org.apache.logging.log4j</groupId>
90+
<artifactId>log4j-jcl</artifactId>
12591
<scope>test</scope>
12692
</dependency>
12793

12894
<dependency>
129-
<groupId>org.springframework.boot</groupId>
130-
<artifactId>spring-boot-starter-test</artifactId>
95+
<groupId>junit</groupId>
96+
<artifactId>junit</artifactId>
13197
<scope>test</scope>
132-
<exclusions>
133-
<exclusion>
134-
<groupId>org.springframework</groupId>
135-
<artifactId>spring-jcl</artifactId>
136-
</exclusion>
137-
</exclusions>
13898
</dependency>
13999

140100
<dependency>
141101
<groupId>org.springframework.boot</groupId>
142-
<artifactId>spring-boot-starter-log4j2</artifactId>
102+
<artifactId>spring-boot-starter-test</artifactId>
143103
<scope>test</scope>
144-
<exclusions>
145-
<exclusion>
146-
<groupId>org.springframework</groupId>
147-
<artifactId>spring-jcl</artifactId>
148-
</exclusion>
149-
</exclusions>
150104
</dependency>
151105

152106
</dependencies>
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="2157" link="https://github.com/apache/logging-log4j2/pull/2157"/>
7+
<description format="asciidoc">
8+
Fix `log4j-spring-cloud-config-client` dependencies to include only those required.
9+
</description>
10+
</entry>

0 commit comments

Comments
 (0)