Improve unused exclusion detection and remove those that are unused

See gh-20472
pull/20495/head
dreis2211 5 years ago committed by Andy Wilkinson
parent e2518917f4
commit 589213daab

@ -69,12 +69,17 @@ public class CheckBom extends DefaultTask {
.collect(Collectors.toSet()); .collect(Collectors.toSet());
Set<String> unused = new TreeSet<>(); Set<String> unused = new TreeSet<>();
for (String exclusion : exclusions) { for (String exclusion : exclusions) {
if (!resolved.contains(exclusion) && exclusion.endsWith(":*")) { if (!resolved.contains(exclusion)) {
if (exclusion.endsWith(":*")) {
String group = exclusion.substring(0, exclusion.indexOf(':') + 1); String group = exclusion.substring(0, exclusion.indexOf(':') + 1);
if (resolved.stream().noneMatch((candidate) -> candidate.startsWith(group))) { if (resolved.stream().noneMatch((candidate) -> candidate.startsWith(group))) {
unused.add(exclusion); unused.add(exclusion);
} }
} }
else {
unused.add(exclusion);
}
}
} }
exclusions.removeAll(resolved); exclusions.removeAll(resolved);
if (!unused.isEmpty()) { if (!unused.isEmpty()) {

@ -1526,13 +1526,9 @@ bom {
"selenium-ie-driver", "selenium-ie-driver",
"selenium-java", "selenium-java",
"selenium-opera-driver", "selenium-opera-driver",
"selenium-remote-driver" { "selenium-remote-driver",
exclude group: "commons-logging", module: "commons-logging"
},
"selenium-safari-driver", "selenium-safari-driver",
"selenium-support" { "selenium-support"
exclude group: "commons-logging", module: "commons-logging"
}
] ]
} }
} }
@ -1643,12 +1639,6 @@ bom {
} }
library("Spring Integration", "5.3.0.M2") { library("Spring Integration", "5.3.0.M2") {
group("org.springframework.integration") { group("org.springframework.integration") {
modules = [
"spring-integration-http" {
exclude group: "commons-logging", module: "commons-logging"
exclude group: "commons-logging", module: "commons-logging-api"
}
]
imports = [ imports = [
"spring-integration-bom" "spring-integration-bom"
] ]
@ -1709,18 +1699,10 @@ bom {
library("Spring WS", "3.0.8.RELEASE") { library("Spring WS", "3.0.8.RELEASE") {
group("org.springframework.ws") { group("org.springframework.ws") {
modules = [ modules = [
"spring-ws-core" { "spring-ws-core",
exclude group: "commons-logging", module: "commons-logging" "spring-ws-security",
}, "spring-ws-support",
"spring-ws-security" { "spring-ws-test",
exclude group: "commons-logging", module: "commons-logging"
},
"spring-ws-support" {
exclude group: "commons-logging", module: "commons-logging"
},
"spring-ws-test" {
exclude group: "commons-logging", module: "commons-logging"
},
"spring-xml" "spring-xml"
] ]
} }

Loading…
Cancel
Save