Add this to the https://github.com/spring-projects/spring-petclinic:
<plugin>
<groupId>org.hibernate.orm.tooling</groupId>
<artifactId>hibernate-enhance-maven-plugin</artifactId>
<version>${hibernate.version}</version>
<executions>
<execution>
<configuration>
<failOnError>true</failOnError>
<enableLazyInitialization>true</enableLazyInitialization>
<enableDirtyTracking>true</enableDirtyTracking>
<enableAssociationManagement>true</enableAssociationManagement>
<enableExtendedEnhancement>false</enableExtendedEnhancement>
</configuration>
<goals>
<goal>enhance</goal>
</goals>
</execution>
</executions>
</plugin>
If you also change the parent pom version to spring boot 2.2.0.M4 you will get Hibernate 5.4. I also tried with 5.4.3.Final by manually setting hibernate.version. In all cases you get a java.lang.VerifyError at runtime (e.g. tests all fail). Example:
I found I can "fix" it by removing the <enableAssociationManagement>true</enableAssociationManagement>, so I guess that's a workaround. |