Skip to content

martinleim/hibernate-intellij-splitpackage

Repository files navigation

Purpose

Starting with version 6.6.0, Hibernate includes an annotation processor that creates files within a directory entity.index in the source output directory (https://hibernate.atlassian.net/browse/HHH-18162).

When used in combination with IntelliJ, this causes the following error:

java.lang.LayerInstantiationException: Package entity.index in both module com.github.martinleim.modulea and module com.github.martinleim.moduleb

How to reproduce

Tested on IntelliJ IDEA 2024.3.3 Ultimate Edition, Build #IU-243.24978.46

  • Import into IntelliJ as Maven project
  • Run "Build project". Notice how the target/classes directory does not contain the entity directory
  • Open com.github.martinleim.moduleb.Main and execute the main method.
  • Now, IntelliJ again builds the project. This time, the entity directory from target/generated-sources/annotations is included in target/classes
  • After the build, the main method is run and produces the error above.

About

Reproducer for an issue with Hibernate and IntelliJ

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages