Switch to a different Hibernate ORM slot
In order to use a different module other than the default org.hibernate:main specify the identifier of the module you wish to use via the jboss.as.jpa.providerModule
property in the persistence.xml file of your application, as in the following example.
Example 6. Using an alternative module slot of Hibernate ORM
<persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence
http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"
version="2.1" >
<persistence-unit name="examplePu">
<!-- ... -->
<properties>
<property name="jboss.as.jpa.providerModule" value="org.hibernate:5.4"/>
</properties>
<!-- ... -->
</persistence-unit>
</persistence>
Needless to say, this will affect the classpath of your application: if your single application declares multiple persistence units, they should all make a consistent choice!
This property is documented in the WildFly JPA Reference Guide; you might want to check it out as it lists several other useful properties.