This commit fixes various issues with the configuration of the Gradle Java toolchain in the build. First, the configuration of build properties is fixed in the CI pipeline because it wasn't properly checked. The JMH plugin is also upgraded and we now configure its toolchain support. This commit also rewrites the XJC tasks in the spring-oxm module, leveraging a Gradle plugin that creates actual compile tasks we can configure. See gh-25787
66 lines
1.7 KiB
Groovy
66 lines
1.7 KiB
Groovy
plugins {
|
|
id "org.unbroken-dome.xjc"
|
|
}
|
|
|
|
description = "Spring Object/XML Marshalling"
|
|
|
|
configurations {
|
|
jibx
|
|
}
|
|
|
|
dependencies {
|
|
jibx "org.jibx:jibx-bind:1.3.3"
|
|
jibx "org.apache.bcel:bcel:6.0"
|
|
}
|
|
|
|
xjc {
|
|
xjcVersion = '2.2'
|
|
}
|
|
sourceSets {
|
|
test {
|
|
xjcTargetPackage = 'org.springframework.oxm.jaxb.test'
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
compile(project(":spring-beans"))
|
|
compile(project(":spring-core"))
|
|
optional("javax.xml.bind:jaxb-api")
|
|
optional("javax.activation:javax.activation-api")
|
|
optional("com.thoughtworks.xstream:xstream")
|
|
optional("org.jibx:jibx-run")
|
|
testCompile(project(":spring-context"))
|
|
testCompile(testFixtures(project(":spring-core")))
|
|
testCompile("org.ogce:xpp3")
|
|
testCompile("org.codehaus.jettison:jettison") {
|
|
exclude group: "stax", module: "stax-api"
|
|
}
|
|
//testCompile(files(genJaxb.classesDir).builtBy(genJaxb))
|
|
testCompile("org.xmlunit:xmlunit-assertj")
|
|
testCompile("org.xmlunit:xmlunit-matchers")
|
|
testRuntime("com.sun.xml.bind:jaxb-core")
|
|
testRuntime("com.sun.xml.bind:jaxb-impl")
|
|
}
|
|
|
|
// JiBX compiler is currently not compatible with JDK 9+.
|
|
// If customJavaHome has been set, we assume the custom JDK version is 9+.
|
|
if ((JavaVersion.current() == JavaVersion.VERSION_1_8) && !project.hasProperty("testToolchain")) {
|
|
compileTestJava {
|
|
def bindingXml = "${projectDir}/src/test/resources/org/springframework/oxm/jibx/binding.xml"
|
|
|
|
doLast() {
|
|
project.ant {
|
|
taskdef(name: "jibx",
|
|
classname: "org.jibx.binding.ant.CompileTask",
|
|
classpath: configurations.jibx.asPath)
|
|
|
|
jibx(verbose: false, load: true, binding: bindingXml) {
|
|
classpathset(dir: sourceSets.test.java.outputDir) {
|
|
include(name: "**/jibx/**/*")
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|