The last hurdle that I’m running into with my migration to Java 11 is getting the Hibernate JPA Metamodel generation to run alongside Google’s error-prone static analysis.
Their configuration above Java 8 requires that you define it as an annotation processor path in the maven complier plugin. http://errorprone.info/docs/installation
Once you add something to the annotation processor paths they are no longer discovered dynamically so I have to move the hibernate-jpamodelgen into the annotation processor paths as well.
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>11</source>
<target>11</target>
<compilerArgs>
<arg>-XDcompilePolicy=simple</arg>
<arg>-Xplugin:ErrorProne</arg>
</compilerArgs>
<annotationProcessorPaths>
<path>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_core</artifactId>
<version>2.3.3</version>
</path>
<path>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-jpamodelgen</artifactId>
<version>5.3.9.Final</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
When I do that however the build fails.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project oss: Fatal error compiling: java.lang.NoClassDefFoundError:javax/xml/bind/JAXBException: javax.xml.bind.JAXBException -> [Help 1]
It would appear that the hibernate-jpamodelgen is missing a dep to the jax-b libraries which are no longer included in Java 11.
Has anyone else run into this?