4

I have a working project with this maven section:

<plugin>
<groupId>org.bsc.maven</groupId>
<artifactId>maven-processor-plugin</artifactId>
<version>4.5</version>
<executions>
    <execution>
        <goals>
            <goal>process</goal>
        </goals>
        <phase>generate-sources</phase>
        <configuration>
            <processors>
                <processor>org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor</processor>
            </processors>
            <outputDirectory>${project.build.directory}/generated-sources/jpametamodel</outputDirectory>
            <overwrite>true</overwrite>
        </configuration>
    </execution>
</executions>
<dependencies>
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-jpamodelgen</artifactId>
        <version>${hibernate-jpamodelgen.version}</version>
    </dependency>
</dependencies>
</plugin>

When hibernate-jpamodelgen.version=5.6.14.Final, it works.

When I try to upgrade to 6.1.6.Final, the classes are not generated, hence I get compilation errors.

Samuel
  • 594
  • 1
  • 6
  • 22
  • 3
    You should probably switch to [org.hibernate.orm:hibernate-jpamodelgen:6.1.6.Final](https://central.sonatype.dev/artifact/org.hibernate.orm/hibernate-jpamodelgen/6.1.6.Final) (note: the groupId changed). Otherwise, you'll need to be a bit more explicit in your problem description (e.g. provide a [mre] and include all errors). Also be aware that Hibernate 6 is one big breaking change given it changed to the `jakarta.persistence.*` package namespace (JPA 3), where Hibernate 5.6 used the `javax.persistence` package namespace (JPA 2.2). – Mark Rotteveel Dec 16 '22 at 11:02
  • 1
    That is not required to use `maven-processor-plugin`, adding `hibernate-jpamodelgen` to the project dependencies with `scope=provided` should be enough. – Andrey B. Panfilov Dec 16 '22 at 11:21

0 Answers0