Go to file
Ivan Martyniuk 83055eb49f
CP-9: fix plugin build (#16)
* bump deps version /CP-9

* fix plugin build /CP-9
2024-06-20 18:56:18 +03:00
.github 🔄 Synced file(s) with valitydev/configurations (#2) 2022-03-17 13:35:41 +03:00
src/main/java/dev/vality/maven/plugins/pg/embedded/plugin migrate on dev.vality domain and GitHub Action CI 2022-02-01 19:21:38 +07:00
.gitignore Maven plugin "PostgreSQL embended" ver.1.0 2018-11-30 18:50:45 +03:00
CODEOWNERS 🔄 Synced file(s) with valitydev/configurations (#2) 2022-03-17 13:35:41 +03:00
LICENSE Switch to public maven repo (#7) 2020-07-10 14:02:46 +03:00
pom.xml CP-9: fix plugin build (#16) 2024-06-20 18:56:18 +03:00
README.md migrate on dev.vality domain and GitHub Action CI 2022-02-01 19:21:38 +07:00
renovate.json Add renovate.json (#1) 2022-03-17 13:36:55 +03:00

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