mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-07-05 00:56:58 +08:00
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
This commit is contained in:
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…
Reference in New Issue
Block a user