Skip to content

Commit d9d6cb6

Browse files
committed
Merge pull request #20472 from dreis2211
* gh-20472: Improve unused exclusion detection and remove those that are unused Closes gh-20472
2 parents e251891 + 589213d commit d9d6cb6

File tree

2 files changed

+14
-27
lines changed
  • buildSrc/src/main/java/org/springframework/boot/build/bom
  • spring-boot-project/spring-boot-dependencies

2 files changed

+14
-27
lines changed

buildSrc/src/main/java/org/springframework/boot/build/bom/CheckBom.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,14 @@ private void checkExclusions(String groupId, Module module, DependencyVersion ve
6969
.collect(Collectors.toSet());
7070
Set<String> unused = new TreeSet<>();
7171
for (String exclusion : exclusions) {
72-
if (!resolved.contains(exclusion) && exclusion.endsWith(":*")) {
73-
String group = exclusion.substring(0, exclusion.indexOf(':') + 1);
74-
if (resolved.stream().noneMatch((candidate) -> candidate.startsWith(group))) {
72+
if (!resolved.contains(exclusion)) {
73+
if (exclusion.endsWith(":*")) {
74+
String group = exclusion.substring(0, exclusion.indexOf(':') + 1);
75+
if (resolved.stream().noneMatch((candidate) -> candidate.startsWith(group))) {
76+
unused.add(exclusion);
77+
}
78+
}
79+
else {
7580
unused.add(exclusion);
7681
}
7782
}

spring-boot-project/spring-boot-dependencies/build.gradle

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1526,13 +1526,9 @@ bom {
15261526
"selenium-ie-driver",
15271527
"selenium-java",
15281528
"selenium-opera-driver",
1529-
"selenium-remote-driver" {
1530-
exclude group: "commons-logging", module: "commons-logging"
1531-
},
1529+
"selenium-remote-driver",
15321530
"selenium-safari-driver",
1533-
"selenium-support" {
1534-
exclude group: "commons-logging", module: "commons-logging"
1535-
}
1531+
"selenium-support"
15361532
]
15371533
}
15381534
}
@@ -1643,12 +1639,6 @@ bom {
16431639
}
16441640
library("Spring Integration", "5.3.0.M2") {
16451641
group("org.springframework.integration") {
1646-
modules = [
1647-
"spring-integration-http" {
1648-
exclude group: "commons-logging", module: "commons-logging"
1649-
exclude group: "commons-logging", module: "commons-logging-api"
1650-
}
1651-
]
16521642
imports = [
16531643
"spring-integration-bom"
16541644
]
@@ -1709,18 +1699,10 @@ bom {
17091699
library("Spring WS", "3.0.8.RELEASE") {
17101700
group("org.springframework.ws") {
17111701
modules = [
1712-
"spring-ws-core" {
1713-
exclude group: "commons-logging", module: "commons-logging"
1714-
},
1715-
"spring-ws-security" {
1716-
exclude group: "commons-logging", module: "commons-logging"
1717-
},
1718-
"spring-ws-support" {
1719-
exclude group: "commons-logging", module: "commons-logging"
1720-
},
1721-
"spring-ws-test" {
1722-
exclude group: "commons-logging", module: "commons-logging"
1723-
},
1702+
"spring-ws-core",
1703+
"spring-ws-security",
1704+
"spring-ws-support",
1705+
"spring-ws-test",
17241706
"spring-xml"
17251707
]
17261708
}

0 commit comments

Comments
 (0)