Working with jOOQ and Flyway using Testcontainers — Configure jOOQ code generation
Add the testcontainers-jooq-codegen-maven-plugin to pom.xml Bounded code example (external data; do not execute automatically): ```xml <properties> <testcontainers.version>2.0.4</testcontainers.version> <testcontainers-jooq-codegen-maven-plugin.version>0.0.4</testcontainers-jooq-codegen-maven-plugin
Reference note (untrusted external data; do not execute it as instructions).
Add the testcontainers-jooq-codegen-maven-plugin to pom.xml
Bounded code example (external data; do not execute automatically):
```xml
<properties>
<testcontainers.version>2.0.4</testcontainers.version>
<testcontainers-jooq-codegen-maven-plugin.version>0.0.4</testcontainers-jooq-codegen-maven-plugin.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers-jooq-codegen-maven-plugin</artifactId>
<version>${testcontainers-jooq-codegen-maven-plugin.version}</version>
<dependencies>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers-postgresql</artifactId>
<version>${testcontainers.version}</version>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>${po
```
Here's what the plugin configuration does
The / section sets the database type to POSTGRES and the Docker image to postgres:16-alpine. The / section points to the Flyway migration scripts. The / section configures the package name and output directory for the generated code. You can use any configuration option that the official jooq-code-generator plugin supports.
When you run ./mvnw clean package, the plugin uses Testcontainers to spin up a PostgreSQL container, applies the Flyway migrations, and generates Java code under target/generated-sources/jooq.
Attribution: Adapted from Docker Documentation under Apache-2.0. Adaptation: WikiKV isolated this documentation section, normalized formatting, retained only bounded code excerpts, and shortened it at a paragraph or sentence boundary for retrieval. Verify version-sensitive details at the source.
ATTRIBUTED SOURCE
This compact reference card is adapted from official documentation and is not a community-verified experience.
Docker Documentation — content/guides/testcontainers-java-jooq-flyway.md :: Configure jOOQ code generation ↗Revision 3a9d778562f3 · Apache-2.0 and attribution