Create classes from database

I want to create the java classe from a given database.
I cannot setup a workflow that works for me. I’m not using eclipse and I don’t want to, I need a workflow that is easily reproducible if needed and does not require to install an entire IDE since i already use NetBeans.

I created a maven pom like this:

<?xml version="1.0" encoding="UTF-8"?> 4.0.0 com.mycompany MRPDBClassGenerator 1.0-SNAPSHOT jar
<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>11</maven.compiler.source>
    <maven.compiler.target>11</maven.compiler.target>
</properties>

<dependencies>
    <dependency>
       <groupId>org.hibernate.orm</groupId>
       <artifactId>hibernate-core</artifactId>
       <version>6.4.4.Final</version>
   </dependency>       
</dependencies>
   
<build>
<plugins>       
  <plugin>
    <groupId>org.hibernate.tool</groupId>
    <artifactId>hibernate-tools-maven</artifactId>
    <version>6.4.4.Final</version>
    <dependencies>
      <dependency>
        <groupId>org.hibernate.tool</groupId>
        <artifactId>hibernate-tools-orm</artifactId>
        <version>6.4.4.Final</version>
      </dependency>
    </dependencies>
    <executions>
      <execution>
        <id>entity-generation</id>
        <phase>generate-sources</phase>
        <goals>
          <goal>hbm2java</goal>
        </goals>
        <configuration>
          <ejb3>true</ejb3>
        </configuration>
      </execution>
    </executions>
  </plugin>      
</plugins>    

This is because I copied it somewhere, not because I found it on the Hibernate reference. (This is a first step towards depression).

At this point i tried to run the maven plugin the following way.

image

I’m not a maven expert: is a goal the same of a phase? Hope so. Netbeans is known to have a good maven integration but i find it rough. Perhaps if it presented me with the possible goals it would be clearer.

I also provided an Hibernate.properties file with connection information.

Now I get

Unknown lifecycle phase “entity-generation”. You must specify a valid lifecycle phase or a goal in the format : or :[:]:. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. → [Help 1]

(really depressed now because I feel like a locksmith instead of a developer)

Can anyone point me in the right direction?

tnx in advance

Hey @Koen_Aers I think this one is for you.