mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-05-02 20:09:31 +01:00
0092653d42
After the Groovy 2.5 upgrade, the Spring Framework build on JDK9 hit GROOVY-8631. Adding the relevant `jax-api` dependency to the module didn't fix this issue. The Groovy release notes mention the use of the `--add-modules` JVM flag, but this is not an option for this build which should run on JDK8 -> JDK11. This commit changes the dependency from `groovy-all` to more focused dependencies on Groovy in the `spring-beans` and `spring-context` modules. This change seems to avoid the automatic loading of Groovy enhancements to JAXB (shipped with `groovy-xml`). See: * http://groovy-lang.org/releasenotes/groovy-2.5.html#Groovy2.5releasenotes-Knownissues * https://issues.apache.org/jira/browse/GROOVY-8631 Issue: SPR-15407
34 lines
1.1 KiB
Groovy
34 lines
1.1 KiB
Groovy
description = "Spring Beans"
|
|
|
|
apply plugin: "groovy"
|
|
|
|
dependencies {
|
|
compile(project(':spring-core'))
|
|
optional("javax.inject:javax.inject:1")
|
|
optional("org.yaml:snakeyaml:1.21")
|
|
optional("org.codehaus.groovy:groovy-xml:${groovyVersion}")
|
|
optional("org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}")
|
|
optional("org.jetbrains.kotlin:kotlin-stdlib:${kotlinVersion}")
|
|
testCompile("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}")
|
|
}
|
|
|
|
// This modules does joint compilation for Java and Groovy code,
|
|
// with the compileGroovy task.
|
|
sourceSets {
|
|
main.groovy.srcDirs += "src/main/java"
|
|
main.java.srcDirs = []
|
|
}
|
|
|
|
compileGroovy {
|
|
sourceCompatibility = 1.8
|
|
targetCompatibility = 1.8
|
|
}
|
|
|
|
// This module also builds Kotlin code and the compileKotlin task
|
|
// naturally depends on compileJava.
|
|
// We need to redefine dependencies to break task cycles.
|
|
def deps = compileGroovy.taskDependencies.immutableValues + compileGroovy.taskDependencies.mutableValues
|
|
compileGroovy.dependsOn = deps - 'compileJava'
|
|
compileKotlin.dependsOn(compileGroovy)
|
|
compileKotlin.classpath += files(compileGroovy.destinationDir)
|