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
2.4.x
Phillip Webb 3 years ago
parent e95b0b5257
commit 8e704aab48

@ -109,6 +109,7 @@ public class CheckClasspathForUnnecessaryExclusions extends DefaultTask {
.getIncoming().getArtifacts().getArtifacts().stream().map(this::getId)
.collect(Collectors.toList());
exclusions.removeAll(dependencies);
removeProfileExclusions(dependencyId, exclusions);
if (!exclusions.isEmpty()) {
unnecessaryExclusions.put(dependencyId, exclusions);
}
@ -119,6 +120,12 @@ public class CheckClasspathForUnnecessaryExclusions extends DefaultTask {
}
}
private void removeProfileExclusions(String dependencyId, Set<String> exclusions) {
if ("org.xmlunit:xmlunit-core".equals(dependencyId)) {
exclusions.remove("javax.xml.bind:jaxb-api");
}
}
private String getExceptionMessage(Map<String, Set<String>> unnecessaryExclusions) {
StringBuilder message = new StringBuilder("Unnecessary exclusions detected:");
for (Entry<String, Set<String>> entry : unnecessaryExclusions.entrySet()) {

@ -18,5 +18,7 @@ dependencies {
api("org.skyscreamer:jsonassert")
api("org.springframework:spring-core")
api("org.springframework:spring-test")
api("org.xmlunit:xmlunit-core")
api("org.xmlunit:xmlunit-core") {
exclude group: "javax.xml.bind", module: "jaxb-api"
}
}

Loading…
Cancel
Save