From 7fbc951691d44af9d611cb62053a42386592545b Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Fri, 6 Mar 2015 17:46:53 +0100 Subject: [PATCH] Revised build for JDK 9 tolerance We use AspectJ 1.9.0.BETA-1 for the ajc task now and exclude spring-oxm test compilation when running on JDK 9. Issue: SPR-12549 --- build.gradle | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index 77267790f7..3ceafa549a 100644 --- a/build.gradle +++ b/build.gradle @@ -116,6 +116,7 @@ configure(allprojects) { project -> repositories { maven { url "https://repo.spring.io/libs-release" } + maven { url "https://repo.spring.io/milestone" } } dependencies { @@ -542,6 +543,11 @@ project("spring-oxm") { targetCompatibility=1.6 } + if (System.getProperty("java.version").contains("1.9.")) { + // necessary because castor and xjc tasks cannot find the JDK's compiler on JDK 9 + compileTestJava.enabled = false + } + dependencies { compile(project(":spring-beans")) compile(project(":spring-core")) @@ -563,9 +569,11 @@ project("spring-oxm") { testCompile("org.codehaus.jettison:jettison:1.3.7") { exclude group: 'stax', module: 'stax-api' } - testCompile(files(genCastor.classesDir).builtBy(genCastor)) - testCompile(files(genJaxb.classesDir).builtBy(genJaxb)) - testCompile(files(genXmlbeans.classesDir).builtBy(genXmlbeans)) + if (compileTestJava.enabled) { + testCompile(files(genCastor.classesDir).builtBy(genCastor)) + testCompile(files(genJaxb.classesDir).builtBy(genJaxb)) + testCompile(files(genXmlbeans.classesDir).builtBy(genXmlbeans)) + } } } @@ -1018,7 +1026,7 @@ project("spring-aspects") { dependencies { aspects(project(":spring-orm")) - ajc("org.aspectj:aspectjtools:${aspectjVersion}") + ajc("org.aspectj:aspectjtools:1.9.0.BETA-1") // for the ability to build on JDK 9, not exposed in the POMs yet rt("org.aspectj:aspectjrt:${aspectjVersion}") compile("org.aspectj:aspectjweaver:${aspectjVersion}") provided("org.eclipse.persistence:javax.persistence:2.0.0") -- GitLab