Search code examples
javaxmlpostgresqlmavenjooq

How to utliize Custom Converter in jOOQ using Maven configuration?


I'm having issue with setting pom.xml file in my Maven project which is using vertx-jooq library (combo of vertx and jOOQ library).

My main project is let's say project A (vertx-my-project) and I need reference project B (vertx-jooq-generate). I've referenced project B inside of project A's pom.xml file in dependencies section:

<dependencies>
 <!-- ...other necessary dependencies in Project A -->
 <dependency>
    <groupId>io.github.jklingsporn</groupId>
    <!-- artifactId is project B's artifactId -->
    <artifactId>vertx-jooq-generate</artifactId>  
    <version>5.1.1</version>
    <type>jar</type>
    <scope>compile</scope>
  </dependency>
</dependencies>

...and also I've referenced it (Project B) in Eclipse by checking it in Project References section of Project's Properties window. BTW, I'm using this one ClassicReactiveVertxGenerator as default code generator for my project.

I've created custom converter (like in this example and let's call it CustomGenerator) which is used to convert to/from String to/from java.time.LocalDateTime type in order to be able to work with Timestamp field type because Vert.x JsonObject does NOT have getter/setter methods for Timestamp type implemented. I did this by adding another project as a dependency in my original project and by changing (to be more precise adding) 2 methods in class which is used as generator class.

Also, I did a research on how to properly utilize CustomGenerator in pom.xml file but no luck. So my question is how can I use my CustomGenerator and/or can someone please point out what should I do/look for?
Thank you in advance.

PS. I'm using jooq-codegen-maven 3.13.1 version in Maven project.


Solution

  • I've updated my question to make it more clear what I actually did and want to achieve.

    After couple of hours of doing some more experimenting I've managed to reach a solution by doing:
    1) Edit already used CustomGenerator ClassicReactiveVertxGenerator already created in Project B (vertx-jooq-generate) and add it 2 necessary methods (actually these 2) for conversion.
    2) Run mvn clean install on Project B and then on Project A

    That solved issue. I've managed to do this by following this answer.