Skip to content

Commit 4e9036a

Browse files
committed
hibernate 7 requires java 17
1 parent 9645dfa commit 4e9036a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

instrumentation/hibernate/hibernate-6.0/javaagent/build.gradle.kts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,18 @@ tasks {
7171
jvmArgs("-Dotel.instrumentation.hibernate.experimental-span-attributes=true")
7272
}
7373

74+
named("compileHibernate7TestJava", JavaCompile::class).configure {
75+
options.release.set(17)
76+
}
77+
val testJavaVersion =
78+
gradle.startParameter.projectProperties.get("testJavaVersion")?.let(JavaVersion::toVersion)
79+
?: JavaVersion.current()
80+
if (!testJavaVersion.isCompatibleWith(JavaVersion.VERSION_17)) {
81+
named("hibernate7Test", Test::class).configure {
82+
enabled = false
83+
}
84+
}
85+
7486
val testStableSemconv by registering(Test::class) {
7587
jvmArgs("-Dotel.semconv-stability.opt-in=database")
7688
}

0 commit comments

Comments
 (0)