Skip to content

Commit a26a317

Browse files
authored
[build] set target Java 8 in Gradle metadata (#1270)
With the switch to build and release using Java 11 we did not verify whether projects would still work with Java 8. While we were targeting Java 8 with Kotlin compiler, Gradle was still populating module metadata with the target JVM version that was used for the build. Resolves: #1269
1 parent bfac731 commit a26a317

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

build.gradle.kts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,10 @@ subprojects {
9393
// NOTE: in order to run gradle and maven plugin integration tests we need to have our build artifacts available in local repo
9494
finalizedBy("publishToMavenLocal")
9595
}
96-
test {
97-
useJUnitPlatform()
98-
finalizedBy(jacocoTestReport)
96+
java {
97+
// even though we don't have any Java code, since we are building using Java LTS version,
98+
// this is required for Gradle to set the correct JVM versions in the module metadata
99+
targetCompatibility = JavaVersion.VERSION_1_8
99100
}
100101

101102
// published artifacts
@@ -167,6 +168,11 @@ subprojects {
167168
useInMemoryPgpKeys(signingKey, signingPassword)
168169
sign(publishing.publications)
169170
}
171+
172+
test {
173+
useJUnitPlatform()
174+
finalizedBy(jacocoTestReport)
175+
}
170176
}
171177

172178
dependencies {

0 commit comments

Comments
 (0)