I am trying to setup the Hibernate gradle plugin in my Gradle Kotlin-script project, to no avail.
I followed the answers here and here, my configuration is as follows:
settings.gradle.kts:
pluginManagement {
resolutionStrategy {
eachPlugin {
if (requested.id.id == "org.hibernate.orm") {
useModule("org.hibernate:hibernate-gradle-plugin:${requested.version}")
}
}
}
}
build.gradle.kts
plugins {
...
id("org.hibernate.orm") version "5.4.9.Final"
...
}
...
hibernate {
enhance { }
}
I am getting an error from Gradle:
Line 193: enhance {}
^ Type mismatch: inferred type is () -> Unit but (Closure<Any!>..Closure<*>?) was expected
I also tried with the following hibernate
block:
hibernate {
enhance {
enableLazyInitialization = true
enableDirtyTracking = true
enableAssociationManagement = true
}
}
but i'm just getting more errors:
Line 193: enhance {
^ Type mismatch: inferred type is () -> Unit but (Closure<Any!>..Closure<*>?) was expected
Line 194: enableLazyInitialization = true
^ Unresolved reference: enableLazyInitialization
Line 195: enableDirtyTracking = true
^ Unresolved reference: enableDirtyTracking
Line 196: enableAssociationManagement = true
^ Unresolved reference: enableAssociationManagement
Anyone knows how to make this work in Kotlin-script?