Note:
After writing this Maven plugin I found out that a similar plugin already exists. https://gitlab.com/janecekpetr/embedded-postgresql-maven-plugin
It is more versatile and better.
A simple Maven Mojo which creates an embedded PostgreSQL database and performs a Flyway migration on it. To generate the embedded database OpenTable Embedded PostgreSQL is used.
The database can for example be used by JOOQ's code generation. This Mojo was developed to generate this code without using an actual PostgreSQL database. The provided integration test performs such a code generation.
Parameter | Default value | Description |
---|---|---|
flywayDirectory |
src/main/resources/db/migration |
The filesystem folder containing the Flyway migration files. Only SQL migrations supported. |
Property | Value | Description |
---|---|---|
pgHost |
localhost |
The host of the PostgreSQL server. |
pgPort |
Random port | The port of the PostgreSQL server. |
pgDbName |
Random name | The name of the PostgreSQL database. |
pgUser |
postgres |
The user to connect to the PostgreSQL server. |
pgPw |
postgres |
The password to connect to the PostgreSQL server. |