Skip to content

Commit ea0fda9

Browse files
committed
Pass toolchain Java version to osgi test
This was using the version of Java that Gradle itself was running on, which is often the same as the one used by the toolchain, but it is not always. Such a case was when we were trying JDK 21 early access builds, which Gradle itself would not run on at the time. The Java version passed to the osgi test.bndrun was not correct in this case, causing a build failure. This passes the Java version configured with the toolchain. Resolves gh-3869
1 parent cd31d94 commit ea0fda9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

micrometer-osgi-test/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def testingBundle = tasks.register('testingBundle', Bundle) {
3636

3737
def resolveTask = tasks.register("resolve", Resolve) {
3838
dependsOn jar, testingBundle
39-
project.ext.osgiRunee="JavaSE-${JavaVersion.current().getMajorVersion()}"
39+
project.ext.osgiRunee="JavaSE-${javaLanguageVersion.asInt()}"
4040
bundles = files(sourceSets.test.runtimeClasspath, configurations.archives.artifacts.files)
4141
bndrun = file("test.bndrun")
4242
outputBndrun = layout.buildDirectory.file("resolved-test.bndrun")

0 commit comments

Comments
 (0)