I kind of have the same problem as: Hibernate, Java 9 and SystemException
I can follow the steps like this
Update 2019/08/05
Libraries have been updated to allow for better support. Please use the same module-info definitions as
opens xx.xx.xx.entities to org.hibernate.orm.core;
requires java.transaction;
requires java.xml.bind;
requires java.sql;
requires java.activation;
requires java.persistence;
Maven has been simplified greatly
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<annotationProcessorPaths>
<annotationProcessorPath>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-jpamodelgen</artifactId>
<version>${maven.hibernate.version}</version>
</annotationProcessorPath>
<annotationProcessorPath>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</annotationProcessorPath>
<path>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.0</version>
</path>
<path>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>1.3.1</version>
</path>
<path>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct-processor</artifactId>
<version>${mapstruct.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
Ok, So it takes a bit This is also for JDK 10, The annotation processing is for JPAModelGen support.
Configure maven
<properties>
<jdk.version>1.10</jdk.version>
<jar.classifier>jre10</jar.classifier> <!-- Optional for Dual Build-->
<maven.compiler.source>1.10</maven.compiler.source>
<maven.compiler.target>1.10</maven.compiler.target>
<maven.compiler.release>10</maven.compiler.release>
Then configure the compiler for JDK 10
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven.compiler.version}</version>
<configuration>
<release>10</release>
</configuration>
<dependencies>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
<version>6.2</version> <!-- Use newer version of ASM -->
</dependency>
</dependencies>
</plugin>
Then add the patch modules for java.xml.bind and java.transaction
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven.compiler.version}</version>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/generated-sources/annotations</outputDirectory>
<annotationProcessorPaths>
<annotationProcessorPath>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-jpamodelgen</artifactId>
<version>${maven.hibernate.version}</version>
</annotationProcessorPath>
<annotationProcessorPath>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>${jaxb.version}</version>
</annotationProcessorPath>
</annotationProcessorPaths>
<annotationProcessors>
<annotationProcessor>org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor</annotationProcessor>
</annotationProcessors>
<compilerArgs>
<arg>-AaddGeneratedAnnotation=false</arg>
<arg>--patch-module</arg>
<arg>java.transaction=${settings.localRepository}/javax/transaction/javax.transaction-api/${javax.transaction.transactionapi}/javax.transaction-api-${javax.transaction.transactionapi}.jar</arg>
<arg>--patch-module</arg>
<arg>java.xml.bind=${settings.localRepository}/javax/xml/bind/jaxb-api/${jaxb.version}/jaxb-api-${jaxb.version}.jar</arg>
</compilerArgs>
<compilerArguments>
<AaddGeneratedAnnotation>false</AaddGeneratedAnnotation>
<Adebug>true</Adebug>
</compilerArguments>
<failOnError>true</failOnError>
</configuration>
<dependencies>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-jpamodelgen</artifactId>
<version>${maven.hibernate.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>${jaxb.version}</version>
<type>jar</type>
</dependency>
</dependencies>
</plugin>
Properties are
<jaxb.version>2.3.0</jaxb.version>
<javax.transaction.transactionapi>1.3</javax.transaction.transactionapi>
<maven.hibernate.version>5.3.2.Final</maven.hibernate.version>
<maven.hibernate.validator.version>6.0.10.Final</maven.hibernate.validator.version>
<maven.hibernate.annotations.version>5.0.1.Final</maven.hibernate.annotations.version>
<maven.hibernate.jpa.persistence.version>1.0.2.Final</maven.hibernate.jpa.persistence.version>
Dependencies on top that i included to make sure maven downloaded
<dependency>
<groupId>javax.transaction</groupId>
<artifactId>javax.transaction-api</artifactId>
<version>${javax.transaction.transactionapi}</version>
<type>jar</type>
<scope>provided</provided>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>${maven.hibernate.version}</version>
<type>jar</type>
<exclusions>
<exclusion>
<artifactId>jboss-transaction-api_1.2_spec</artifactId>
<groupId>org.jboss.spec.javax.transaction</groupId>
</exclusion>
<exclusion>
<artifactId>javax.activation-api</artifactId>
<groupId>javax.activation</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
<version>${maven.hibernate.validator.version}</version>
<type>jar</type>
<exclusions>
<exclusion>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
</exclusion>
</exclusions>
</dependency>
but wait, there's more...
opens xx.xx.xx.entities to org.hibernate.orm.core;
requires java.transaction;
requires java.xml.bind;
requires java.sql;
requires java.activation;
requires java.persistence;
Then configure your runtime accordingly, eclipse and netbeans just add the vm args for the patch modules defined above.
I'm using @args here just to go with the grain of JDK 9 and up, so it is strict moduled. JDK 11 (ea so far) all of it is required, except for patch module specifications which can be removed as 1.3 will solely declare the package