Hibernate Gradle plugin is not working for Kotlin projects

Description

Hi, I'm trying to use hibernate-gradle-plugin in Kotlin Spring Boot project but I don't see any enhancements in bytecode. When using Hibernate 6 there is error when building the project.

Discourse topic with error: https://discourse.hibernate.org/t/hibernate-enhance-gradle-plugin-for-kotlin/6365
Test case repository Java vs Kotlin: https://github.com/matejschwartz/hibernate-gradle-plugin-test

Thank you for check

Activity

Show:

Steve Ebersole June 10, 2022 at 7:44 AM

If you want to backport these changes to 5.6 branch and send a pull request I can look at integrating it. If you want to do that, be sure to include the tests and to not backport the hbm.xml transformation stuff

Steve Ebersole June 9, 2022 at 9:23 PM

All of these Hibernate components are released together. Yes, you must use Hibernate 6. If you plan on using bytecode enhancement it is highly suggested to use the same version of the plugin as the runtime components. I added comments in the README covering all of that as I mentioned earier.

As for Spring Boot… 🤷‍♂️

James Peters June 9, 2022 at 8:35 PM

Ah yes of-course, so just to confirm 6.1.1 requires hibernate-core 6 which isn’t compatible with Spring Boot as of yet?

Steve Ebersole June 9, 2022 at 7:09 PM

You'll also need to build a snapshot of 6.1.1 (notice the fix version)

James Peters June 9, 2022 at 5:09 PM

Just trying to test it out, this is probably a separate issue but I previously was using 5.6.9.Final with Spring Boot 2.70. After changing the gradle plugin to 6.1.0.Final Gradle gives me this error when compiling:

ANTLR Tool version 4.9.2 used for code generation does not match the current runtime version 4.10 ANTLR Runtime version 4.9.2 used for parser compilation does not match the current runtime version 4.10

Do I need to be using Hibernate core 6?

Fixed

Details

Assignee

Reporter

Fix versions

Affects versions

Priority

Created June 2, 2022 at 1:42 PM
Updated July 1, 2022 at 12:08 PM
Resolved June 8, 2022 at 12:40 PM