Skip to content

Commit 8e704aa

Browse files
committed
Restore 'javax.xml.bind:jaxb-api' exclusion
Restore the 'javax.xml.bind:jaxb-api' exclusion from `xmlunit-core` which is actually required when using Maven on Java 9+. The `CheckClasspathForUnnecessaryExclusions` cannot deal with profile specific dependencies so an exception has been hard coded. See gh-28332
1 parent e95b0b5 commit 8e704aa

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

buildSrc/src/main/java/org/springframework/boot/build/classpath/CheckClasspathForUnnecessaryExclusions.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ public void checkForUnnecessaryExclusions() {
109109
.getIncoming().getArtifacts().getArtifacts().stream().map(this::getId)
110110
.collect(Collectors.toList());
111111
exclusions.removeAll(dependencies);
112+
removeProfileExclusions(dependencyId, exclusions);
112113
if (!exclusions.isEmpty()) {
113114
unnecessaryExclusions.put(dependencyId, exclusions);
114115
}
@@ -119,6 +120,12 @@ public void checkForUnnecessaryExclusions() {
119120
}
120121
}
121122

123+
private void removeProfileExclusions(String dependencyId, Set<String> exclusions) {
124+
if ("org.xmlunit:xmlunit-core".equals(dependencyId)) {
125+
exclusions.remove("javax.xml.bind:jaxb-api");
126+
}
127+
}
128+
122129
private String getExceptionMessage(Map<String, Set<String>> unnecessaryExclusions) {
123130
StringBuilder message = new StringBuilder("Unnecessary exclusions detected:");
124131
for (Entry<String, Set<String>> entry : unnecessaryExclusions.entrySet()) {

spring-boot-project/spring-boot-starters/spring-boot-starter-test/build.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,7 @@ dependencies {
1818
api("org.skyscreamer:jsonassert")
1919
api("org.springframework:spring-core")
2020
api("org.springframework:spring-test")
21-
api("org.xmlunit:xmlunit-core")
21+
api("org.xmlunit:xmlunit-core") {
22+
exclude group: "javax.xml.bind", module: "jaxb-api"
23+
}
2224
}

0 commit comments

Comments
 (0)