diff --git a/build.gradle b/build.gradle index a51f2eed9c1..7b78a1fd03a 100644 --- a/build.gradle +++ b/build.gradle @@ -3,7 +3,7 @@ plugins { // kotlinVersion is managed in gradle.properties id 'org.jetbrains.kotlin.plugin.serialization' version "${kotlinVersion}" apply false id 'org.jetbrains.dokka' - id 'com.github.bjornvester.xjc' version '1.8.2' apply false + id 'com.github.bjornvester.xjc' version '1.9.1' apply false id 'com.gradleup.shadow' version "9.2.2" apply false id 'me.champeau.jmh' version '0.7.2' apply false id 'io.spring.nullability' version '0.0.15' apply false diff --git a/spring-oxm/spring-oxm.gradle b/spring-oxm/spring-oxm.gradle index 6ff0412367c..6fce634f5e0 100644 --- a/spring-oxm/spring-oxm.gradle +++ b/spring-oxm/spring-oxm.gradle @@ -29,9 +29,10 @@ dependencies { } // The XJC plugin adds generated code to the main source set, but we need it only for tests. -// 1) Reset main source sets to the standard directories only. -sourceSets.main.java.setSrcDirs(["src/main/java"]) -sourceSets.main.resources.setSrcDirs(["src/main/resources"]) +tasks.named("xjc", XjcTask).configure { + sourceSets.main.java.setSrcDirs(["src/main/java"]) + sourceSets.main.resources.setSrcDirs(["src/main/resources"]) +} // 2) Attach XJC output only to the test source sets via lazy providers. sourceSets.test.java.srcDir(tasks.named("xjc", XjcTask).flatMap { it.outputJavaDir }) sourceSets.test.resources.srcDir(tasks.named("xjc", XjcTask).flatMap { it.outputResourcesDir })