I’m trying to create classes from database schema, but I need to apply some filters on the schemas. As far as i’ve understood (little), this is done in the hibernate.reveng.xml.
I failed to find in the documentation how to reference that file so i tried different approaches, none of them worked.
This is my pom file, it works but it doesn’t consider the hibernate.reveng.xml.
<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.acme</groupId>
<artifactId>bar</artifactId>
<version>0.0.1-SNAPSHOT</version>
<properties>
<hibernate.version>6.5.2.Final</hibernate.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.hibernate.tool</groupId>
<artifactId>hibernate-tools-maven</artifactId>
<version>${hibernate.version}</version>
<dependencies>
<dependency>
<groupId>org.hibernate.tool</groupId>
<artifactId>hibernate-tools-orm</artifactId>
<version>${hibernate.version}</version>
</dependency>
<dependency>
<groupId>net.sf.jt400</groupId>
<artifactId>jt400</artifactId>
<version>11.2</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>entity-generation</id>
<phase>generate-sources</phase>
<goals>
<goal>hbm2java</goal>
</goals>
<configuration>
<components>
<component>
<name>hbm2java</name>
<outputDirectory>generated-sources/hibernate</outputDirectory>
<configuration>
<property name="ejb3" value="true"/>
<property name="jdk5" value="true"/>
<property name="configurationfile" value="src/main/resources/hibernate.reveng.xml"/>
</configuration>
</component>
</components>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
When calling
mvn clean generate-sources
it start looking at the tables, but in the output I see also this warning:
Parameter 'components' is unknown for plugin 'hibernate-tools-maven:6.5.2.Final:hbm2java (entity-generation)'
I attempted to correct the error by removing the encapsulating “components” node but actually I’ve no clue of how the correct structure should be. Can anyone point me in the right direction?