Suggestion#1:
You can use maven ant runner. It may help.
mvn antrun:run@hbm2java
If you have modified templates (see the documentation) then, in pom.xml, modify the hibernate tool tag to look like:
<hibernatetool templatepath="src/the/path/to/the/directory/containing/pojo/directory">
The above path must point to the parent of the directory named pojo, containing your templates.
Also, if you have a custom reverse engineering strategy class the, in pom.xml add this attribute to jdbcconfiguration tag.
reversestrategy="fully.qualified.name.CustomDelegatingReverseEngineeringStrategy"
Resource Link: Hibernate tools reverse engineering using Maven
I haven't checked it but you can try with this procedure using Hibernate 5.X version.
Suggestion#2:
This issue seems critical in Hibernate 5.x version. All recommendation is to use 4.3 version for reverse engineering instead of 5.x
Resource Link: https://stackoverflow.com/a/37577315
Step by step tutorial to use 4.3 instead of 5.1 with pictorial view is given here:
http://o7planning.org/en/10125/using-hibernate-tools-generate-entity-classes-from-tables
Some issues are given below:
- Database case-sensitive issue
- type mapping
- table filtering
- no
<schema-selection>
tag is specified
This issues is required to resolve by hand (it's just basic XML) or you can use the Hibernate plugins, which provides a specialized editor.
http://www.hibernate.org/30.html
For reverse engineering rule, you can go through this tutorial: Chapter 6. Controlling reverse engineering