jpajhipstermetamodelmaven-compiler-pluginjava-10

JHipster5 project with JPA static metamodel on Java 10


I have been trying to upgrade my JHipster 5 application to use Java 10 but I can't get it to compile and process JPA static metamodels with Maven.

Apparently maven-compiler-plugin is not triggering hibernate-jpamodelgen in order to generate the JPA static metamodels.

In order to upgrade the project I have:

With this I am getting compilation failure when I run ./mvnw clean compile with no further detailed error message.

If I remove the <compilerArgs> tag from pom.xml and run the same command I get: java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException

I have followed the upgrade instructions provided here

Also, I made this example project available on GitHub

This is the commit changes where I upgraded to Java 10


Solution

  • In order to register the solution here wishing to help others, here is what solved this issue:

    It turns out it was some Java 9 compatibility problem with hibernate-jpamodelgen@5.2.16.Final. Once I upgraded to Hibernate version 5.3.1.Final it started to compile again.

    I also had to solve JAXB dependencies following this answer.