Skip to content

Commit 196f92b

Browse files
committed
Exclude commons-logging to the extent that even Gradle’s happy
Gradle hasn’t different exclusion semantics to Maven. In Maven you can exclude spring-core’s commons-logging dependency once and it’ll be honoured even if you have multiple transitive routes to commons-logging via spring-core. In Gradle you have to exclude commons-logging from everything that has a transitive spring-core dependency. To make matters worse this doesn’t only apply to dependencies and exclusions declared in build.gradle but also to dependencies and exclusions declared in the pom files of the artifacts that a Gradle build depends upon. In short, to make our starters work as intended with Gradle, this commit adds many, many exclusions for commons-logging. It also removes commons-logging exclusions from spring-boot-dependencies’ <dependencyManagement> as they have no effect with Gradle and their presence can cause us to miss required exclusions in a starter Fixes #987
1 parent 9ad7a22 commit 196f92b

File tree

31 files changed

+509
-290
lines changed

31 files changed

+509
-290
lines changed

spring-boot-dependencies/pom.xml

-34
Original file line numberDiff line numberDiff line change
@@ -480,12 +480,6 @@
480480
<groupId>org.apache.httpcomponents</groupId>
481481
<artifactId>httpclient</artifactId>
482482
<version>${httpclient.version}</version>
483-
<exclusions>
484-
<exclusion>
485-
<groupId>commons-logging</groupId>
486-
<artifactId>commons-logging</artifactId>
487-
</exclusion>
488-
</exclusions>
489483
</dependency>
490484
<dependency>
491485
<groupId>org.apache.httpcomponents</groupId>
@@ -496,12 +490,6 @@
496490
<groupId>org.apache.httpcomponents</groupId>
497491
<artifactId>httpasyncclient</artifactId>
498492
<version>${httpasyncclient.version}</version>
499-
<exclusions>
500-
<exclusion>
501-
<groupId>commons-logging</groupId>
502-
<artifactId>commons-logging</artifactId>
503-
</exclusion>
504-
</exclusions>
505493
</dependency>
506494
<dependency>
507495
<groupId>org.apache.tomcat.embed</groupId>
@@ -547,12 +535,6 @@
547535
<groupId>org.apache.velocity</groupId>
548536
<artifactId>velocity-tools</artifactId>
549537
<version>${velocity-tools.version}</version>
550-
<exclusions>
551-
<exclusion>
552-
<groupId>commons-logging</groupId>
553-
<artifactId>commons-logging</artifactId>
554-
</exclusion>
555-
</exclusions>
556538
</dependency>
557539
<dependency>
558540
<groupId>org.aspectj</groupId>
@@ -673,12 +655,6 @@
673655
<groupId>org.crashub</groupId>
674656
<artifactId>crash.connectors.ssh</artifactId>
675657
<version>${crashub.version}</version>
676-
<exclusions>
677-
<exclusion>
678-
<groupId>commons-logging</groupId>
679-
<artifactId>commons-logging</artifactId>
680-
</exclusion>
681-
</exclusions>
682658
</dependency>
683659
<dependency>
684660
<groupId>org.crashub</groupId>
@@ -977,16 +953,6 @@
977953
<groupId>org.springframework.integration</groupId>
978954
<artifactId>spring-integration-http</artifactId>
979955
<version>${spring-integration.version}</version>
980-
<exclusions>
981-
<exclusion>
982-
<groupId>commons-logging</groupId>
983-
<artifactId>commons-logging</artifactId>
984-
</exclusion>
985-
<exclusion>
986-
<groupId>commons-logging</groupId>
987-
<artifactId>commons-logging-api</artifactId>
988-
</exclusion>
989-
</exclusions>
990956
</dependency>
991957
<dependency>
992958
<groupId>org.springframework.mobile</groupId>

spring-boot-starters/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
<rules>
7070
<bannedDependencies>
7171
<excludes>
72-
<exclude>commons-logging:commons-logging:*</exclude>
72+
<exclude>commons-logging:*:*</exclude>
7373
</excludes>
7474
<searchTransitive>true</searchTransitive>
7575
</bannedDependencies>

spring-boot-starters/spring-boot-starter-actuator/pom.xml

+8-6
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,19 @@
1818
<main.basedir>${basedir}/../..</main.basedir>
1919
</properties>
2020
<dependencies>
21-
<dependency>
22-
<groupId>org.springframework.boot</groupId>
23-
<artifactId>spring-boot-starter</artifactId>
24-
</dependency>
2521
<dependency>
2622
<groupId>org.springframework.boot</groupId>
2723
<artifactId>spring-boot-actuator</artifactId>
24+
<exclusions>
25+
<exclusion>
26+
<groupId>commons-logging</groupId>
27+
<artifactId>commons-logging</artifactId>
28+
</exclusion>
29+
</exclusions>
2830
</dependency>
2931
<dependency>
30-
<groupId>org.springframework</groupId>
31-
<artifactId>spring-core</artifactId>
32+
<groupId>org.springframework.boot</groupId>
33+
<artifactId>spring-boot-starter</artifactId>
3234
<exclusions>
3335
<exclusion>
3436
<groupId>commons-logging</groupId>

spring-boot-starters/spring-boot-starter-amqp/pom.xml

+8-6
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,19 @@
1818
<main.basedir>${basedir}/../..</main.basedir>
1919
</properties>
2020
<dependencies>
21-
<dependency>
22-
<groupId>org.springframework.boot</groupId>
23-
<artifactId>spring-boot-starter</artifactId>
24-
</dependency>
2521
<dependency>
2622
<groupId>org.springframework.amqp</groupId>
2723
<artifactId>spring-rabbit</artifactId>
24+
<exclusions>
25+
<exclusion>
26+
<groupId>commons-logging</groupId>
27+
<artifactId>commons-logging</artifactId>
28+
</exclusion>
29+
</exclusions>
2830
</dependency>
2931
<dependency>
30-
<groupId>org.springframework</groupId>
31-
<artifactId>spring-core</artifactId>
32+
<groupId>org.springframework.boot</groupId>
33+
<artifactId>spring-boot-starter</artifactId>
3234
<exclusions>
3335
<exclusion>
3436
<groupId>commons-logging</groupId>

spring-boot-starters/spring-boot-starter-aop/pom.xml

+15-13
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,16 @@
1919
</properties>
2020
<dependencies>
2121
<dependency>
22-
<groupId>org.springframework.boot</groupId>
23-
<artifactId>spring-boot-starter</artifactId>
22+
<groupId>org.aspectj</groupId>
23+
<artifactId>aspectjrt</artifactId>
24+
</dependency>
25+
<dependency>
26+
<groupId>org.aspectj</groupId>
27+
<artifactId>aspectjweaver</artifactId>
2428
</dependency>
2529
<dependency>
2630
<groupId>org.springframework</groupId>
27-
<artifactId>spring-core</artifactId>
31+
<artifactId>spring-aop</artifactId>
2832
<exclusions>
2933
<exclusion>
3034
<groupId>commons-logging</groupId>
@@ -33,16 +37,14 @@
3337
</exclusions>
3438
</dependency>
3539
<dependency>
36-
<groupId>org.springframework</groupId>
37-
<artifactId>spring-aop</artifactId>
38-
</dependency>
39-
<dependency>
40-
<groupId>org.aspectj</groupId>
41-
<artifactId>aspectjrt</artifactId>
42-
</dependency>
43-
<dependency>
44-
<groupId>org.aspectj</groupId>
45-
<artifactId>aspectjweaver</artifactId>
40+
<groupId>org.springframework.boot</groupId>
41+
<artifactId>spring-boot-starter</artifactId>
42+
<exclusions>
43+
<exclusion>
44+
<groupId>commons-logging</groupId>
45+
<artifactId>commons-logging</artifactId>
46+
</exclusion>
47+
</exclusions>
4648
</dependency>
4749
</dependencies>
4850
</project>

spring-boot-starters/spring-boot-starter-batch/pom.xml

+17-9
Original file line numberDiff line numberDiff line change
@@ -18,31 +18,39 @@
1818
<main.basedir>${basedir}/../..</main.basedir>
1919
</properties>
2020
<dependencies>
21-
<dependency>
22-
<groupId>org.springframework.boot</groupId>
23-
<artifactId>spring-boot-starter</artifactId>
24-
</dependency>
2521
<dependency>
2622
<groupId>org.hsqldb</groupId>
2723
<artifactId>hsqldb</artifactId>
2824
</dependency>
2925
<dependency>
3026
<groupId>org.springframework</groupId>
31-
<artifactId>spring-core</artifactId>
27+
<artifactId>spring-jdbc</artifactId>
3228
<exclusions>
3329
<exclusion>
3430
<groupId>commons-logging</groupId>
3531
<artifactId>commons-logging</artifactId>
3632
</exclusion>
3733
</exclusions>
3834
</dependency>
39-
<dependency>
40-
<groupId>org.springframework</groupId>
41-
<artifactId>spring-jdbc</artifactId>
42-
</dependency>
4335
<dependency>
4436
<groupId>org.springframework.batch</groupId>
4537
<artifactId>spring-batch-core</artifactId>
38+
<exclusions>
39+
<exclusion>
40+
<groupId>commons-logging</groupId>
41+
<artifactId>commons-logging</artifactId>
42+
</exclusion>
43+
</exclusions>
44+
</dependency>
45+
<dependency>
46+
<groupId>org.springframework.boot</groupId>
47+
<artifactId>spring-boot-starter</artifactId>
48+
<exclusions>
49+
<exclusion>
50+
<groupId>commons-logging</groupId>
51+
<artifactId>commons-logging</artifactId>
52+
</exclusion>
53+
</exclusions>
4654
</dependency>
4755
</dependencies>
4856
</project>

spring-boot-starters/spring-boot-starter-data-elasticsearch/pom.xml

+13-2
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,24 @@
2020
</properties>
2121
<dependencies>
2222
<dependency>
23-
<groupId>${project.groupId}</groupId>
23+
<groupId>org.springframework.boot</groupId>
2424
<artifactId>spring-boot-starter</artifactId>
25-
<version>${project.version}</version>
25+
<exclusions>
26+
<exclusion>
27+
<groupId>commons-logging</groupId>
28+
<artifactId>commons-logging</artifactId>
29+
</exclusion>
30+
</exclusions>
2631
</dependency>
2732
<dependency>
2833
<groupId>org.springframework.data</groupId>
2934
<artifactId>spring-data-elasticsearch</artifactId>
35+
<exclusions>
36+
<exclusion>
37+
<groupId>commons-logging</groupId>
38+
<artifactId>commons-logging</artifactId>
39+
</exclusion>
40+
</exclusions>
3041
</dependency>
3142
</dependencies>
3243
</project>

spring-boot-starters/spring-boot-starter-data-gemfire/pom.xml

+8-6
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,13 @@
1919
<main.basedir>${basedir}/../..</main.basedir>
2020
</properties>
2121
<dependencies>
22-
<dependency>
23-
<groupId>org.springframework.boot</groupId>
24-
<artifactId>spring-boot-starter</artifactId>
25-
</dependency>
2622
<dependency>
2723
<groupId>com.gemstone.gemfire</groupId>
2824
<artifactId>gemfire</artifactId>
2925
</dependency>
3026
<dependency>
31-
<groupId>org.springframework</groupId>
32-
<artifactId>spring-core</artifactId>
27+
<groupId>org.springframework.boot</groupId>
28+
<artifactId>spring-boot-starter</artifactId>
3329
<exclusions>
3430
<exclusion>
3531
<groupId>commons-logging</groupId>
@@ -40,6 +36,12 @@
4036
<dependency>
4137
<groupId>org.springframework.data</groupId>
4238
<artifactId>spring-data-gemfire</artifactId>
39+
<exclusions>
40+
<exclusion>
41+
<groupId>commons-logging</groupId>
42+
<artifactId>commons-logging</artifactId>
43+
</exclusion>
44+
</exclusions>
4345
</dependency>
4446
</dependencies>
4547
<repositories>

spring-boot-starters/spring-boot-starter-data-jpa/pom.xml

+42-16
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,42 @@
1919
</properties>
2020
<dependencies>
2121
<dependency>
22-
<groupId>org.springframework.boot</groupId>
23-
<artifactId>spring-boot-starter</artifactId>
22+
<groupId>org.hibernate</groupId>
23+
<artifactId>hibernate-entitymanager</artifactId>
2424
</dependency>
2525
<dependency>
26-
<groupId>org.springframework.boot</groupId>
27-
<artifactId>spring-boot-starter-aop</artifactId>
26+
<groupId>org.springframework</groupId>
27+
<artifactId>spring-aspects</artifactId>
28+
<exclusions>
29+
<exclusion>
30+
<groupId>commons-logging</groupId>
31+
<artifactId>commons-logging</artifactId>
32+
</exclusion>
33+
</exclusions>
2834
</dependency>
2935
<dependency>
30-
<groupId>org.springframework.boot</groupId>
31-
<artifactId>spring-boot-starter-jdbc</artifactId>
36+
<groupId>org.springframework</groupId>
37+
<artifactId>spring-orm</artifactId>
38+
<exclusions>
39+
<exclusion>
40+
<groupId>commons-logging</groupId>
41+
<artifactId>commons-logging</artifactId>
42+
</exclusion>
43+
</exclusions>
3244
</dependency>
3345
<dependency>
34-
<groupId>org.hibernate</groupId>
35-
<artifactId>hibernate-entitymanager</artifactId>
46+
<groupId>org.springframework.boot</groupId>
47+
<artifactId>spring-boot-starter</artifactId>
48+
<exclusions>
49+
<exclusion>
50+
<groupId>commons-logging</groupId>
51+
<artifactId>commons-logging</artifactId>
52+
</exclusion>
53+
</exclusions>
3654
</dependency>
3755
<dependency>
38-
<groupId>org.springframework</groupId>
39-
<artifactId>spring-core</artifactId>
56+
<groupId>org.springframework.boot</groupId>
57+
<artifactId>spring-boot-starter-aop</artifactId>
4058
<exclusions>
4159
<exclusion>
4260
<groupId>commons-logging</groupId>
@@ -45,16 +63,24 @@
4563
</exclusions>
4664
</dependency>
4765
<dependency>
48-
<groupId>org.springframework</groupId>
49-
<artifactId>spring-orm</artifactId>
66+
<groupId>org.springframework.boot</groupId>
67+
<artifactId>spring-boot-starter-jdbc</artifactId>
68+
<exclusions>
69+
<exclusion>
70+
<groupId>commons-logging</groupId>
71+
<artifactId>commons-logging</artifactId>
72+
</exclusion>
73+
</exclusions>
5074
</dependency>
5175
<dependency>
5276
<groupId>org.springframework.data</groupId>
5377
<artifactId>spring-data-jpa</artifactId>
54-
</dependency>
55-
<dependency>
56-
<groupId>org.springframework</groupId>
57-
<artifactId>spring-aspects</artifactId>
78+
<exclusions>
79+
<exclusion>
80+
<groupId>commons-logging</groupId>
81+
<artifactId>commons-logging</artifactId>
82+
</exclusion>
83+
</exclusions>
5884
</dependency>
5985
</dependencies>
6086
</project>

0 commit comments

Comments
 (0)