mirror of
https://github.com/valitydev/pg-embedded-plugin.git
synced 2024-11-06 01:05:18 +00:00
83055eb49f
* bump deps version /CP-9 * fix plugin build /CP-9 |
||
---|---|---|
.github | ||
src/main/java/dev/vality/maven/plugins/pg/embedded/plugin | ||
.gitignore | ||
CODEOWNERS | ||
LICENSE | ||
pom.xml | ||
README.md | ||
renovate.json |
PG Embedded plugin
This is a maven plugin for for starting a embedded postgresql server. By default the server starts at the initialization stage and stops at the compile stage. Possible values in the configuration block:
- dbDir (optional, deprecated, dir actual) - file directory of the instance (if it will be empty then files will create in a terger directory);
- port (required; default 15432) - port on which the instance will be started;
- dbName (required, deprecated, name actual) - name of database witch will be created in the instance;
- schemas (required) - list of scheme witch will be created in the instance.
You can use this example to start the server during maven initialization lifecycle.
Example:
<plugin>
<groupId>dev.vality.maven.plugins</groupId>
<artifactId>pg-embedded-plugin</artifactId>
<version>1.8</version>
<configuration>
<port>${db.port}</port>
<name>${db.name}</name>
<schemas>
<schema>${db.schema}</schema>
</schemas>
</configuration>
<executions>
<execution>
<id>PG_server_start</id>
<phase>initialize</phase>
<goals>
<goal>start</goal>
</goals>
</execution>
<execution>
<id>PG_server_stop</id>
<phase>compile</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
Attention: extremely important to pay attention to the stages of launching plug-ins dependent on the launch of this plugin. For example, your flyway should runnin' on phase initialize and your JOOQ should runnin' on phase generate-sources