diff --git a/build.gradle b/build.gradle index b450198bfd..6fe5d7dc15 100644 --- a/build.gradle +++ b/build.gradle @@ -19,7 +19,12 @@ buildscript { classpath libs.plugin.japicmp classpath libs.plugin.downloadTask classpath libs.plugin.spotless - classpath libs.plugin.bnd + + if (javaLanguageVersion.asInt() < 17) { + classpath libs.plugin.bnd + } else { + classpath libs.plugin.bndForJava17 + } constraints { classpath(libs.asmForPlugins) { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 7aad9ba761..0bfbc66aa7 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -234,6 +234,7 @@ plugin-japicmp = { module = "me.champeau.gradle:japicmp-gradle-plugin", version plugin-downloadTask = { module = "de.undercouch:gradle-download-task", version = "5.6.0" } plugin-spotless = { module = "com.diffplug.spotless:spotless-plugin-gradle", version = "6.25.0" } plugin-bnd = "biz.aQute.bnd:biz.aQute.bnd.gradle:6.4.0" +plugin-bndForJava17 = "biz.aQute.bnd:biz.aQute.bnd.gradle:7.1.0" [plugins] kotlin19 = { id = "org.jetbrains.kotlin.jvm", version = "1.9.25" } diff --git a/micrometer-osgi-test/build.gradle b/micrometer-osgi-test/build.gradle index d6ffd9152b..030623b352 100644 --- a/micrometer-osgi-test/build.gradle +++ b/micrometer-osgi-test/build.gradle @@ -26,8 +26,9 @@ dependencies { def testingBundle = tasks.register('testingBundle', Bundle) { archiveClassifier = 'tests' from sourceSets.test.output - sourceSet = sourceSets.test - + if (javaLanguageVersion.asInt() < 17) { + sourceSet = sourceSets.test + } bundle { bnd """\ Bundle-SymbolicName: \${task.archiveBaseName}-\${task.archiveClassifier}