Hibernate JPA2 Model Gen fails when targeting JDK11 (or later)

Description

I would like to target JDK11 and newer.

When using the hibernate-jpamodelgen annotation processor to generate the static meta model for the criteria API, I can only target JDK10. If I attempt to target JDK11 or newer, the package name will be incorrect and reference JDK10 and older. The new JDK11 path is:

javax.annotation.processing

and NOT
javax.annotation

<plugin>
<groupId>org.bsc.maven</groupId>
<artifactId>maven-processor-plugin</artifactId>
<version>3.3.3</version>
<executions>
<execution>
<id>process</id>
<goals>
<goal>process</goal>
</goals>
<phase>generate-sources</phase>
<configuration>
<!-- source output directory -->
<outputDirectory>${project.build.directory}/generated-sources/java/jpametamodel</outputDirectory>
<processors>
<processor>org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor</processor>
</processors>
<overwrite>true</overwrite>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-jpamodelgen</artifactId>
<version>${hibernate.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>jsr250-api</artifactId>
<version>1.0</version>
</dependency>
</dependencies>

Environment

None

Activity

Show:

Koen Aers December 12, 2024 at 2:48 PM

I am closing this issue as it didn't get any significant updates since 2019. Please feel free to reopen it if you think that it is still relevant.

Won't Fix

Details

Assignee

Reporter

Bug Testcase Reminder (view)

Bug reports should generally be accompanied by a test case!

Bug Testcase Reminder (edit)

Bug reports should generally be accompanied by a test case!

Participants

Koen Aers
Walter White

Components

Affects versions

Priority

Created October 4, 2019 at 2:53 AM
Updated December 17, 2024 at 12:00 PM
Resolved December 12, 2024 at 2:48 PM