Gradle plugin should use full compilation classpath for enhancement
Description
Activity
Show:
Steve Ebersole October 19, 2022 at 4:48 PM
You should be able to pull main
or 6.1
branch now and test it locally - https://docs.gradle.org/current/userguide/testing_gradle_plugins.html#manual-tests
Steve Ebersole October 18, 2022 at 11:47 PM
Ok, I was able to reproduce it now. Thanks.
Caused by: org.hibernate.bytecode.enhance.spi.EnhancementException: Failed to enhance class com.example.data.jpa.CLR
at org.hibernate.bytecode.enhance.internal.bytebuddy.EnhancerImpl.enhance(EnhancerImpl.java:138)
at org.hibernate.orm.tooling.gradle.enhance.EnhancementHelper.doEnhancement(EnhancementHelper.java:84)
... 121 more
Caused by: net.bytebuddy.pool.TypePool$Resolution$NoSuchTypeException: Cannot resolve type description for org.springframework.boot.CommandLineRunner
at net.bytebuddy.pool.TypePool$Resolution$Illegal.resolve(TypePool.java:167)
I see the problem

sdeleuze October 18, 2022 at 5:53 PM
Sorry that’s due to a recent change in our snapshots, I have removed the native plugin in order to avoid this issue and to make sure you have a regular repro with no native bits involved. Please pull my latest commit https://github.com/sdeleuze/data-jpa/commit/204491dc1023271e497ef8a374daefa428e36e7d you should be able to reproduce with what you did previously.
Steve Ebersole October 18, 2022 at 5:34 PM
> sdk use java 17.0.4.1-librca
Using java version 17.0.4.1-librca in this shell.
> gradlew compileJava
* What went wrong:
Could not determine the dependencies of task ':compileJava'.
> Could not resolve all dependencies for configuration ':compileClasspath'.
> Could not create task ':bootJar'.
> Task with name 'collectReachabilityMetadata' not found in root project 'data-jpa'.
Please list ALL prerequisites to be able to reproduce this.
Steve Ebersole October 18, 2022 at 5:17 PM
I did not. That was not specified. You said you use 17, not that it is required. I’ll try that
Fixed
Details
Details
Assignee
Reporter

Worked in
Components
Fix versions
Affects versions
Priority
Created October 12, 2022 at 7:42 AM
Updated October 28, 2022 at 12:09 PM
Resolved October 19, 2022 at 1:26 AM
This Spring Boot 3 + Hibernate 6 sample shows that for some reasons the Hibernate 6 Gradle plugin fails with the error
Unable to enhance class : com.example.data.jpa.CLR
when running./gradlew compilejava
.This use case is working with Hibernate 6 Maven plugin (you can try running
mvn compile
on the very same sample) and it was working on both Maven and Gradle plugin with Hibernate 5, hence my guess this could be a regression in Hibernate 6 Gradle plugin.This issue is blocking Spring Boot 3 users to get proper Hibernate support with GraalVM native.