I am really struggeling to get the bytecode enhancement via the hibernate gradle plugin to run. Especially as no examples I can find are written in Kotlin DSL, which we are using on the project. The relevant parts of the build.gradle.kts look as follows:
plugins {
id("org.hibernate.orm") version "5.4.8.Final"
}
val hibernateGradlePluginVersion = "5.4.8.Final"
tasks.withType<org.hibernate.orm.tooling.gradle.EnhanceTask>{
options.enableLazyInitialization = true // This is what I actually need!
}
dependencies {
compile("org.hibernate:hibernate-gradle-plugin:$hibernateGradlePluginVersion")
}
Also I added this to me settings.gradle.kts:
resolutionStrategy {
eachPlugin {
if (requested.id.id == "org.hibernate.orm") {
useModule("org.hibernate:hibernate-gradle-plugin:${requested.version}")
}
}
}
If I run 'build' in debug mode, the breakpoint where the LazyIntialization is set to true is never reached. Therefore, I assume that the hibernate plugin never executes its tasks. Any advice where my mistake might be?
Best regards!