<?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>10.11.6-QR-0010</version>
    </parent>

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

    <name>Insight Tests Parent POM</name>

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

    <properties>
        <license.scope>test</license.scope>
        <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>
        <frontend.maven.plugin.version>1.12.1</frontend.maven.plugin.version>

        <jersey.client.version>1.19.4</jersey.client.version>
        <lombok.version>1.18.8</lombok.version>
        <commons-lang3.version>3.12.0</commons-lang3.version>
        <commons-csv.version>1.8</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.3</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.25</postgres.version>

        <!-- version for plugins required for jira-maven-plugin -->
        <insight.version>${project.version}</insight.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.32.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>true</install.jsm>
        <start.jira.goal>run</start.jira.goal>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.atlassian.jira.tests</groupId>
            <artifactId>jira-testkit-client</artifactId>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>net.sourceforge.nekohtml</groupId>
                    <artifactId>nekohtml</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-func-tests</artifactId>
            <version>${jira.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>nekohtml</groupId>
                    <artifactId>nekohtml</artifactId>
                </exclusion>
                <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.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.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.oracle</groupId>
            <artifactId>ojdbc8-atlassian-hosted</artifactId>
            <version>19.3.0.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.microsoft.sqlserver</groupId>
            <artifactId>mssql-jdbc</artifactId>
            <version>9.2.1.jre8</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>
    </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>${start.jira.goal}</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>
                        <processI18nUsage>false</processI18nUsage>
                        <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>
                        <log4j2Config>../src/test/resources/log4j2-test.xml</log4j2Config>
                        <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>false</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>

                        <applications>
                            <application>
                                <applicationKey>jira-servicedesk</applicationKey>
                                <version>${jsm.version}</version>
                            </application>
                        </applications>

                        <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.atlassian.jira.plugins</groupId>
                                <artifactId>insight-discovery</artifactId>
                                <version>${insight.discovery.version}</version>
                            </pluginArtifact>
                            <pluginArtifact>
                                <groupId>com.atlassian.jira.plugins.insight</groupId>
                                <artifactId>insight-atlassian-environments</artifactId>
                                <version>${insight.atlassian-environments.version}</version>
                            </pluginArtifact>
                            <pluginArtifact>
                                <groupId>com.atlassian.jira.plugins</groupId>
                                <artifactId>insight-aws-integration</artifactId>
                                <version>${insight.aws.version}</version>
                            </pluginArtifact>
                            <pluginArtifact>
                                <groupId>com.atlassian.jira.plugins</groupId>
                                <artifactId>insight-azure-integration</artifactId>
                                <version>${insight.azure.version}</version>
                            </pluginArtifact>
                            <pluginArtifact>
                                <groupId>com.atlassian.jira.plugins</groupId>
                                <artifactId>insight-cve-integration</artifactId>
                                <version>${insight.cvs.version}</version>
                            </pluginArtifact>
                            <pluginArtifact>
                                <groupId>com.atlassian.jira.plugins</groupId>
                                <artifactId>insight-device42-integration</artifactId>
                                <version>${insight.device42.version}</version>
                            </pluginArtifact>
                            <pluginArtifact>
                                <groupId>com.atlassian.jira.plugins</groupId>
                                <artifactId>insight-googlecloud-integration</artifactId>
                                <version>${insight.google-cloud.version}</version>
                            </pluginArtifact>
                            <pluginArtifact>
                                <groupId>com.atlassian.jira.plugins</groupId>
                                <artifactId>insight-jamf-integration</artifactId>
                                <version>${insight.jamf.version}</version>
                            </pluginArtifact>
                            <pluginArtifact>
                                <groupId>com.atlassian.jira.plugins</groupId>
                                <artifactId>insight-sccm-integration</artifactId>
                                <version>${insight.sccm.version}</version>
                            </pluginArtifact>
                            <pluginArtifact>
                                <groupId>com.atlassian.jira.plugins</groupId>
                                <artifactId>insight-servicenow-integration</artifactId>
                                <version>${insight.service-now.version}</version>
                            </pluginArtifact>
                            <pluginArtifact>
                                <groupId>com.atlassian.jira.plugins</groupId>
                                <artifactId>insight-snow-integration</artifactId>
                                <version>${insight.snow.version}</version>
                            </pluginArtifact>
                            <pluginArtifact>
                                <groupId>com.atlassian.servicedesk</groupId>
                                <artifactId>servicedesk-testutils-plugin</artifactId>
                                <version>${jsm.testutils.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>
                                </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>
                <plugin>
                    <groupId>com.github.eirslett</groupId>
                    <artifactId>frontend-maven-plugin</artifactId>
                    <version>${frontend.maven.plugin.version}</version>
                    <configuration>
                        <nodeVersion>${frontend.maven.plugin.nodeVersion}</nodeVersion>
                        <npmVersion>${frontend.maven.plugin.npmVersion}</npmVersion>
                        <yarnVersion>${frontend.maven.plugin.yarnVersion}</yarnVersion>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <profiles>
        <profile>
            <id>Postgres</id>
            <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 not 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>mysql</id>

            <properties>
                <!-- MySQL needs its own dbconfig.xml that omits the schema-name element -->
                <dbconfig.path>${project.basedir}/../src/db/mysql</dbconfig.path>

                <db.artifactGroup>mysql</db.artifactGroup>
                <db.artifactId>mysql-connector-java</db.artifactId>
                <db.artifactVersion>8.0.20</db.artifactVersion>
                <db.ofBizFieldType>mysql</db.ofBizFieldType>

                <db.name>MySQL</db.name>
                <db.provider>${db.name}</db.provider>
                <db.host>mysql</db.host>
                <db.port>3306</db.port>
                <db.instance>jira</db.instance>
                <db.username>mysql</db.username>
                <db.password>mysql</db.password>
                <db.admin.username>root</db.admin.username>
                <db.admin.password/>
                <db.url>${jdbc.url}/${db.instance}?useUnicode=true&amp;amp;useServerPrepStmts=false&amp;amp;characterEncoding=UTF-8&amp;amp;sessionVariables=default_storage_engine=InnoDB</db.url>
                <db.connectionPoolCN>com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource</db.connectionPoolCN>
                <db.schema>DO_NOT_USE</db.schema>

                <jdbc.driver>com.mysql.jdbc.Driver</jdbc.driver>
                <jdbc.url>jdbc:mysql://${db.host}:${db.port}</jdbc.url>

                <database.type>database-type-standard</database.type>
                <database.validation>select 1</database.validation>
                <database.delegator>default</database.delegator>
                <database.poolsize>20</database.poolsize>
            </properties>

            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>org.codehaus.mojo</groupId>
                            <artifactId>sql-maven-plugin</artifactId>
                            <dependencies>
                                <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.admin.username}</username>
                                <password>${db.admin.password}</password>
                            </configuration>
                            <executions>
                                <execution>
                                    <id>create-db-mysql</id>
                                    <phase>pre-integration-test</phase>
                                    <goals>
                                        <goal>execute</goal>
                                    </goals>
                                    <configuration>
                                        <srcFiles>
                                            <srcFile>${project.build.directory}/sql/setup-mysql.sql</srcFile>
                                        </srcFiles>
                                    </configuration>
                                </execution>
                            </executions>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </build>
        </profile>
        <profile>
            <id>oracle</id>

            <properties>
                <db.artifactGroup>com.oracle</db.artifactGroup>
                <db.artifactId>ojdbc8-atlassian-hosted</db.artifactId>
                <db.artifactVersion>19.3.0.0</db.artifactVersion>
                <db.ofBizFieldType>oracle10g</db.ofBizFieldType>

                <db.name>Oracle12c</db.name>
                <db.provider>${db.name}</db.provider>
                <db.host>docker</db.host>
                <db.port>1521</db.port>
                <db.instance>JIRADB</db.instance>
                <db.username>SERVICEDESK</db.username>
                <db.password>SERVICEDESK</db.password>
                <db.admin.username>system</db.admin.username>
                <db.admin.password>oracle</db.admin.password>
                <db.url>${jdbc.url}</db.url>
                <db.connectionPoolCN>oracle.jdbc.pool.OracleConnectionPoolDataSource</db.connectionPoolCN>
                <db.schema/>

                <jdbc.driver>oracle.jdbc.OracleDriver</jdbc.driver>
                <jdbc.url>jdbc:oracle:thin:@${db.host}:${db.port}:${db.instance}</jdbc.url>

                <database.type>database-type-standard</database.type>
                <database.validation>select 1 from dual</database.validation>
                <database.delegator>default</database.delegator>
                <database.poolsize>20</database.poolsize>
            </properties>

            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>org.codehaus.mojo</groupId>
                            <artifactId>sql-maven-plugin</artifactId>
                            <dependencies>
                                <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.admin.username}</username>
                                <password>${db.admin.password}</password>
                            </configuration>
                            <executions>
                                <execution>
                                    <id>create-db-oracle</id>
                                    <phase>package</phase>
                                    <goals>
                                        <goal>execute</goal>
                                    </goals>
                                    <configuration>
                                        <srcFiles>
                                            <srcFile>${project.build.directory}/sql/setup-oracle.sql</srcFile>
                                        </srcFiles>
                                        <delimiterType>row</delimiterType>
                                        <delimiter>/</delimiter>
                                        <enableFiltering>true</enableFiltering>
                                    </configuration>
                                </execution>
                            </executions>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </build>
        </profile>
        <profile>
            <id>mssql</id>

            <properties>
                <db.artifactGroup>com.microsoft.sqlserver</db.artifactGroup>
                <db.artifactId>mssql-jdbc</db.artifactId>
                <db.artifactVersion>9.2.1.jre8</db.artifactVersion>
                <db.ofBizFieldType>mssql</db.ofBizFieldType>

                <db.name>${db.instance}</db.name>
                <db.port>1433</db.port>
                <db.instance>jiradb</db.instance>
                <db.username>jira</db.username>
                <db.password>jira</db.password>
                <db.admin.username>sa</db.admin.username>
                <db.admin.password>@!1234abc</db.admin.password>
                <db.url>${jdbc.url};databaseName=${db.instance}</db.url>
                <db.schema>jiraschema</db.schema>

                <jdbc.driver>com.microsoft.sqlserver.jdbc.SQLServerDriver</jdbc.driver>
                <jdbc.url>jdbc:sqlserver://localhost:${db.port};autoCommit=false</jdbc.url>

                <setup.type>custom</setup.type>
                <acceptance.test.dbname>greenhopper</acceptance.test.dbname>
                <sqlserver.database.user>${db.admin.username}</sqlserver.database.user>
                <sqlserver.database.password>${db.admin.password}</sqlserver.database.password>

                <database.name>Microsoft SQL Server</database.name>
                <database.type>database-type-standard</database.type>
                <database.driver>com.microsoft.sqlserver.jdbc.SQLServerDriver</database.driver>
                <database.url>
                    jdbc:sqlserver://localhost:${db.port};databaseName=${acceptance.test.dbname};autoCommit=false
                </database.url>
                <database.user>${sqlserver.database.user}</database.user>
                <database.password>${sqlserver.database.password}</database.password>
                <database.path>C:\Program Files (x86)\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA
                </database.path>
                <database.poolsize>20</database.poolsize>
                <database.dialect>net.sf.hibernate.dialect.SQLServerIntlDialect</database.dialect>
                <database.validation>select 1</database.validation>
                <database.delegator>default</database.delegator>
            </properties>

            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>org.codehaus.mojo</groupId>
                            <artifactId>sql-maven-plugin</artifactId>
                            <dependencies>
                                <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.admin.username}</username>
                                <password>${db.admin.password}</password>
                            </configuration>
                            <executions>
                                <execution>
                                    <id>create-db-mssql</id>
                                    <phase>pre-integration-test</phase>
                                    <goals>
                                        <goal>execute</goal>
                                    </goals>
                                    <configuration>
                                        <srcFiles>
                                            <srcFile>${project.build.directory}/sql/setup-mssql.sql</srcFile>
                                        </srcFiles>
                                        <delimiterType>row</delimiterType>
                                        <delimiter>GO</delimiter>
                                    </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>
            <properties>
                <cypressScript>test-firefox</cypressScript>
                <cypressArgs></cypressArgs>
            </properties>
            <modules>
                <module>insight-test-cypress</module>
                <module>insight-test-utils</module>
            </modules>
        </profile>
        <profile>
            <id>pa11y-test</id>
            <modules>
                <module>insight-test-pa11y</module>
                <module>insight-test-utils</module>
            </modules>
        </profile>
        <profile>
            <id>jira-debug</id>
            <properties>
                <start.jira.goal>debug</start.jira.goal>
            </properties>
        </profile>
    </profiles>
</project>
