How to set a custom revengStrategy in hibernate-tools-maven?

I am trying to build an application that will connect to an existing apache druid database.
I’m using org.apache.calcite.avatica as jdbc drivers.
The db, the definition of the tables, etc has been already established, and I wanted to use hibernate-tools to build the java entities in my project.

Unfortunately it seems it’s not directly possible to the tools to determine the classes, as the tool ends with an error and these logs:

set 20, 2023 7:58:04 PM org.hibernate.tool.internal.reveng.reader.PrimaryKeyProcessor processPrimaryKey
WARN: The JDBC driver didn't report any primary key columns in ocl-dlq-us-east-2. Asking rev.eng. strategy
set 20, 2023 7:58:04 PM org.hibernate.tool.internal.reveng.reader.PrimaryKeyProcessor processPrimaryKey
WARN: Rev.eng. strategy did not report any primary key columns for ocl-dlq-us-east-2

While I don’t think I can do anything on the JDBC driver, I was hoping I could inject a custom org.hibernate.tool.api.reveng.RevengStrategy using the <revengStrategy> configuration in hibernate-tools-maven.
However I cannot find a way to make my custom class visible to the plugin: I have created the class com.example.RevEngDruidStrategy in my project, and I’ve tried to set this name in the config, but all I got is a java.lang.ClassNotFoundException

How can I tell hibernate-tools-maven where to search for my custom .java / .class file?

If you’re using it as a plugin, you will have to add the maven module containing the class as plugin dependency. See e.g. Maven – Guide to Configuring Plug-ins

Hi.
I think I’ve found a solution following your advice … but I don’t like it (at the moment I’ve just hardcoded a jar build from my class as system dependency)

Now I’m facing another issue: I’m trying to connect to a druid database using apache calcite avatica.

and after passing the “primary key” issue now I have

set 21, 2023 3:16:23 PM org.hibernate.tool.internal.reveng.RevengMetadataBuilder createPersistentClasses
WARN: Cannot create persistent class for Table(druid.druid.ocl-dlq-us-east-2) as no columns were found.
set 21, 2023 3:16:23 PM org.hibernate.tool.internal.reveng.RevengMetadataBuilder createPersistentClasses
WARN: Cannot create persistent class for Table(druid.druid.ocl-messages-us-east-2) as no columns were found.

it seems that the driver is not able to find the columns. Is there a way I can investigate the issue?

I’d say debug into RevengMetadataBuilder during your maven build. You should be able to run mvnDebug instead of mvn and attach a debugger to the process. That way, you can debug plugins as they operate on the project.