Jooq-codegen-maven plugin for different db at the same time

I am using jOOQ and MySQL DB in my application. For integration tests, I use the H2 database, and there is a problem. Is there a way to run the jooq-codegen-maven plugin twice? In this case, I found a maven example . However, in two different cases, I have to use two different dependencies. Can I somehow add dependency to execution?

+5
source share
1 answer

You can have multiple <execution> elements in any Maven plugin configuration, for example

 <plugin> <groupId>org.jooq</groupId> <artifactId>jooq-codegen-maven</artifactId> <version>3.9.1</version> <executions> <execution> <id>first-generation</id> <phase>generate-sources</phase> <goals><goal>generate</goal></goals> <configuration> <!-- jOOQ configuration here --> </configuration> </execution> <execution> <id>second-generation</id> <phase>generate-sources</phase> <goals><goal>generate</goal></goals> <configuration> <!-- jOOQ configuration here --> </configuration> </execution> </executions> </plugin> 
+5
source

Source: https://habr.com/ru/post/1203636/


All Articles