Merge branch '6.1.x'

This commit is contained in:
Sam Brannen 2024-07-26 16:41:13 +03:00
commit 94e2bef9a3
2 changed files with 20 additions and 9 deletions

View File

@ -77,6 +77,19 @@ eclipse.classpath.file.whenMerged {
}
}
// Due to an apparent bug in Gradle, even though we exclude the "main" classpath
// entries for sources generated by XJC in spring-oxm.gradle, the Gradle eclipse
// plugin still includes them in the generated .classpath file. So, we have to
// manually remove those lingering "main" entries.
if (project.name == "spring-oxm") {
eclipse.classpath.file.whenMerged { classpath ->
classpath.entries.removeAll {
it.path =~ /build\/generated\/sources\/xjc\/.+/ &&
it.entryAttributes.get("gradle_scope") == "main"
}
}
}
// Include project specific settings
task eclipseSettings(type: Copy) {
from rootProject.files(

View File

@ -20,7 +20,6 @@ dependencies {
testImplementation("org.codehaus.jettison:jettison") {
exclude group: "stax", module: "stax-api"
}
//testImplementation(files(genJaxb.classesDir).builtBy(genJaxb))
testImplementation("org.xmlunit:xmlunit-assertj")
testImplementation("org.xmlunit:xmlunit-matchers")
testRuntimeOnly("com.sun.xml.bind:jaxb-core")
@ -28,14 +27,13 @@ dependencies {
}
tasks.named("xjc").configure { xjc ->
// XJC plugin only works against main sources
def javaSrcDirs = sourceSets.main.java.srcDirs
javaSrcDirs.remove(file(xjc.outputJavaDir))
sourceSets.main.java.srcDirs = javaSrcDirs
def resourcesSrcDirs = sourceSets.main.resources.srcDirs
resourcesSrcDirs.remove(file(xjc.outputResourcesDir))
sourceSets.main.resources.srcDirs = resourcesSrcDirs
// XJC plugin only works against main sources, so we have to "move" them to test sources.
sourceSets.main.java.exclude {
it.file.absolutePath.startsWith(outputJavaDir.get().asFile.absolutePath)
}
sourceSets.main.resources.exclude {
it.file.absolutePath.startsWith(outputResourcesDir.get().asFile.absolutePath)
}
sourceSets.test.java.srcDir(xjc.outputJavaDir)
sourceSets.test.resources.srcDir(xjc.outputResourcesDir)
}