<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>com.atlassian.jira.plugins</groupId>
        <artifactId>insight-parent-pom</artifactId>
        <version>8.9.2</version>
    </parent>

    <groupId>com.atlassian.servicedesk</groupId>
    <artifactId>insight-tests-parent</artifactId>
    <version>8.9.2</version>
    <packaging>pom</packaging>

    <name>Insight Tests Parent POM</name>

    <modules>
        <module>insight-test-utils</module>
    </modules>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <rest.service.object.attribute.filter>/rest/insight/1.0/objectattributefilter
        </rest.service.object.attribute.filter>

        <maven.compiler.target>1.8</maven.compiler.target>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.version>3.8.1</maven.compiler.version>
        <maven.surefire.version>3.0.0-M3</maven.surefire.version>
        <maven.exec.plugin.version>1.6.0</maven.exec.plugin.version>

        <junit.jupiter.version>5.3.2</junit.jupiter.version>
        <jersey.client.version>1.19.4</jersey.client.version>
        <log4j.version>2.11.2</log4j.version>
        <lombok.version>1.18.8</lombok.version>
        <commons-lang3.version>3.9</commons-lang3.version>
        <commons-csv.version>1.6</commons-csv.version>
        <hamcrest.version>2.1</hamcrest.version>
        <jersey.common.version>2.22.2</jersey.common.version>
        <httpclient.version>4.5.8</httpclient.version>
        <okhttp.version>4.9.1</okhttp.version>
        <httpmime.version>4.5.8</httpmime.version>
        <insight-integration-test-helper.version>1.0.0</insight-integration-test-helper.version>
        <spotbugs.maven.version>3.1.11</spotbugs.maven.version>
        <spotbugs.version>4.0.0-beta2</spotbugs.version>
        <hibernate.version>1.4.185</hibernate.version>
        <test-gadgets-core.version>0.0.9</test-gadgets-core.version>
        <embedded-ldap-junit.version>0.8.1</embedded-ldap-junit.version>
        <atlassian.webdriver.version>3.1.4</atlassian.webdriver.version>
        <sql.maven.plugin.version>1.5</sql.maven.plugin.version>
        <postgres.version>42.2.18</postgres.version>


        <!-- version for plugins required for jira-maven-plugin -->
        <insight.version>${project.version}</insight.version>
        <insight.discovery.version>3.0.2</insight.discovery.version>
        <jira.version>8.13.9</jira.version>
        <!-- This is just a version installed for page objects to work with EnsureJIRASetupTests -->
        <jira.selenium.version>8.19.0-QR-20210727104317</jira.selenium.version>
        <testkit.version>8.1.21</testkit.version>
        <querydsl.version>4.1.4</querydsl.version>
        <querydsl.provider.version>1.0</querydsl.provider.version>
        <plugin.testrunner.version>2.0.1</plugin.testrunner.version>
        <frontend.runtime.plugin.version>0.2.0</frontend.runtime.plugin.version>
        <pocketknife.api.commons.version>1.0.7</pocketknife.api.commons.version>
        <analytics.version>5.6.0</analytics.version>
        <jwt.plugin.version>3.2.0</jwt.plugin.version>


        <jira.jvm.args>-Xmx2048m -XX:MaxPermSize=512m -XX:ReservedCodeCacheSize=512m -Duser.timezone=UTC</jira.jvm.args>
        <xvfb.enable>false</xvfb.enable>
        <atlassian.dev.mode>false</atlassian.dev.mode>
        <jira.extractDependencies>false</jira.extractDependencies>
        <webdriver.browser>firefox</webdriver.browser>
        <webdriver.browser.headless>true</webdriver.browser.headless>
        <atlassian.sd.upgrade.task.version.limit>0</atlassian.sd.upgrade.task.version.limit>

        <test-gadgets-core.version>0.0.9</test-gadgets-core.version>
        <embedded-ldap-junit.version>0.8.1</embedded-ldap-junit.version>
        <wiremock-standalone.version>2.28.0</wiremock-standalone.version>

        <dbconfig.path>${project.basedir}/../src/db</dbconfig.path>
        <sql.setup.path>${project.basedir}/../src/sql</sql.setup.path>

        <!-- no need to validate or publish javadocs for integration test modules -->
        <maven.javadoc.skip>true</maven.javadoc.skip>
        <sonar.skip>true</sonar.skip>

        <install.jsm>false</install.jsm>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-func-tests</artifactId>
            <version>${jira.selenium.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.hamcrest</groupId>
                    <artifactId>hamcrest-library</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.hamcrest</groupId>
                    <artifactId>hamcrest-core</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.hamcrest</groupId>
                    <artifactId>hamcrest-all</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.junit</groupId>
                    <artifactId>junit</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>junit</groupId>
                    <artifactId>junit</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>junit</groupId>
                    <artifactId>junit-dept</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.atlassian</groupId>
                    <artifactId>atlassian-logging</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>log4j</groupId>
                    <artifactId>log4j</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.logging.log4j</groupId>
                    <artifactId>log4j-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.logging.log4j</groupId>
                    <artifactId>log4j-core</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.logging.log4j</groupId>
                    <artifactId>log4j-slf4j-impl</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>jul-to-slf4j</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-log4j12</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>jcl-over-slf4j</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>junit</groupId>
                    <artifactId>junit-dep</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.junit.vintage</groupId>
                    <artifactId>junit-vintage-engine</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.atlassian.selenium</groupId>
            <artifactId>atlassian-webdriver-core</artifactId>
            <version>${atlassian.webdriver.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.hamcrest</groupId>
                    <artifactId>hamcrest-core</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>junit</groupId>
                    <artifactId>junit</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>atlassian-jira-pageobjects</artifactId>
            <version>${jira.selenium.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.hamcrest</groupId>
                    <artifactId>hamcrest-core</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>junit</groupId>
                    <artifactId>junit</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>io.riada.insight</groupId>
            <artifactId>insight-integration-test-helper</artifactId>
            <version>${insight-integration-test-helper.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-api</artifactId>
            <version>${jira.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>log4j</groupId>
                    <artifactId>log4j</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>${junit.jupiter.version}</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <version>${junit.jupiter.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-params</artifactId>
            <version>${junit.jupiter.version}</version>
            <scope>test</scope>
        </dependency>
        <!-- The Junit vintage runner is required to run the Selenium setup test -->
        <dependency>
            <groupId>org.junit.vintage</groupId>
            <artifactId>junit-vintage-engine</artifactId>
            <version>${junit.jupiter.version}</version>
            <scope>test</scope>
        </dependency>
        <!-- Used to run embedded-ldap-junit junit 4 rule -->
        <dependency>
            <groupId>uk.org.webcompere</groupId>
            <artifactId>test-gadgets-core</artifactId>
            <version>${test-gadgets-core.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-library</artifactId>
            <version>${hamcrest.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.module</groupId>
            <artifactId>jackson-module-jaxb-annotations</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.jaxrs</groupId>
            <artifactId>jackson-jaxrs-json-provider</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.module</groupId>
            <artifactId>jackson-module-kotlin</artifactId>
            <version>${fasterxml.version}</version>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jersey.core</groupId>
            <artifactId>jersey-common</artifactId>
            <version>${jersey.common.version}</version>
        </dependency>
        <dependency>
            <groupId>com.sun.jersey</groupId>
            <artifactId>jersey-client</artifactId>
            <version>${jersey.client.version}</version>
        </dependency>
        <dependency>
            <groupId>com.sun.jersey.contribs</groupId>
            <artifactId>jersey-multipart</artifactId>
            <version>${jersey.client.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
            <version>${httpclient.version}</version>
        </dependency>
        <dependency>
            <groupId>com.squareup.okhttp3</groupId>
            <artifactId>okhttp</artifactId>
            <version>${okhttp.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpmime</artifactId>
            <version>${httpmime.version}</version>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-migrationsupport</artifactId>
            <version>${junit.jupiter.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-csv</artifactId>
            <version>${commons-csv.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>${commons-lang3.version}</version>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>${lombok.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-api</artifactId>
            <version>${log4j.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-core</artifactId>
            <version>${log4j.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-slf4j-impl</artifactId>
            <version>${log4j.version}</version>
        </dependency>

        <dependency>
            <groupId>org.zapodot</groupId>
            <artifactId>embedded-ldap-junit</artifactId>
            <version>${embedded-ldap-junit.version}</version>
        </dependency>

        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <version>${postgres.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.github.tomakehurst</groupId>
            <artifactId>wiremock-jre8-standalone</artifactId>
            <version>${wiremock-standalone.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.selenium</groupId>
            <artifactId>atlassian-pageobjects-elements</artifactId>
            <version>${atlassian.webdriver.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven.compiler.version}</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven.surefire.version}</version>
                    <configuration>
                        <excludes>
                            <exclude>**/*$*</exclude>
                            <exclude>it/**</exclude>
                        </excludes>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <configuration>
                        <descriptors>
                            <descriptor>src/assembly/new-jira-home-zip.xml</descriptor>
                        </descriptors>
                    </configuration>
                    <executions>
                        <execution>
                            <id>zip-new-jira-home</id>
                            <phase>package</phase>
                            <goals>
                                <goal>single</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <groupId>com.atlassian.maven.plugins</groupId>
                    <artifactId>jira-maven-plugin</artifactId>
                    <version>${amps.version}</version>
                    <extensions>true</extensions>
                    <executions>
                        <execution>
                            <id>start-jira</id>
                            <goals>
                                <goal>run</goal>
                            </goals>
                            <phase>integration-test</phase>
                        </execution>
                        <execution>
                            <id>stop-jira</id>
                            <goals>
                                <goal>stop</goal>
                            </goals>
                            <phase>post-integration-test</phase>
                        </execution>
                    </executions>
                    <configuration>
                        <server>localhost</server>

                        <productVersion>${jira.version}</productVersion>
                        <productDataVersion>${jira.version}</productDataVersion>

                        <jvmArgs>${jira.jvm.args}</jvmArgs>

                        <!-- wait to false, mean AMPS will return from start-jira call and leave instance running -->
                        <wait>false</wait>
                        <!-- instead of product id -->
                        <instanceId>jira</instanceId>
                        <!-- skip the AMPS integration test step -->
                        <skipITs>true</skipITs>

                        <!-- skip the AMPS integration test step -->
                        <skipITs>true</skipITs>
                        <skipAmpsPomCheck>true</skipAmpsPomCheck>
                        <skipTests>true</skipTests>
                        <skipAllPrompts>true</skipAllPrompts>
                        <skipManifestValidation>true</skipManifestValidation>

                        <enableDevToolbox>false</enableDevToolbox>
                        <extractDependencies>${jira.extractDependencies}</extractDependencies>

                        <log4jProperties>../src/test/resources/log4j.properties</log4jProperties>

                        <products>
                            <product>
                                <id>jira</id>
                                <version>${jira.version}</version>
                                <dataVersion>${jira.version}</dataVersion>
                            </product>
                        </products>

                        <extractDependencies>false</extractDependencies>

                        <systemPropertyVariables>
                            <xvfb.enable>${xvfb.enable}</xvfb.enable>
                            <com.atlassian.jira.startup.LauncherContextListener.SYNCHRONOUS>true
                            </com.atlassian.jira.startup.LauncherContextListener.SYNCHRONOUS>
                            <jira.startup.warnings.disable>true</jira.startup.warnings.disable>

                            <atlassian.dev.mode>${atlassian.dev.mode}</atlassian.dev.mode>
                            <atlassian.darkfeature.jira.onboarding.feature.disabled>true
                            </atlassian.darkfeature.jira.onboarding.feature.disabled>

                            <!-- settings below come from servicedesk integration tests -->
                            <!-- Don't schedule any async upgrade tasks while running integration tests, as if run while testing one of them, it breaks the test -->
                            <atlassian.darkfeature.sd.no.schedule.async.upgrade.tasks.enabled>true
                            </atlassian.darkfeature.sd.no.schedule.async.upgrade.tasks.enabled>
                            <!-- Ensure that Automation runs integration tests using the PSMQ Async Engine when available -->
                            <atlassian.darkfeature.sd.automation.psmq.async.executor.enabled>true
                            </atlassian.darkfeature.sd.automation.psmq.async.executor.enabled>
                            <atlassian.mail.senddisabled>true</atlassian.mail.senddisabled>
                            <atlassian.mail.fetchdisabled>true</atlassian.mail.fetchdisabled>
                            <!-- By default, we don't like to deal with websudo, it's just an annoyance -->
                            <jira.websudo.is.disabled>true</jira.websudo.is.disabled>
                            <webdriver.browser>${webdriver.browser}</webdriver.browser>
                            <webdriver.browser.headless>${webdriver.browser.headless}</webdriver.browser.headless>
                            <!-- we run on XVFB, since that's the way the build engineers would
                                            like to go, as opposed to VNC server (according to Min'an) -->
                            <xvfb.enable>${xvfb.enable}</xvfb.enable>
                            <pkqdsl.react.to.clear.cache>true</pkqdsl.react.to.clear.cache>
                            <org.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER>true
                            </org.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER>
                            <mail.mime.decodeparameters>true</mail.mime.decodeparameters>
                            <atlassian.cache.serialization.check>true</atlassian.cache.serialization.check>
                            <atlassian.sd.upgrade.task.version.limit>${atlassian.sd.upgrade.task.version.limit}
                            </atlassian.sd.upgrade.task.version.limit>

                            <!-- allow time for Inisght to install and start -->
                            <atlassian.plugins.enable.wait>840</atlassian.plugins.enable.wait>
                        </systemPropertyVariables>

                        <productDataPath>
                            ${project.build.directory}/${project.artifactId}-${project.version}-new-jira-home.zip
                        </productDataPath>

                        <pluginArtifacts>
                            <pluginArtifact>
                                <groupId>com.atlassian.jira</groupId>
                                <artifactId>jira-func-test-plugin</artifactId>
                                <version>${jira.version}</version>
                            </pluginArtifact>
                            <pluginArtifact>
                                <groupId>com.atlassian.jira.tests</groupId>
                                <artifactId>jira-testkit-plugin</artifactId>
                                <version>${testkit.version}</version>
                            </pluginArtifact>
                            <pluginArtifact>
                                <groupId>com.atlassian.jira.plugins</groupId>
                                <artifactId>insight</artifactId>
                                <version>${project.version}</version>
                            </pluginArtifact>
                            <pluginArtifact>
                                <groupId>com.riadalabs.jira.plugins</groupId>
                                <artifactId>insight-discovery</artifactId>
                                <version>${insight.discovery.version}</version>
                            </pluginArtifact>
                        </pluginArtifacts>

                        <libArtifacts>
                            <libArtifact>
                                <groupId>${db.artifactGroup}</groupId>
                                <artifactId>${db.artifactId}</artifactId>
                            </libArtifact>
                        </libArtifacts>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>${maven.surefire.version}</version>
                    <executions>
                        <execution>
                            <!-- make sure this execution is defined before ci test executions so that we run this first ALWAYS and ensure DB setup -->
                            <id>db_setup_database_tests</id>
                            <goals>
                                <goal>integration-test</goal>
                                <goal>verify</goal>
                            </goals>
                            <phase>integration-test</phase>
                            <configuration>
                                <failIfNoTests>true</failIfNoTests>
                                <includes>
                                    <include>it/jira/dbsetup/**</include>
                                </includes>
                                <systemProperties>
                                    <baseurl.jira>http://localhost:2990/jira</baseurl.jira>
                                    <http.jira.port>2990</http.jira.port>
                                    <context.jira.path>/jira</context.jira.path>
                                    <xvfb.enable>${xvfb.enable}</xvfb.enable>
                                    <webdriver.browser>${webdriver.browser}</webdriver.browser>
                                    <webdriver.browser.headless>${webdriver.browser.headless}
                                    </webdriver.browser.headless>
                                    <jsm.active>${install.jsm}</jsm.active>
                                </systemProperties>
                            </configuration>
                        </execution>
                        <execution>
                            <id>verify</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>verify</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <systemProperties>
                            <xvfb.enable>${xvfb.enable}</xvfb.enable>
                            <atlassian.dev.mode>${atlassian.dev.mode}</atlassian.dev.mode>
                        </systemProperties>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <profiles>
        <profile>
            <id>install-jsm</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>

            <properties>
                <install.jsm>true</install.jsm>
            </properties>

            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>com.atlassian.maven.plugins</groupId>
                            <artifactId>jira-maven-plugin</artifactId>
                            <version>${amps.version}</version>

                            <configuration>
                                <applications>
                                    <application>
                                        <applicationKey>jira-servicedesk</applicationKey>
                                        <version>${jsm.version}</version>
                                    </application>
                                </applications>
                            </configuration>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </build>


        </profile>
        <profile>
            <id>Postgres</id>
            <!-- currently only support Postgres so set it to be always active -->
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>

            <properties>
                <db.artifactGroup>org.postgresql</db.artifactGroup>
                <db.artifactId>postgresql</db.artifactId>
                <db.artifactVersion>9.4.1212</db.artifactVersion>
                <db.ofBizFieldType>postgres72</db.ofBizFieldType>

                <db.schema>public</db.schema>
                <db.url>${jdbc.url}</db.url>
                <db.username>postgres</db.username>
                <db.password>postgres</db.password>
                <db.instance>jiradb</db.instance>
                <db.name>${db.instance}</db.name>

                <db.host>localhost</db.host>
                <db.port>5432</db.port>

                <jdbc.url>jdbc:postgresql://${db.host}:${db.port}/${db.instance}</jdbc.url>
                <jdbc.driver>org.postgresql.Driver</jdbc.driver>

                <database.poolsize>20</database.poolsize>
                <database.type>database-type-standard</database.type>
                <database.validation>select version();</database.validation>
                <database.delegator>default</database.delegator>
            </properties>

            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>org.codehaus.mojo</groupId>
                            <artifactId>sql-maven-plugin</artifactId>
                            <version>${sql.maven.plugin.version}</version>
                            <dependencies>
                                <!-- Use the JDBC driver depending on what RDBMS we're running against -->
                                <dependency>
                                    <groupId>${db.artifactGroup}</groupId>
                                    <artifactId>${db.artifactId}</artifactId>
                                    <version>${db.artifactVersion}</version>
                                </dependency>
                            </dependencies>

                            <configuration>
                                <driver>${jdbc.driver}</driver>
                                <url>${jdbc.url}</url>
                                <autocommit>true</autocommit>
                                <onError>abort</onError>
                                <username>${db.username}</username>
                                <password>${db.password}</password>
                            </configuration>
                            <executions>
                                <execution>
                                    <id>create-db-postgres</id>
                                    <phase>pre-integration-test</phase>
                                    <goals>
                                        <goal>execute</goal>
                                    </goals>
                                    <configuration>
                                        <srcFiles>
                                            <srcFile>${project.build.directory}/sql/setup-postgres.sql</srcFile>
                                        </srcFiles>
                                        <!-- do no include the DB name/instance name here, as we need to delete it -->
                                        <url>jdbc:postgresql://${db.host}:${db.port}/</url>
                                        <delimiterType>row</delimiterType>
                                    </configuration>
                                </execution>
                            </executions>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </build>
        </profile>
        <profile>
            <id>rest-test</id>
            <modules>
                <module>insight-test-rest</module>
                <module>insight-test-utils</module>
            </modules>
        </profile>
        <profile>
            <id>cypress-test</id>
            <modules>
                <module>insight-test-cypress</module>
                <module>insight-test-utils</module>
            </modules>
        </profile>
    </profiles>
</project>
