# Hibernate Bytecode Enhancement for a Groovy Project

**URL:** https://discourse.hibernate.org/t/hibernate-bytecode-enhancement-for-a-groovy-project/2981
**Category:** Hibernate ORM
**Created:** [July 18, 2019, 11:01am UTC](https://discourse.hibernate.org/t/hibernate-bytecode-enhancement-for-a-groovy-project/2981 "2019-07-18T11:01:03Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![mistahenry](https://avatars.discourse-cdn.com/v4/letter/m/d26b3c/32.png) [@mistahenry](https://discourse.hibernate.org/u/mistahenry)
#### Post date: [July 18, 2019, 11:01am UTC](https://discourse.hibernate.org/t/hibernate-bytecode-enhancement-for-a-groovy-project/2981/1 "2019-07-18T11:01:03Z")

</div>

I’m attempting to use the [hibernate plugin](https://github.com/hibernate/hibernate-orm/blob/master/tooling/hibernate-gradle-plugin/src/main/groovy/org/hibernate/orm/tooling/gradle/HibernatePlugin.java) in my Spring Boot groovy project. I added the following configuration to my `build.gradle`

```
buildscript {
	ext {
		hibernateVersion = '5.3.7.Final'
	}
	dependencies {
		classpath("org.hibernate:hibernate-gradle-plugin:${hibernateVersion}")
	}
}
apply plugin: 'org.hibernate.orm'

hibernate {
	enhance {
		enableLazyInitialization=true
		enableDirtyTracking=true
	}
}

```

But I am unable to use bytecode enhanced features like lazy loading properties. I look at my decompiled groovy (I’m using `@CompileStatic`) and I see no bytecode enhancement.

Inside of the plugin, the enhancement task executes this line:

```
final Task compileTask = project.getTasks().findByName( sourceSet.getCompileJavaTaskName() );

```

which will always return `CompileJava` which will never work for me since I use `CompileGroovy`. Are there any known work arounds for this?
