{"id":18254083,"url":"https://github.com/testcontainers/testcontainers-jooq-codegen-maven-plugin","last_synced_at":"2025-10-17T22:02:37.696Z","repository":{"id":162552738,"uuid":"637061696","full_name":"testcontainers/testcontainers-jooq-codegen-maven-plugin","owner":"testcontainers","description":"jOOQ code generator using Testcontainers","archived":false,"fork":false,"pushed_at":"2024-05-06T21:13:09.000Z","size":169,"stargazers_count":62,"open_issues_count":20,"forks_count":14,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-06-03T08:32:23.800Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/testcontainers.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-06T11:43:13.000Z","updated_at":"2025-03-03T15:36:51.000Z","dependencies_parsed_at":"2024-02-23T11:25:54.416Z","dependency_job_id":"2e5dbbbf-8b66-4b04-979f-2a04f9298923","html_url":"https://github.com/testcontainers/testcontainers-jooq-codegen-maven-plugin","commit_stats":{"total_commits":38,"total_committers":6,"mean_commits":6.333333333333333,"dds":0.5789473684210527,"last_synced_commit":"887bdcc9ba0e33cb5789881e9c0f0a305278acdd"},"previous_names":["testcontainers/testcontainers-jooq-codegen-maven-plugin"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/testcontainers/testcontainers-jooq-codegen-maven-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testcontainers%2Ftestcontainers-jooq-codegen-maven-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testcontainers%2Ftestcontainers-jooq-codegen-maven-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testcontainers%2Ftestcontainers-jooq-codegen-maven-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testcontainers%2Ftestcontainers-jooq-codegen-maven-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/testcontainers","download_url":"https://codeload.github.com/testcontainers/testcontainers-jooq-codegen-maven-plugin/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testcontainers%2Ftestcontainers-jooq-codegen-maven-plugin/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259308143,"owners_count":22837974,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T10:10:22.604Z","updated_at":"2025-10-17T22:02:37.632Z","avatar_url":"https://github.com/testcontainers.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# testcontainers-jooq-codegen-maven-plugin\n\nThe `testcontainers-jooq-codegen-maven-plugin` simplifies the jOOQ code generation\nby using [Testcontainers](https://www.testcontainers.org/) and applying database migrations.\n\n[![Build](https://github.com/testcontainers/testcontainers-jooq-codegen-maven-plugin/actions/workflows/build.yml/badge.svg)](https://github.com/testcontainers/testcontainers-jooq-codegen-maven-plugin/actions/workflows/build.yml)\n![Maven Central](https://img.shields.io/maven-central/v/org.testcontainers/testcontainers-jooq-codegen-maven-plugin?label=latest-version)\n\n## Summary\n\n- Plugin migration and code generation might be skipped using `skip` property\n- If you need to reuse existing database connection - take a look at [Jooq section](#Jooq)\n\n## Database Configuration\n\nTo configure a target database, you need to specify at least database `type` property.\n\n#### Properties\n\n| Parameter      | Required | Default value                                                              | Description                                                    |\n|----------------|----------|----------------------------------------------------------------------------|----------------------------------------------------------------|\n| type           | yes      |                                                                            | Database implementation one of: `POSTGRES`  `MYSQL`  `MARIADB` |\n| containerImage |          | Provided from database type,usually latest version from official container | Image of used container if not default picked                  |\n| username       |          | Provided from database container if not specified                          | Database username for container                                |\n| password       |          | Provided from database container if not specified                          | Database password for container                                |\n| databaseName   |          | Provided from database container if not specified                          | Database name for container                                    |\n\n#### `database` block configuration\n\n```xml\n\n\u003cdatabase\u003e\n    \u003ctype\u003ePOSTGRES\u003c/type\u003e\n    \u003ccontainerImage\u003epostgres:15-alpine\u003c/containerImage\u003e\n    \u003cusername\u003etest\u003c/username\u003e\n    \u003cpassword\u003etest\u003c/password\u003e\n    \u003cdatabaseName\u003etest\u003c/databaseName\u003e\n\u003c/database\u003e\n```\n\n## Migration tools:\n\n### Flyway\n\nFlyway works the same way as the original plugin  \nPlease find original documentation by link https://flywaydb.org/documentation/usage/maven/\n\n#### Configuration\n\nAt runtime default configuration files will be autoloaded as it documented -\nhttps://flywaydb.org/documentation/configuration/configfile   \nCurrently, the plugin supports all properties existing in Flyway   \nYou can find them by original link   \nhttps://flywaydb.org/documentation/configuration/parameters/   \n\u003cb\u003eNow [config files parameter](https://flywaydb.org/documentation/configuration/parameters/configFiles) is not\nimplemented yet\u003c/b\u003e, but you can use config file at default location ${baseDir}/flyway.conf\n\n#### `flyway` block configuration\n\n- Zero configuration with defaults\n\n```xml \n\n\u003cflyway/\u003e\n```\n\n- Adding properties\n\n```xml\n\n\u003cflyway\u003e\n    \u003cdefaultSchema\u003ebank\u003c/defaultSchema\u003e\n    \u003ccreateSchemas\u003etrue\u003c/createSchemas\u003e\n    \u003ctable\u003emy_custom_history_table\u003c/table\u003e\n    \u003clocations\u003e\n        filesystem:src/main/resources/db/migration/postgres,\n        filesystem:src/main/resources/db/migration/postgresql\n    \u003c/locations\u003e\n\u003c/flyway\u003e\n```\n\n### Liquibase\n\nLiquibase's configuration works the same way as the original maven plugin, with some limitations   \nPlease find documentation by\nlink https://docs.liquibase.com/tools-integrations/maven/using-liquibase-and-maven-pom-file.html\n\n#### Properties\n\nNow supports only the most useful properties\n\n| Property                       | type   | default                                                                                                                      |\n|--------------------------------|--------|------------------------------------------------------------------------------------------------------------------------------|\n| changeLogPath                  | String | if changeLogDirectory is provided - db.changelog-root.xml, otherwise - src/main/resources/db/changelog/db.changelog-root.xml |\n| changeLogDirectory             | String | projectBaseDir                                                                                                               |\n| parameters                     | Map    |                                                                                                                              |\n| defaultSchemaName              | String |                                                                                                                              |\n| liquibaseSchemaName            | String |                                                                                                                              |\n| databaseChangeLogTableName     | String |                                                                                                                              |\n| databaseChangeLogLockTableName | String |                                                                                                                              |\n\nReference to Liquibase properties - https://docs.liquibase.com/concepts/connections/creating-config-properties.html\n\n#### `liquibase` block configuration\n\n- Zero configuration with defaults\n\n```xml\n\n\u003cliquibase/\u003e\n```\n\n- Adding properties\n\n```xml\n\n\u003cliquibase\u003e\n    \u003cchangeLogPath\u003edb.changelog-root.yml\u003c/changeLogPath\u003e\n    \u003cchangeLogDirectory\u003esrc/main/resources/db/postgres/changelog\u003c/changeLogPath\u003e\n    \u003cdefaultSchemaName\u003ecustom\u003c/defaultSchemaName\u003e\n\u003c/liquibase\u003e \n```\n\n### JOOQ\n\n#### Properties\n\n`generator` - property to configure JOOQ code generation settings.\nSee https://www.jooq.org/doc/latest/manual/code-generation/codegen-configuration for all the supporting configuration\nproperties.  \n`configurationFiles` / `configurationFile` - are not implemented yet   \n`jdbc` - If it has all the necessary JDBC parameters (URL, name, password), it will use the existing database, and no container will be spun up.  \n`baseDir` - directory relative to which generated sources will be generated , `{project.basedir}` - default\n\n#### `jooq` block configuration\n\n```xml\n\n\u003cjooq\u003e\n    \u003cgenerator\u003e\n        \u003cdatabase\u003e\n            ...\n        \u003c/database\u003e\n    \u003c/generator\u003e\n    \u003cjdbc\u003e\n        ....\n    \u003c/jdbc\u003e\n\u003c/jooq\u003e\n```\n\n#### Plugin dependencies configuration\n\n```xml\n\n\u003cdependency\u003e\n    \u003cgroupId\u003eorg.postgresql\u003c/groupId\u003e\n    \u003cartifactId\u003epostgresql\u003c/artifactId\u003e\n    \u003cversion\u003e${postgresql.version}\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## Examples\n\n### Complete example\n\nExample with `PostgreSQL` and minimal configuration with `Flyway` and `JOOQ`\n\n```xml\n\n\u003cplugin\u003e\n    \u003cgroupId\u003eorg.testcontainers\u003c/groupId\u003e\n    \u003cartifactId\u003etestcontainers-jooq-codegen-maven-plugin\u003c/artifactId\u003e\n    \u003cversion\u003e${testcontainers-jooq-codegen-maven-plugin.version}\u003c/version\u003e\n    \u003cdependencies\u003e\n        \u003cdependency\u003e\n            \u003cgroupId\u003eorg.testcontainers\u003c/groupId\u003e\n            \u003cartifactId\u003epostgresql\u003c/artifactId\u003e\n            \u003cversion\u003e${testcontainers.version}\u003c/version\u003e\n        \u003c/dependency\u003e\n        \u003cdependency\u003e\n            \u003cgroupId\u003eorg.postgresql\u003c/groupId\u003e\n            \u003cartifactId\u003epostgresql\u003c/artifactId\u003e\n            \u003cversion\u003e${postgresql.version}\u003c/version\u003e\n        \u003c/dependency\u003e\n    \u003c/dependencies\u003e\n    \u003cexecutions\u003e\n        \u003cexecution\u003e\n            \u003cid\u003egenerate-jooq-sources\u003c/id\u003e\n            \u003cgoals\u003e\n                \u003cgoal\u003egenerate\u003c/goal\u003e\n            \u003c/goals\u003e\n            \u003cphase\u003egenerate-sources\u003c/phase\u003e\n            \u003cconfiguration\u003e\n                \u003cdatabase\u003e\n                    \u003ctype\u003ePOSTGRES\u003c/type\u003e\n                \u003c/database\u003e\n                \u003cflyway/\u003e\n                \u003cjooq\u003e\n                    \u003cgenerator\u003e\n                        \u003cdatabase\u003e\n                            \u003cincludes\u003e.*\u003c/includes\u003e\n                            \u003cinputSchema\u003epublic\u003c/inputSchema\u003e\n                        \u003c/database\u003e\n                        \u003ctarget\u003e\n                            \u003cpackageName\u003eorg.jooq.codegen.maven.example\u003c/packageName\u003e\n                            \u003cdirectory\u003etarget/generated-sources/jooq\u003c/directory\u003e\n                        \u003c/target\u003e\n                    \u003c/generator\u003e\n                \u003c/jooq\u003e\n            \u003c/configuration\u003e\n        \u003c/execution\u003e\n    \u003c/executions\u003e\n\u003c/plugin\u003e\n```\n\n### More examples\n\n[MariaDB + Flyway](examples/mariadb-flyway-example )   \n[MySQL + Flyway](examples/mysql-flyway-example )   \n[Postgres + Flyway](examples/postgres-flyway-example )   \n[Postgres + Liquibase](examples/postgres-liquibase-example )\n\n### Try with example application\n\n```shell\n$ cd examples/postgres-flyway-example\n$ mvn clean package\n```\n\nThe JOOQ code should be generated under example/target/generated-sources/jooq folder.\n\n## CREDITS:\n\nThis plugin is heavily based on official https://github.com/jOOQ/jOOQ/tree/main/jOOQ-codegen-maven.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftestcontainers%2Ftestcontainers-jooq-codegen-maven-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftestcontainers%2Ftestcontainers-jooq-codegen-maven-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftestcontainers%2Ftestcontainers-jooq-codegen-maven-plugin/lists"}