<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>com.atlassian.audit</groupId>
        <artifactId>atlassian-audit</artifactId>
        <version>2.0.9</version>
    </parent>

    <artifactId>atlassian-audit-plugin</artifactId>
    <version>2.0.9</version>
    <packaging>atlassian-plugin</packaging>

    <name>Atlassian Audit Plugin</name>
    <description>This plugin offers extensive event coverage and a user-friendly design. In Data Center, you can also select an optimal event volume and log audit events to a file.</description>

    <properties>
        <!-- This key is used to keep the consistency between the key in atlassian-plugin.xml and the key to generate bundle. -->
        <atlassian.plugin.key>${project.groupId}.${project.artifactId}</atlassian.plugin.key>
        <itPattern>%regex[it[/\\].*Test.*]</itPattern>
        <wiredTestsPattern>%regex[it[/\\].*WiredIT.*]</wiredTestsPattern>
        <!-- Frontend build config -->
        <fe.plugin.version>1.12.1</fe.plugin.version>
        <fe.node.installdir>.node</fe.node.installdir>
        <fe.location>/frontend</fe.location>
        <fe.node.version>v18.12.0</fe.node.version> <!-- the "v" is important, update ./frontend/package.json and
        ./frontend/.nvmrc if you change this -->
        <fe.yarn.version>v1.22.17</fe.yarn.version>
        <minify.plugin.version>1.3.0</minify.plugin.version>
        <skipYarnInstall>false</skipYarnInstall>
        <skipWebpackBuild>false</skipWebpackBuild>

        <!-- Contract Testing config-->
        <swagger.location>${project.build.directory}/swagger-generated</swagger.location>
        <ct.location>/contract-testing</ct.location>

        <jvmHeap>-Xmx1536m -Xms512m -XX:ReservedCodeCacheSize=256m -XX:MaxMetaspaceSize=512m</jvmHeap>
        <sonar.coverage.jacoco.xmlReportPaths>${project.basedir}/${jacoco.report.file}</sonar.coverage.jacoco.xmlReportPaths>
        <plugin.testrunner.version>2.0.9</plugin.testrunner.version>

        <skip.it>true</skip.it>
        <!-- Currently releases rely on milestone components (Platform 7 switch), so this maven enforcer rule has to be turned off -->
        <failOnMilestoneOrReleaseCandidateDeps>false</failOnMilestoneOrReleaseCandidateDeps>
    </properties>

    <dependencies>
        <!-- Project -->
        <dependency>
            <groupId>com.atlassian.audit</groupId>
            <artifactId>atlassian-audit-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.audit</groupId>
            <artifactId>atlassian-audit-spi</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.audit</groupId>
            <artifactId>atlassian-audit-rest-model</artifactId>
            <scope>compile</scope>
        </dependency>

        <!-- Java -->
        <dependency>
            <groupId>jakarta.inject</groupId>
            <artifactId>jakarta.inject-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>jakarta.servlet</groupId>
            <artifactId>jakarta.servlet-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- Atlassian -->
        <dependency>
            <groupId>com.atlassian.activeobjects</groupId>
            <artifactId>activeobjects-plugin</artifactId>
            <version>${activeobjects.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.analytics</groupId>
            <artifactId>analytics-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.event</groupId>
            <artifactId>atlassian-event</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.json</groupId>
            <artifactId>atlassian-json-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-api</artifactId>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                        <groupId>com.google.code.findbugs</groupId>
                        <artifactId>jsr305</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-webresource-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-webfragment-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins.rest</groupId>
            <artifactId>atlassian-rest-v2-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.sal</groupId>
            <artifactId>sal-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.scheduler</groupId>
            <artifactId>atlassian-scheduler-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.soy</groupId>
            <artifactId>soy-template-renderer-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.upgrade</groupId>
            <artifactId>upgrade-task-framework-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>io.atlassian.util.concurrent</groupId>
            <artifactId>atlassian-util-concurrent</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- Spring OSGi Config -->
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-osgi-javaconfig</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-osgi</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.annotations</groupId>
            <artifactId>atlassian-annotations</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- Third party -->
        <dependency>
            <groupId>jakarta.ws.rs</groupId>
            <artifactId>jakarta.ws.rs-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.datatype</groupId>
            <artifactId>jackson-datatype-jsr310</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>io.swagger.core.v3</groupId>
            <artifactId>swagger-annotations</artifactId>
            <version>2.2.23</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>net.sf.supercsv</groupId>
            <artifactId>super-csv</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>osgi.core</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- Test -->
        <!-- Atlassian -->
        <!-- Only manually adding profiling because it's missing from AO's test utils 🫠🔫  -->
        <dependency>
            <groupId>com.atlassian.activeobjects</groupId>
            <artifactId>activeobjects-confluence-spi</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.activeobjects</groupId>
            <artifactId>activeobjects-spi</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.activeobjects</groupId>
            <artifactId>activeobjects-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.profiling</groupId>
            <artifactId>atlassian-profiling</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <scope>test</scope>
        </dependency>
        <!-- Third party -->
        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <version>2.2.224</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.vmlens</groupId>
            <artifactId>concurrent-junit</artifactId>
            <version>1.0.2</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.vintage</groupId>
            <artifactId>junit-vintage-engine</artifactId>
            <version>${junit-jupiter.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-junit-jupiter</artifactId>
            <version>4.6.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>

        <!-- WIRED TEST RUNNER DEPENDENCIES -->
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-osgi-testrunner</artifactId>
            <version>${plugin.testrunner.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.rest-assured</groupId>
            <artifactId>rest-assured</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <profiles>
        <profile>
            <!--
                This profile is run by default.
                To disabled it pass argument 'skipDev' to mvn command. i.e. mvn verify -Dskip-dev
            -->
            <id>dev</id>
            <activation>
                <property>
                    <name>!skip-dev</name>
                </property>
            </activation>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>io.fabric8</groupId>
                            <artifactId>docker-maven-plugin</artifactId>
                            <version>0.40.2</version>
                        </plugin>
                        <plugin>
                            <groupId>io.openapitools.swagger</groupId>
                            <artifactId>swagger-maven-plugin</artifactId>
                            <version>2.1.6</version>
                        </plugin>
                        <plugin>
                            <groupId>org.codehaus.mojo</groupId>
                            <artifactId>sql-maven-plugin</artifactId>
                            <version>1.4</version>
                        </plugin>
                    </plugins>
                </pluginManagement>
                <plugins>
                    <plugin>
                        <groupId>io.openapitools.swagger</groupId>
                        <artifactId>swagger-maven-plugin</artifactId>
                        <configuration>
                            <outputFormats>JSON</outputFormats>
                            <outputDirectory>${swagger.location}</outputDirectory>
                        </configuration>
                        <executions>
                            <execution>
                                <id>swagger-public-resolve</id>
                                <configuration>
                                    <resourcePackages>
                                        <resourcePackage>com.atlassian.audit.cache.rest.v1</resourcePackage>
                                        <resourcePackage>com.atlassian.audit.rest.v1</resourcePackage>
                                    </resourcePackages>
                                    <outputFilename>swagger</outputFilename>
                                </configuration>
                                <goals>
                                    <goal>generate</goal>
                                </goals>
                                <phase>compile</phase>
                            </execution>
                            <execution>
                                <id>swagger-private-resolve</id>
                                <configuration>
                                    <resourcePackages>
                                        <resourcePackage>com.atlassian.audit.database.usage.rest.v1</resourcePackage>
                                        <resourcePackage>com.atlassian.audit.lookup.rest.v1</resourcePackage>
                                        <resourcePackage>com.atlassian.audit.plugin.onboarding.rest.v1</resourcePackage>
                                    </resourcePackages>
                                    <outputFilename>swagger.private</outputFilename>
                                </configuration>
                                <goals>
                                    <goal>generate</goal>
                                </goals>
                                <phase>compile</phase>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>io.fabric8</groupId>
                        <artifactId>docker-maven-plugin</artifactId>
                        <configuration>
                            <skip>true</skip>
                        </configuration>
                        <executions>
                            <execution>
                                <id>start</id>
                                <phase>pre-integration-test</phase>
                                <goals>
                                    <goal>start</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>stop</id>
                                <phase>post-integration-test</phase>
                                <goals>
                                    <goal>stop</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>com.atlassian.maven.plugins</groupId>
                        <artifactId>amps-maven-plugin</artifactId>
                        <extensions>true</extensions>
                        <configuration>
                            <compressCss>false</compressCss>
                            <includedFeModuleManifests>
                                <includedFeModuleManifest>${project.basedir}/frontend/yarn.lock</includedFeModuleManifest>
                                <includedFeModuleManifest>${project.basedir}/frontend/package.json</includedFeModuleManifest>
                            </includedFeModuleManifests>
                            <server>localhost</server>
                            <enableQuickReload>true</enableQuickReload>
                            <skipAllPrompts>true</skipAllPrompts>
                            <!-- Uncomment to entirely override products' log4j properties -->
                            <!-- <log4jProperties>${pom.basedir}/src/main/resources/log4j-dev.properties</log4jProperties> -->
                            <instructions>
                                <!-- Plugin configuration -->
                                <Atlassian-Plugin-Key>${atlassian.plugin.key}</Atlassian-Plugin-Key>
                                <Atlassian-Scan-Folders>META-INF/plugin-descriptors</Atlassian-Scan-Folders>
                                <!-- Add package to import here -->
                                <Import-Package>
                                    com.atlassian.audit.api.*,
                                    com.atlassian.audit.entity.*,
                                    com.atlassian.audit.spi.*,
                                    com.atlassian.activeobjects.external,
                                    com.atlassian.analytics.api.annotations,
                                    com.atlassian.annotations.nonnull,
                                    com.atlassian.annotations.nullability,
                                    com.atlassian.event.api,
                                    com.atlassian.json.marshal,
                                    com.atlassian.plugin,
                                    com.atlassian.plugin.event.events,
                                    com.atlassian.plugin.module,
                                    com.atlassian.plugin.osgi.external,
                                    com.atlassian.plugin.web,
                                    com.atlassian.plugins.rest.api.*,
                                    com.atlassian.sal.api,
                                    com.atlassian.sal.api.auth,
                                    com.atlassian.sal.api.features,
                                    com.atlassian.sal.api.license,
                                    com.atlassian.sal.api.message,
                                    <!-- Importing com.atlassian.sal.api.permission breaks Audit in RefApp ? -->
                                    com.atlassian.sal.api.permission,
                                    com.atlassian.sal.api.pluginsettings,
                                    com.atlassian.sal.api.timezone,
                                    com.atlassian.sal.api.transaction,
                                    com.atlassian.sal.api.upgrade,
                                    com.atlassian.sal.api.user,
                                    com.atlassian.sal.api.web.context,
                                    com.atlassian.sal.api.websudo,
                                    com.atlassian.scheduler,
                                    com.atlassian.scheduler.config,
                                    com.atlassian.soy.renderer,
                                    com.atlassian.webresource.api,
                                    com.atlassian.webresource.api.data,
                                    com.google.common.base,
                                    com.google.common.collect,
                                    com.fasterxml.jackson.annotation,
                                    com.fasterxml.jackson.core,
                                    com.fasterxml.jackson.databind,
                                    com.fasterxml.jackson.databind.annotation,
                                    com.fasterxml.jackson.datatype.jsr310,
                                    io.atlassian.util.concurrent,
                                    javax.annotation,
                                    javax.inject,
                                    javax.servlet,
                                    javax.servlet.http,
                                    javax.ws.rs,
                                    javax.ws.rs.core,
                                    javax.ws.rs.ext,
                                    net.java.ao,
                                    net.java.ao.schema,
                                    org.apache.commons.lang3,
                                    org.apache.commons.lang3.math,
                                    org.eclipse.gemini.blueprint.context,
                                    org.eclipse.gemini.blueprint.service.exporter,
                                    org.eclipse.gemini.blueprint.service.exporter.support,
                                    org.eclipse.gemini.blueprint.service.importer.support,
                                    org.osgi.framework,
                                    org.osgi.util.tracker,
                                    org.slf4j,
                                    org.springframework.beans,
                                    org.springframework.beans.factory,
                                    org.springframework.beans.factory.annotation,
                                    org.springframework.beans.factory.config,
                                    org.springframework.cglib.core,
                                    org.springframework.cglib.proxy,
                                    org.springframework.cglib.reflect,
                                    org.springframework.context,
                                    org.springframework.context.annotation,
                                    org.springframework.core.type,
                                    org.springframework.http,
                                    <!-- Only JIRA needs old upgrade framework -->
                                    com.atlassian.upgrade.api;resolution:="optional",
                                    com.atlassian.upgrade.spi;resolution:="optional"
                                </Import-Package>
                                <!-- Ensure plugin is spring powered -->
                                <Spring-Context>*</Spring-Context>
                            </instructions>
                            <skipITs>${skip.it}</skipITs>
                            <products>
                                <product>
                                    <id>bitbucket</id>
                                    <version>${bitbucket.version}</version>
                                    <productDataVersion>${bitbucket.version}</productDataVersion>
                                    <httpPort>${bitbucket.http.port}</httpPort>
                                    <jvmArgs>
                                        ${jvmHeap} -Dplugin.audit.internal.testing.no.permissions=true
                                    </jvmArgs>
                                    <systemPropertyVariables>
                                        <!-- system property required by Functest RPC plugin -->
                                        <bitbucket.version>${bitbucket.version}</bitbucket.version>
                                        <xvfb.enable>${xvfb.enable}</xvfb.enable>
                                        <xvfb.display>${xvfb.display}</xvfb.display>
                                        <context.path>${bitbucket.context.path}</context.path>
                                        <atl.audit.version>${project.version}</atl.audit.version>
                                        <johnson.spring.lifecycle.synchronousStartup>true
                                        </johnson.spring.lifecycle.synchronousStartup>
                                    </systemPropertyVariables>
                                    <!-- DC, Developer, Termed https://atlassian.slack.com/archives/CFHN1KJHE/p1663050223774289 -->
                                    <license>
                                         AAAB8A0ODAoPeNp1ks1ymzAUhfc8hWa6cwebn/qnnmHhgOIkEwM12Jm27kLAtVEMEpUEsd++ik2bT
                                         jNdaPWN7j3nkz6kLaAEGmS7yJrM7fHccdBylSLHchzjCOctCEk58+yJZU2tmevaRtjWGYhov5Gae
                                         aZt+JwpkquQ1ODVR6gbQyoiy+EjzYFJSM8NXFiAt/gxivH6Pf+Lxa3ISyIhIAo8HcM1bcfUa/8/r
                                         Sf41FBxvlyLbce6+50Lrwit+mAJiA7EfeDd4Ck2PwXfHHMSPUzNpft51qfSA4gPTIHwlGjBqK7T7
                                         zTzVv6Lf+t/eVj8rJK0mLVZPHWdyXGRB0/3cfk0XpTr1ccpXZ46+xnacRcXeRI2m2zr7MlysfN2n
                                         pG0mcwFbdSr1cuCwWAQRql5G63NeB0FGz+9j0Jzk2ANPF+ALlSg7IxUCaivijDLeQECNYI/Q67Q9
                                         1KpZjcfjQ58SFRFpKSEDXNej/r4Jlxv/BiigCPGFSqoVIJmrQI9mUqkOMpbqXitX3VoaGdaASMsf
                                         +/16kmbpR38qeCv8SLFgXnz9TX21XafVuvesCPjL8xIcOjpY44ty4jEgTAqycUEPpG6qQD5vG4IO
                                         xuX3hr8+wsCeLOXglSo74f2XNuo2gNlqIAOKt7oHgbuSNWSN9e/AOxr+7cwLAIUGaLfLY7rY7FpF
                                         coLPDX6YWv0Q6sCFDzZ9TnXZqy8qhJZbG2DD5dhnpEBX02nf
                                    </license>
                                </product>
                                <product>
                                    <id>confluence</id>
                                    <version>${confluence.version}</version>
                                    <productDataVersion>${confluence.data.version}</productDataVersion>
                                    <jvmArgs>
                                        -XX:+UseG1GC
                                        -Datlassian.darkfeature.confluence.pulp=true
                                        -Dtroubleshooting.dev.mode=true ${jvmHeap}
                                        -Dplugin.audit.internal.testing.no.permissions=true
                                    </jvmArgs>
                                    <!-- DC, Developer, Termed https://atlassian.slack.com/archives/CFHN1KJHE/p1663050223774289 -->
                                     <license>
                                         AAAB8g0ODAoPeNplkkFv4jAQhe/5FZb2hhRIAqUUKQdITOkKEpYk3aXLHowZIEtiW7YDTX/9uoSqF
                                         XvwZUYz771v/C2tACUgkNtFTn/o3g17Dnqcp8hzPM86Qv0MUuWc+W7fce6dQbfrWlFVbkDGu0yZn
                                         m+7VsCZJlRHpAS/PEIpLMrZrm1K+Ql8LSuwFpWkB6IgJBp8s7tru55tds1yCkxBWgu4jIf4Gc/iB
                                         V5+dPCryGV9GVu4njP9EMNzkhdXtQTkCeRT6I/xPbZ74Ytn9+Pv9/Zj92HQWPki80WiaKpTog7+P
                                         DgHk2naoQc9WRVl7+c4fhhk4ze9WtFaJ8XosPxxrqKJ+DUzEGqWBW/9kXghewyxO1r7a79RMk5JA
                                         EyDbIIn1UZRmQv9DvFSabVaUZzak3hpL5ZxmAXpUxzZWYJNww8kmKhbtKmRPgC6+kaYUb4FiYTkf
                                         4Fq9PugtVgPO509bxNdEKVywtqUl51rJhuaiT9tFHLEuEbbXGmZbyoNZnOukOaIVkrz0hyxbRmax
                                         jMjjP5P3PgKlniU4tAer95NNtSv3gz2jB0ZPzMrwZFvnn3nOFYs94Tlilxy41dSigJQwEtBWG1dU
                                         prG7W+4vdXNlwjhE2UKSqNrWLTjBk1R7XOGtnCCggsTysInUlTkE/w/Ax76djAsAhQtsa5Q4Cv11
                                         /H3W1F7xfM5S03sWQIUGuxd8xHLoLkpqmMkE3HqoBZO9Ts=X02nj
                                     </license>
                                </product>
                                <product>
                                    <id>jira</id>
                                    <version>${jira.version}</version>
                                    <productDataVersion>${jira.version}</productDataVersion>
                                    <jvmArgs>
                                        -XX:+UseG1GC
                                        -Datlassian.mail.senddisabled=false -Djira.startup.warnings.disable=true
                                        -Dcom.atlassian.jira.advanced.audit.log.enabled
                                        -Dtroubleshooting.dev.mode=true ${jvmHeap}
                                        -Dplugin.audit.internal.testing.no.permissions=true
                                    </jvmArgs>
                                    <!-- DC, Developer, Termed https://atlassian.slack.com/archives/CFHN1KJHE/p1663050223774289 -->
                                     <license>
                                         AAACNg0ODAoPeNp9kktzmzAUhff8Cs105xkw4CZxM8MiBuU1MTAYu02aLmS4NopBYiSBQ399FYwnb
                                         R5dsBD36tyr75wvaQNoATVyJsg+PXcm584UXc1T5Nqua+ygW4GQlDPPObXtM3s6mTjGVgCwgtc1C
                                         OuOZsAk4Jyqly4cpjiJk5sFNsKmWoOINkupFTzTMXzOFMlUSCrwqh1UtRE3IiuIhIAo8PTAiem4p
                                         h4wiKZdDX13gFf4Lopxcqzg55qKrr8WO659fdTGc0LLQXwBogVxE3gzfIbNr8GDa55Gt2fm1eTb1
                                         Hiigli14HmTKevlYEq+UXsiwNIytAVPiQaMW12Jhy49jfjA1JuW8rDRNZGFN/f3/mVQhE1o75OTu
                                         rVF3OWzp/X6++W8gd/3F0XS7shqdXI3o8+b6Iec07F7nYgHd9u1+0fv0TMWzVpmgtY9zX7AB7Q/A
                                         NM/6HMzRqNRGKXmZZSYcRIFSz+9iUJzucC64PkCNMkcrTukCkCDCsIs4zkIpDE9QabQz0Kp+vF8P
                                         N5yi6iSSEkJszJejQcGJhxu/LJQwBHjCuVUKkHXjQKtTCVSHGWNVLzSkbAMbRZTwAjL3huq9/ITf
                                         JHiwJzdvyx5MPU/vr3L2/AOnYAl2zG+Z8YCh57+zBPbPigdPQVxYB2JLWFUkgO+Z1LVJSCfVzVhn
                                         dFj0oW3aQ3g1bEUpEIDDrThGl7ZbClDObRQcm2h/MfPv4PUL/Tux8dv/TwHuCVlQ17T8wc0P1aDM
                                         C0CFQCG206Vg5gpQoa2M/jJaVm5kQ01qQIULHHKUE3KXQOAfhzznuXBjroGtAc=X02qi
                                     </license>
                                </product>
                                <product>
                                    <id>refapp</id>
                                    <version>${refapp.version}</version>
                                </product>
                            </products>

                            <testGroups>
                                <testGroup>
                                    <id>wired-integration</id>
                                    <productIds>
                                        <productId>${product}</productId>
                                    </productIds>
                                    <includes>
                                        <include>it/**/*WiredTest.java</include>
                                    </includes>
                                </testGroup>
                            </testGroups>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>integration-tests</id>
                                <phase>integration-test</phase>
                                <goals>
                                    <goal>integration-test</goal>
                                </goals>
                                <configuration combine.children="append">
                                    <includes>
                                        <include>${itPattern}</include>
                                    </includes>
                                    <excludes>
                                        <exclude>${wiredTestsPattern}</exclude>
                                    </excludes>
                                    <systemProperties>
                                        <product>confluence</product>
                                    </systemProperties>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <systemPropertyVariables>
                                <jdbc.type>h2</jdbc.type>
                            </systemPropertyVariables>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>com.github.eirslett</groupId>
                        <artifactId>frontend-maven-plugin</artifactId>
                        <version>${fe.plugin.version}</version>
                        <configuration>
                            <workingDirectory>${basedir}${fe.location}</workingDirectory>
                            <nodeVersion>${fe.node.version}</nodeVersion>
                            <yarnVersion>${fe.yarn.version}</yarnVersion>
                            <installDirectory>${fe.node.installdir}</installDirectory>
                        </configuration>
                        <executions>
                            <execution>
                                <id>install node and yarn</id>
                                <goals>
                                    <goal>install-node-and-yarn</goal>
                                </goals>
                                <phase>generate-resources</phase>
                            </execution>
                            <execution>
                                <id>yarn install</id>
                                <goals>
                                    <goal>yarn</goal>
                                </goals>
                                <phase>generate-resources</phase>
                                <configuration>
                                    <arguments>install --frozen-lockfile --ignore-optional</arguments>
                                    <skip>${skipYarnInstall}</skip>
                                </configuration>
                            </execution>
                            <execution>
                                <id>webpack</id>
                                <goals>
                                    <goal>yarn</goal>
                                </goals>
                                <phase>generate-resources</phase>
                                <configuration>
                                    <arguments>build</arguments>
                                    <skip>${skipWebpackBuild}</skip>
                                    <environmentVariables>
                                        <PLUGIN_KEY>${atlassian.plugin.key}</PLUGIN_KEY>
                                    </environmentVariables>
                                </configuration>
                            </execution>
                            <execution>
                                <id>install-node-dependencies</id>
                                <goals>
                                    <goal>yarn</goal>
                                </goals>
                                <configuration>
                                    <arguments>install --frozen-lockfile</arguments>
                                    <workingDirectory>${basedir}${ct.location}</workingDirectory>
                                </configuration>
                                <phase>process-test-resources</phase>
                            </execution>
                            <execution>
                                <id>sort-generated-swagger-spec</id>
                                <goals>
                                    <goal>yarn</goal>
                                </goals>
                                <configuration>
                                    <arguments>lint:sort</arguments>
                                    <workingDirectory>${basedir}${ct.location}</workingDirectory>
                                </configuration>
                                <phase>process-test-resources</phase>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>com.atlassian.minify</groupId>
                        <artifactId>minify-maven-plugin</artifactId>
                        <version>${minify.plugin.version}</version>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>skip-ut</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <skip>true</skip>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>skip-frontend-build</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.github.eirslett</groupId>
                        <artifactId>frontend-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>install node and yarn</id>
                                <phase>none</phase>
                            </execution>
                            <execution>
                                <id>yarn install</id>
                                <phase>none</phase>
                            </execution>
                            <execution>
                                <id>webpack</id>
                                <phase>none</phase>
                            </execution>
                            <execution>
                                <id>install-node-dependencies</id>
                                <phase>none</phase>
                            </execution>
                            <execution>
                                <id>sort-generated-swagger-spec</id>
                                <phase>none</phase>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>h2</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <configuration>
                            <systemPropertyVariables>
                                <jdbc.type>h2</jdbc.type>
                            </systemPropertyVariables>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>postgres</id>
            <properties>
                <db.host>localhost</db.host>
                <db.name>ao_test</db.name>
                <db.port>5432</db.port>
                <db.username>ao_user</db.username>
                <db.password>ao_password</db.password>
                <docker.image>postgres:14.5</docker.image>
                <docker.wait.log>PostgreSQL init process complete</docker.wait.log>
                <jdbc.version>42.2.6</jdbc.version>
            </properties>
            <dependencies>
                <dependency>
                    <groupId>org.postgresql</groupId>
                    <artifactId>postgresql</artifactId>
                    <version>${jdbc.version}</version>
                    <scope>test</scope>
                </dependency>
            </dependencies>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>integration-tests</id>
                                <configuration>
                                    <includes>
                                        <include>${itPattern}</include>
                                    </includes>
                                </configuration>
                            </execution>
                        </executions>
                        <configuration>
                            <systemPropertyVariables>
                                <jdbc.url>jdbc:postgresql://localhost:${db.port}/${db.name}</jdbc.url>
                                <jdbc.schema>public</jdbc.schema>
                                <jdbc.user>${db.username}</jdbc.user>
                                <jdbc.password>${db.password}</jdbc.password>
                            </systemPropertyVariables>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>io.fabric8</groupId>
                        <artifactId>docker-maven-plugin</artifactId>
                        <configuration>
                            <skip>false</skip>
                            <images>
                                <image>
                                    <name>${docker.image}</name>
                                    <run>
                                        <ports>
                                            <port>db.port:${db.port}</port>
                                        </ports>
                                        <env>
                                            <POSTGRES_DB>${db.name}</POSTGRES_DB>
                                            <POSTGRES_USER>${db.username}</POSTGRES_USER>
                                            <POSTGRES_PASSWORD>${db.password}</POSTGRES_PASSWORD>
                                        </env>
                                        <wait>
                                            <log>${docker.wait.log}</log>
                                            <time>1200000</time>
                                        </wait>
                                        <log>
                                            <prefix>postgres</prefix>
                                        </log>
                                    </run>
                                </image>
                            </images>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>mysql</id>
            <properties>
                <db.host>localhost</db.host>
                <db.port>3306</db.port>
                <db.name>ao_test</db.name>
                <db.username>ao_user</db.username>
                <db.password>ao_password</db.password>
                <db.schema>ao_schema</db.schema>
                <ao.test.database>mysql</ao.test.database>
                <docker.wait.log>starting as process 1</docker.wait.log>
                <db.version>8.0.21</db.version>
                <db.system.username>root</db.system.username>
                <db.system.password>root</db.system.password>
            </properties>
            <dependencies>
                <dependency>
                    <groupId>mysql</groupId>
                    <artifactId>mysql-connector-java</artifactId>
                    <version>${db.version}</version>
                    <scope>test</scope>
                </dependency>
            </dependencies>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>integration-tests</id>
                                <configuration>
                                    <includes>
                                        <include>${itPattern}</include>
                                    </includes>
                                </configuration>
                            </execution>
                        </executions>
                        <configuration>
                            <systemPropertyVariables>
                                <jdbc.url>jdbc:mysql://localhost:${db.port}/${db.name}?autoReconnect=true</jdbc.url>
                                <jdbc.schema>${db.schema}</jdbc.schema>
                                <jdbc.user>${db.username}</jdbc.user>
                                <jdbc.password>${db.password}</jdbc.password>
                            </systemPropertyVariables>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>io.fabric8</groupId>
                        <artifactId>docker-maven-plugin</artifactId>
                        <configuration>
                            <skip>false</skip>
                            <images>
                                <image>
                                    <name>mysql:${db.version}</name>
                                    <run>
                                        <ports>
                                            <port>db.port:${db.port}</port>
                                        </ports>
                                        <env>
                                            <MYSQL_DATABASE>${db.name}</MYSQL_DATABASE>
                                            <MYSQL_USER>${db.username}</MYSQL_USER>
                                            <MYSQL_PASSWORD>${db.password}</MYSQL_PASSWORD>
                                            <MYSQL_ROOT_PASSWORD>${db.system.password}</MYSQL_ROOT_PASSWORD>
                                        </env>
                                        <wait>
                                            <log>${docker.wait.log}</log>
                                            <time>120000</time>
                                        </wait>
                                        <log>
                                            <prefix>mysql</prefix>
                                        </log>
                                    </run>
                                </image>
                            </images>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>sqlserver</id>
            <properties>
                <!-- Current latest version. Override in bamboo-specs -->
                <docker.tag>2019-RC1</docker.tag>
                <docker.image>mcr.microsoft.com/mssql/server:${docker.tag}</docker.image>
                <!-- Ready for connection != ready -->
                <docker.wait.log>.*Recovery is complete. This is an informational message only. No user action is required..*</docker.wait.log>
                <db.host>localhost</db.host>
                <db.port>1433</db.port>
                <db.name>ao_test</db.name>
                <!-- This is used for creating database and schema in maven by sql-maven-plugin -->
                <db.url.no.db>jdbc:sqlserver://${db.host}:${db.port}</db.url.no.db>
                <!-- These are used by DynamicJdbcConfiguration.buildJdbcConfiguration to build connection -->
                <db.username>sa</db.username>
                <!-- SQL Server requires complex password -->
                <db.password>AO_password12</db.password>
                <db.url>${db.url.no.db};databaseName=${db.name}</db.url>
                <db.schema>ao_schema</db.schema>
                <ao.test.database>sqlserver</ao.test.database>
                <sqljdbc.version>7.4.1.jre8</sqljdbc.version>
            </properties>

            <!-- From now on sqljdbc is default driver as jtds is outdated -->
            <dependencies>
                <dependency>
                    <groupId>com.microsoft.sqlserver</groupId>
                    <artifactId>mssql-jdbc</artifactId>
                    <version>${sqljdbc.version}</version>
                    <scope>test</scope>
                </dependency>
            </dependencies>

            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>integration-tests</id>
                                <configuration>
                                    <includes>
                                        <include>${itPattern}</include>
                                    </includes>
                                </configuration>
                            </execution>
                        </executions>
                        <configuration>
                            <systemPropertyVariables>
                                <jdbc.url>${db.url.no.db};databaseName=${db.name}</jdbc.url>
                                <jdbc.schema>${db.schema}</jdbc.schema>
                                <jdbc.user>${db.username}</jdbc.user>
                                <jdbc.password>${db.password}</jdbc.password>
                            </systemPropertyVariables>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>io.fabric8</groupId>
                        <artifactId>docker-maven-plugin</artifactId>
                        <inherited>false</inherited>
                        <configuration>
                            <images>
                                <image>
                                    <name>${docker.image}</name>
                                    <run>
                                        <ports>
                                            <port>${db.port}:${db.port}</port>
                                        </ports>
                                        <env>
                                            <SA_PASSWORD>${db.password}</SA_PASSWORD>
                                            <ACCEPT_EULA>Y</ACCEPT_EULA>
                                            <MSSQL_PID>Express</MSSQL_PID>
                                        </env>
                                        <wait>
                                            <log>${docker.wait.log}</log>
                                            <time>120000</time>
                                        </wait>
                                        <log>
                                            <prefix>mssql</prefix>
                                        </log>
                                    </run>
                                </image>
                            </images>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>sql-maven-plugin</artifactId>
                        <dependencies>
                            <dependency>
                                <groupId>com.microsoft.sqlserver</groupId>
                                <artifactId>mssql-jdbc</artifactId>
                                <version>${sqljdbc.version}</version>
                            </dependency>
                        </dependencies>

                        <configuration>
                            <username>${db.username}</username>
                            <password>${db.password}</password>
                            <url>${db.url.no.db}</url>
                            <driver>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver>
                        </configuration>

                        <executions>
                            <execution>
                                <id>create-db</id>
                                <phase>pre-integration-test</phase>

                                <goals>
                                    <goal>execute</goal>
                                </goals>

                                <configuration>
                                    <autocommit>true</autocommit>
                                    <sqlCommand>
                                        CREATE DATABASE ${db.name};
                                        USE ${db.name};
                                        CREATE SCHEMA ${db.schema};
                                    </sqlCommand>
                                    <onError>abort</onError>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>oracle</id>
            <properties>
                <oracle.docker.image.tag>oracle-database:12.1.0.2-se2-1.2.0-warm-1.1.0</oracle.docker.image.tag>
                <docker.oracle.image>docker.atl-paas.net/atlassian/jira/server/${oracle.docker.image.tag}</docker.oracle.image>
                <database.host>localhost</database.host>
                <oracle.admin.user>system</oracle.admin.user>
                <docker.wait.log>(?s).*DATABASE IS READY TO USE.*</docker.wait.log>
                <!--
                This password has been hardcoded into atlassian docker image.
                ORACLE_PWD overrides didn't work. If you are changing it, make sure it'll work with our docker scripts:
                https://github.com/atlassian/docker-images/blob/master/OracleDatabase/SingleInstance/dockerfiles/12.2.0.1/createDB.sh#L27
                 -->
                <oracle.admin.password>oracle</oracle.admin.password>
                <setup.type>custom</setup.type>
                <database.user>confluence</database.user>
                <database.password>confluence</database.password>
                <oracle.port>11521</oracle.port>
                <db.port>1521</db.port>
                <oracle.sid>ORCLCDB</oracle.sid>
                <oracle.pdb>JIRADB</oracle.pdb>
                <database.url>jdbc:oracle:thin:@${database.host}:${db.port}/${oracle.pdb}</database.url>
                <database.url.escaped>${database.url}</database.url.escaped>
                <database.dialect>com.atlassian.confluence.impl.hibernate.dialect.OracleDialect</database.dialect>
                <database.type>database-type-standard</database.type>
                <database.driver>oracle.jdbc.OracleDriver</database.driver>
                <database.poolsize>20</database.poolsize>

                <jdbc.oracle.driver.groupId>com.oracle.jdbc</jdbc.oracle.driver.groupId>
                <jdbc.oracle.driver.version>12.2.0.1-atlassian-hosted</jdbc.oracle.driver.version>
                <jdbc.oracle.driver.artifactId>ojdbc8</jdbc.oracle.driver.artifactId>
                <!--
                    open_cursor needs to be bigger than `db_connection_pool_size * num_of_confluence_nodes + num_of_synchrony_nodes * 30`.
                    Also, no overhead for setting this larger than required.
                -->
                <oracle.max.open.cursors>1000</oracle.max.open.cursors>
                <pause.time.millis>1000</pause.time.millis>
                <acceptance.db.server.username>${oracle.admin.user}</acceptance.db.server.username>
                <acceptance.db.server.hostname>${database.host}</acceptance.db.server.hostname>
            </properties>
            <dependencies>
                <dependency>
                    <groupId>${jdbc.oracle.driver.groupId}</groupId>
                    <artifactId>${jdbc.oracle.driver.artifactId}</artifactId>
                    <version>${jdbc.oracle.driver.version}</version>
                    <scope>test</scope>
                </dependency>
            </dependencies>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>integration-tests</id>
                                <configuration>
                                    <includes>
                                        <include>${itPattern}</include>
                                    </includes>
                                </configuration>
                            </execution>
                        </executions>
                        <configuration>
                            <systemPropertyVariables>
                                <jdbc.url>${database.url}</jdbc.url>
                                <jdbc.schema>${database.user}</jdbc.schema>
                                <jdbc.user>${database.user}</jdbc.user>
                                <jdbc.password>${database.password}</jdbc.password>
                                <ao.transaction.isolation.level>TRANSACTION_READ_COMMITTED</ao.transaction.isolation.level>
                            </systemPropertyVariables>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>io.fabric8</groupId>
                        <artifactId>docker-maven-plugin</artifactId>
                        <configuration>
                            <skip>false</skip>
                            <images>
                                <image>
                                    <name>${docker.oracle.image}</name>
                                    <alias>oracle</alias>
                                    <run>
                                        <ports>
                                            <port>db.port:1521</port>
                                        </ports>
                                        <env>
                                            <ORACLE_SID>${oracle.sid}</ORACLE_SID>
                                            <ORACLE_PDB>${oracle.pdb}</ORACLE_PDB>
                                            <ORACLE_PWD>${oracle.admin.password}</ORACLE_PWD>
                                            <ORACLE_CHARACTERSET>AL32UTF8</ORACLE_CHARACTERSET>
                                        </env>
                                        <wait>
                                            <log>${docker.wait.log}</log>
                                            <time>1000000</time>
                                        </wait>
                                        <log>
                                            <prefix>${oracle.docker.image.tag}</prefix>
                                            <date>default</date>
                                            <color>cyan</color>
                                        </log>
                                    </run>
                                </image>
                            </images>
                            <verbose>true</verbose>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>sql-maven-plugin</artifactId>
                        <dependencies>
                            <dependency>
                                <groupId>${jdbc.oracle.driver.groupId}</groupId>
                                <artifactId>${jdbc.oracle.driver.artifactId}</artifactId>
                                <version>${jdbc.oracle.driver.version}</version>
                            </dependency>
                        </dependencies>
                        <configuration>
                            <username>${oracle.admin.user}</username>
                            <password>${oracle.admin.password}</password>
                            <url>${database.url}</url>
                            <driver>${database.driver}</driver>
                        </configuration>
                        <executions>
                            <execution>
                                <id>create-db</id>
                                <phase>pre-integration-test</phase>
                                <goals>
                                    <goal>execute</goal>
                                </goals>
                                <configuration>
                                    <autocommit>true</autocommit>
                                    <sqlCommand>
                                        GRANT CONNECT, UNLIMITED TABLESPACE, CREATE TABLE, CREATE SEQUENCE, CREATE TRIGGER, RESOURCE TO ${database.user} IDENTIFIED BY ${database.password};
                                        ALTER SYSTEM SET open_cursors = ${oracle.max.open.cursors} SCOPE=BOTH;
                                    </sqlCommand>
                                    <onError>abort</onError>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-enforcer-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>ensure-oracle-image-version-is-set</id>
                                <goals>
                                    <goal>enforce</goal>
                                </goals>
                                <configuration>
                                    <rules>
                                        <requireProperty>
                                            <property>oracle.docker.image.tag</property>
                                            <message>
                                                You must set the 'oracle.docker.image.tag' property, and it must be a valid
                                                tag found at https://extranet.atlassian.com/display/RELENG/HOWTO+-+Use+oracle+docker+image+provided+by+buildeng
                                            </message>
                                        </requireProperty>
                                    </rules>
                                    <fail>true</fail>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
