<?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/maven-v4_0_0.xsd">

    <parent>
        <groupId>com.atlassian.servicedesk</groupId>
        <artifactId>integration-tests-parent</artifactId>
        <version>1000.575.0</version>
    </parent>

    <modelVersion>4.0.0</modelVersion>
    <artifactId>jira-servicedesk-it</artifactId>

    <name>Service Desk Integration Tests</name>
    <description>Atlassian Service Desk Integration Tests</description>
    <packaging>atlassian-plugin</packaging>

    <profiles>

        <profile>
            <id>sox</id>
            <properties>
                <xvfb.enable>true</xvfb.enable>
                <atlassian.dev.mode>false</atlassian.dev.mode>
                <sd.release.test.directory>group-service-desk-release-tests/surefire-reports</sd.release.test.directory>
                <failsafe.rerunFailingTestsCount>3</failsafe.rerunFailingTestsCount>
            </properties>
            <build>
                <!--  Order matters, as the mapped plugin goals to the lifecycle ar executed in order of definition -->
                <plugins>
                    <plugin>
                        <groupId>com.atlassian.servicedesk.maven.plugins</groupId>
                        <artifactId>maven-jira-plugin</artifactId>
                        <configuration>
                            <!-- amps replaces localhost by the hostname, unless we specify the server here -->
                            <server>localhost</server>

                            <systemPropertyVariables>
                                <!-- Due to issues with AMPS maven phases to use Docker with amps:run or amps:debug (jira:run and jira:debug),
                                you must set the value of docker.host.address and database.port on the commandline:
                                     -Ddocker.host.address / -Ddatabase.port
                                Example:
                                    mvn amps:debug -Dproduct=jira -DskipTests -Djvm.debug.suspend=true -Ddocker.host.address=$DOCKER_HOST -Ddatabase.port=5432
                                -->
                                <PG_DB_ROLE>postgres</PG_DB_ROLE>
                                <PG_DB_HOST>${docker.host.address}</PG_DB_HOST>
                                <PG_DB_NAME>jiradb</PG_DB_NAME>
                                <PG_DB_PORT>${postgres.port}</PG_DB_PORT>
                            </systemPropertyVariables>

                            <!-- install the PostgreSQL JDBC driver - jar goes into WEB-INF/lib -->
                            <libArtifacts>
                                <libArtifact>
                                    <groupId>org.postgresql</groupId>
                                    <artifactId>postgresql</artifactId>
                                </libArtifact>
                            </libArtifacts>
                        </configuration>
                        <executions>
                            <execution>
                                <id>start-jira</id>
                                <goals>
                                    <goal>fast-run</goal>
                                </goals>
                                <phase>pre-integration-test</phase>
                            </execution>
                            <execution>
                                <id>stop-jira</id>
                                <goals>
                                    <goal>fast-stop</goal>
                                </goals>
                                <phase>post-integration-test</phase>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>io.fabric8</groupId>
                        <artifactId>docker-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>import-dump-and-start-postgres</id>
                                <!-- TODO: This should be in "pre-integration-test" phase,
                                     but AMPS loads its systemPropertyVariables config in "test" phase,
                                     and we need the docker.host.address variable there,
                                     so unfortunately we're forced to start Docker before "test",
                                     hence this is the latest phase that works. Please change when AMPS is gone! -->
                                <phase>process-test-classes</phase>
                                <goals>
                                    <goal>build</goal>
                                    <goal>start</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>stop-postgres</id>
                                <phase>post-integration-test</phase>
                                <goals>
                                    <goal>stop</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <images>
                                <image>
                                    <alias>postgres-db</alias>
                                    <name>servicedesk/postgres:9.5</name>
                                    <build>
                                        <dockerFileDir>sd-postgres9.5</dockerFileDir>

                                        <assembly>
                                            <mode>dir</mode>
                                            <inline xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                                                    xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
                                                    xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">

                                                <id>import-postgres-dump</id>
                                                <dependencySets>
                                                    <dependencySet>
                                                        <includes>
                                                            <include>com.atlassian.servicedesk:db-setup:zip:postgresdump</include>
                                                        </includes>
                                                        <unpack>true</unpack>
                                                    </dependencySet>
                                                </dependencySets>
                                            </inline>
                                        </assembly>
                                    </build>
                                    <run>
                                        <env>
                                            <POSTGRES_USER>postgres</POSTGRES_USER>
                                            <POSTGRES_DB>jiradb</POSTGRES_DB>
                                            <POSTGRES_INITDB_ARGS>--encoding=UTF8</POSTGRES_INITDB_ARGS>
                                        </env>
                                        <ports>
                                            <port>${postgres.port}:5432</port>
                                        </ports>
                                        <wait>
                                            <log>${postgres.wait.condition}</log>
                                            <time>5000</time>
                                            <kill>5000</kill>
                                            <shutdown>2000</shutdown>
                                        </wait>
                                        <log>
                                            <prefix>postgres</prefix>
                                            <date>default</date>
                                            <color>cyan</color>
                                        </log>
                                    </run>
                                </image>
                            </images>
                            <verbose>true</verbose>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <configuration>
                            <summaryFile>${project.build.directory}/${sd.release.test.directory}/failsafe-summary.xml
                            </summaryFile>
                            <reportsDirectory>${project.build.directory}/${sd.release.test.directory}</reportsDirectory>
                        </configuration>
                        <executions>
                            <execution>
                                <id>run_sox_tests_failsafe</id>
                                <goals>
                                    <goal>integration-test</goal>
                                </goals>
                                <phase>integration-test</phase>
                                <configuration>
                                    <includes>
                                        <include>it/com/atlassian/servicedesk/rest/**</include>
                                        <include>it/com/atlassian/servicedesk/webdriver/**</include>
                                    </includes>
                                    <groups>it.com.atlassian.servicedesk.category.SOXComplianceTests</groups>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
            <dependencies>
                <!--we need declare those dependencies here, so that release profile can run SOX test-->
                <dependency>
                    <groupId>${project.groupId}</groupId>
                    <artifactId>jira-servicedesk</artifactId>
                    <version>${project.version}</version>
                </dependency>
                <dependency>
                    <groupId>${project.groupId}</groupId>
                    <artifactId>servicedesk-testutils-plugin</artifactId>
                    <version>${project.version}</version>
                </dependency>
                <dependency>
                    <groupId>${project.groupId}</groupId>
                    <artifactId>servicedesk-project-ui-plugin</artifactId>
                    <version>${project.version}</version>
                </dependency>
                <dependency>
                    <groupId>${project.groupId}</groupId>
                    <artifactId>servicedesk-core-ui-plugin</artifactId>
                    <version>${project.version}</version>
                </dependency>
                <dependency>
                    <groupId>com.atlassian.servicedesk.plugins.automation</groupId>
                    <artifactId>servicedesk-automation-modules-plugin</artifactId>
                    <version>${project.version}</version>
                </dependency>
                <dependency>
                    <groupId>com.atlassian.servicedesk.plugins.automation</groupId>
                    <artifactId>servicedesk-automation-then-webhook-plugin</artifactId>
                    <version>${project.version}</version>
                </dependency>
                <dependency>
                    <groupId>${project.groupId}</groupId>
                    <artifactId>jira-servicedesk-public-rest-api-plugin</artifactId>
                    <version>${project.version}</version>
                </dependency>
                <dependency>
                    <groupId>${project.groupId}</groupId>
                    <artifactId>servicedesk-approvals-plugin</artifactId>
                    <version>${project.version}</version>
                </dependency>
                <dependency>
                    <groupId>${project.groupId}</groupId>
                    <artifactId>servicedesk-customer-management-plugin</artifactId>
                    <version>${project.version}</version>
                </dependency>
                <dependency>
                    <groupId>${project.groupId}</groupId>
                    <artifactId>servicedesk-reports-plugin</artifactId>
                    <version>${project.version}</version>
                </dependency>
                <dependency>
                    <groupId>${project.groupId}</groupId>
                    <artifactId>servicedesk-knowledge-base-plugin</artifactId>
                    <version>${project.version}</version>
                </dependency>
                <dependency>
                    <groupId>${project.groupId}</groupId>
                    <artifactId>servicedesk-notifications-plugin</artifactId>
                    <version>${project.version}</version>
                </dependency>
                <dependency>
                    <groupId>com.atlassian.servicedesk.plugins</groupId>
                    <artifactId>servicedesk-search-plugin</artifactId>
                    <version>${project.version}</version>
                </dependency>
                <dependency>
                    <groupId>com.atlassian.servicedesk</groupId>
                    <artifactId>jira-servicedesk-application-cloud</artifactId>
                    <version>${project.version}</version>
                </dependency>
                <dependency>
                    <groupId>com.atlassian.servicedesk</groupId>
                    <artifactId>servicedesk-lingo-plugin</artifactId>
                    <version>${project.version}</version>
                </dependency>
                <dependency>
                    <groupId>com.atlassian.servicedesk</groupId>
                    <artifactId>servicedesk-environment-bridge-plugin</artifactId>
                    <version>${project.version}</version>
                </dependency>
                <dependency>
                    <groupId>com.atlassian.servicedesk</groupId>
                    <artifactId>db-setup</artifactId>
                    <classifier>postgresdump</classifier>
                    <type>zip</type>
                </dependency>
            </dependencies>
        </profile>

        <profile>
            <id>ci</id>

            <build>
                <plugins>
                    <plugin>
                        <!-- ======== FOR DOCUMENTATION ======== see http://confluence.atlassian.com/display/DEVNET/AMPS+Plugin+for+Maven -->
                        <groupId>com.atlassian.servicedesk.maven.plugins</groupId>
                        <artifactId>maven-jira-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>start-jira</id>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <phase>pre-integration-test</phase>
                                <configuration>
                                    <systemProperties>
                                        <!-- Properties to allow installation of a Connect add-on in our tests-->
                                        <atlassian.upm.on.demand>${atlassian.upm.on.demand}</atlassian.upm.on.demand>
                                        <atlassian.upm.connect.descriptor.allowExternal>true</atlassian.upm.connect.descriptor.allowExternal>
                                        <atlassian.connect.http.allowed>true</atlassian.connect.http.allowed>
                                        <!-- We currently need to set asap.public.key.server.url to any value - ignored while feature is behind flag - See https://ecosystem.atlassian.net/browse/ACOAUTH-152 -->
                                        <asap.public.key.server.url>https://localhost/ignore-me-and-my-trailing/</asap.public.key.server.url>

                                        <!-- This feature flag is set everywhere in prod, so have it here too -->
                                        <atlassian.darkfeature.connect.no-applinks>true</atlassian.darkfeature.connect.no-applinks>
                                    </systemProperties>
                                </configuration>
                            </execution>
                            <execution>
                                <id>stop-jira</id>
                                <goals>
                                    <goal>stop</goal>
                                </goals>
                                <phase>post-integration-test</phase>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>ci-realdb</id>

            <activation>
                <property>
                    <name>db</name>
                </property>
            </activation>

            <build>
                <plugins>
                    <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>org.apache.maven.plugins</groupId>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <executions>
                            <execution>
                                <!-- make sure this execution is defined before hallelujah and other 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/com/atlassian/dbsetup/**</include>
                                    </includes>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <!-- ======== FOR DOCUMENTATION ======== see http://confluence.atlassian.com/display/DEVNET/AMPS+Plugin+for+Maven -->
                        <groupId>com.atlassian.servicedesk.maven.plugins</groupId>
                        <artifactId>maven-jira-plugin</artifactId>
                        <!-- this config only makes sense for a real database, not HSQL -->
                        <configuration>
                            <!-- amps replaces localhost by the hostname, unless we specify the server here -->
                            <server>localhost</server>

                            <!-- new-jira-home.zip contains the dbconfig.xml configured for the RDBMS to use -->
                            <productDataPath>${project.build.directory}/${project.artifactId}-${project.version}-new-jira-home.zip</productDataPath>

                            <systemPropertyVariables>
                                <!--JIRA/Service Desk takes longer to start up when running TPMs against real RDBMS. -->
                                <atlassian.plugins.enable.wait>840</atlassian.plugins.enable.wait>
                            </systemPropertyVariables>

                            <!-- install the database driver as defined by the profile - hack alert - lib goes into WEB-INF/lib -->
                            <libArtifacts>
                                <libArtifact>
                                    <groupId>${db.artifactGroup}</groupId>
                                    <artifactId>${db.artifactId}</artifactId>
                                    <version>${db.artifactVersion}</version>
                                </libArtifact>
                            </libArtifacts>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <!-- Profile run by the OD acceptance runner when we want to run only the OD acceptance tests -->
            <id>ondemand-acceptance-tests</id>

            <activation>
                <property>
                    <name>ondemand-acceptance-tests</name>
                </property>
            </activation>

            <build>
                <!-- Freezer process delegates to maven with integration-test goal -->
                <!-- However, we don't have too much control over what is happening, so best to ensure these tests are JUnit / Failsafe compatible and run by AMPS -->
                <plugins>
                    <plugin>
                        <!-- ======== FOR DOCUMENTATION ======== see http://confluence.atlassian.com/display/DEVNET/AMPS+Plugin+for+Maven -->
                        <groupId>com.atlassian.servicedesk.maven.plugins</groupId>
                        <artifactId>maven-jira-plugin</artifactId>
                        <configuration>
                            <!-- OnDemand Acceptance testing is run using AMPS, so don't skip the tests -->
                            <skipITs>false</skipITs>
                            <skipTests>false</skipTests>
                            <skipManifestValidation>false</skipManifestValidation>

                            <testGroups>
                                <testGroup>
                                    <id>freezer-acceptance-tests</id>
                                    <productIds>
                                        <productId>jira</productId>
                                    </productIds>
                                    <includes>
                                        <include>it/com/atlassian/servicedesk/acceptance/**</include>
                                    </includes>
                                </testGroup>
                            </testGroups>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>ci-sd-with-confluence</id>

            <build>
                <plugins>
                    <plugin>
                        <groupId>com.atlassian.servicedesk.maven.plugins</groupId>
                        <artifactId>maven-amps-plugin</artifactId>
                        <configuration>

                            <!-- Starts the applications in parallel -->
                            <parallel>true</parallel>
                            <enableDevToolbox>false</enableDevToolbox>

                            <systemPropertyVariables>
                                <atlassian.dev.mode>false</atlassian.dev.mode>
                                <atlassian.mail.senddisabled>false</atlassian.mail.senddisabled>
                                <atlassian.mail.fetchdisabled>false</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>

                                <!-- 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>

                                <!-- START ~Confluence WebDriver custom wait times~ -->
                                <!-- Default Confluence page object wait time. This defaults to 5000 ms normally -->
                                <pause.render.content.millis>20000</pause.render.content.millis>

                                <!-- END ~Confluence WebDriver custom wait times~ -->

                                <!-- disable synchrony because it breaks our kb test builds -->
                                <synchrony.btf.disabled>true</synchrony.btf.disabled>
                                <org.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER>true</org.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER>
                                <mail.mime.decodeparameters>true</mail.mime.decodeparameters>
                            </systemPropertyVariables>

                            <!--
                            tests/integration-tests-parent/integration-tests/src/test/resources/log4j.properties is the file you can change for effectiveness
                            -->
                            <log4jProperties>src/test/resources/log4j.properties</log4jProperties>

                            <products>
                                <product>
                                    <id>jira</id>
                                    <instanceId>jira</instanceId>
                                    <httpPort>2990</httpPort>
                                    <jvmDebugPort>5034</jvmDebugPort>
                                    <version>${jira.version}</version>
                                    <productDataVersion>${jira.version}</productDataVersion>
                                    <output>${project.build.directory}/jira.log</output>

                                    <dataSources>
                                        <dataSource>
                                            <jndi>jdbc/JiraDS</jndi>
                                            <url>jdbc:postgresql://${db.host}:${db.port}/${db.instance}</url>
                                            <username>${db.username}</username>
                                            <password>${db.password}</password>
                                            <driver>org.postgresql.Driver</driver>
                                            <schema>${db.schema}</schema>
                                            <libArtifacts>
                                                <libArtifact>
                                                    <groupId>org.postgresql</groupId>
                                                    <artifactId>postgresql</artifactId>
                                                    <version>${postgres.jdbc.version}</version>
                                                </libArtifact>
                                            </libArtifacts>
                                        </dataSource>
                                    </dataSources>

                                    <pluginArtifacts>
                                        <!-- NOTE: this is copied from "pluginArtifacts" in the default build section below,
                                            PLUS a few other extra plugins required specifically for JIRA-Confluence integration -->
                                        <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>${project.groupId}</groupId>
                                            <artifactId>jira-servicedesk</artifactId>
                                            <version>${project.version}</version>
                                        </pluginArtifact>

                                        <pluginArtifact>
                                            <groupId>com.atlassian.plugins</groupId>
                                            <artifactId>atlassian-chaperone</artifactId>
                                            <version>${chaperone.version}</version>
                                        </pluginArtifact>

                                        <pluginArtifact>
                                            <groupId>com.atlassian.plugins</groupId>
                                            <artifactId>atlassian-client-resource</artifactId>
                                            <version>${atlassian.client.resource.version}</version>
                                        </pluginArtifact>
                                        <pluginArtifact>
                                            <groupId>${project.groupId}</groupId>
                                            <artifactId>servicedesk-testutils-plugin</artifactId>
                                            <version>${project.version}</version>
                                        </pluginArtifact>
                                        <pluginArtifact>
                                            <groupId>com.atlassian.servicedesk.plugins.automation</groupId>
                                            <artifactId>servicedesk-automation-testutils-plugin</artifactId>
                                            <version>${automation.version}</version>
                                        </pluginArtifact>
                                        <pluginArtifact>
                                            <groupId>${project.groupId}</groupId>
                                            <artifactId>servicedesk-project-ui-plugin</artifactId>
                                            <version>${project.version}</version>
                                        </pluginArtifact>
                                        <pluginArtifact>
                                            <groupId>${project.groupId}</groupId>
                                            <artifactId>servicedesk-core-ui-plugin</artifactId>
                                            <version>${project.version}</version>
                                        </pluginArtifact>
                                        <pluginArtifact>
                                            <groupId>${project.groupId}</groupId>
                                            <artifactId>jira-servicedesk-public-rest-api-plugin</artifactId>
                                            <version>${project.version}</version>
                                        </pluginArtifact>

                                        <pluginArtifact>
                                            <groupId>com.atlassian.servicedesk.plugins.automation</groupId>
                                            <artifactId>servicedesk-automation-modules-plugin</artifactId>
                                            <version>${project.version}</version>
                                        </pluginArtifact>

                                        <pluginArtifact>
                                            <groupId>com.atlassian.servicedesk</groupId>
                                            <artifactId>servicedesk-approvals-plugin</artifactId>
                                            <version>${project.version}</version>
                                        </pluginArtifact>

                                        <pluginArtifact>
                                            <groupId>com.atlassian.servicedesk</groupId>
                                            <artifactId>servicedesk-customer-management-plugin</artifactId>
                                            <version>${project.version}</version>
                                        </pluginArtifact>

                                        <pluginArtifact>
                                            <groupId>com.atlassian.servicedesk</groupId>
                                            <artifactId>servicedesk-reports-plugin</artifactId>
                                            <version>${project.version}</version>
                                        </pluginArtifact>

                                        <pluginArtifact>
                                            <groupId>com.atlassian.servicedesk</groupId>
                                            <artifactId>servicedesk-lingo-plugin</artifactId>
                                            <version>${project.version}</version>
                                        </pluginArtifact>

                                        <pluginArtifact>
                                            <groupId>com.atlassian.servicedesk</groupId>
                                            <artifactId>servicedesk-environment-bridge-plugin</artifactId>
                                            <version>${project.version}</version>
                                        </pluginArtifact>

                                        <pluginArtifact>
                                            <groupId>com.atlassian.servicedesk</groupId>
                                            <artifactId>servicedesk-notifications-plugin</artifactId>
                                            <version>${project.version}</version>
                                        </pluginArtifact>

                                        <pluginArtifact>
                                            <groupId>com.atlassian.jira.plugins.workinghours</groupId>
                                            <artifactId>jira-workinghours-plugin</artifactId>
                                            <version>${workinghours.version}</version>
                                        </pluginArtifact>

                                        <pluginArtifact>
                                            <groupId>com.atlassian.jira.plugins.workinghours</groupId>
                                            <artifactId>jira-workinghours-spi-test-plugin</artifactId>
                                            <version>${workinghours.version}</version>
                                        </pluginArtifact>

                                        <pluginArtifact>
                                            <groupId>com.atlassian.plugin.timedpromise</groupId>
                                            <artifactId>atlassian-timed-promise-plugin</artifactId>
                                            <version>${timed.promise.version}</version>
                                        </pluginArtifact>

                                        <pluginArtifact>
                                            <groupId>com.atlassian.servicedesk.plugins.automation</groupId>
                                            <artifactId>servicedesk-automation-plugin</artifactId>
                                            <version>${automation.version}</version>
                                        </pluginArtifact>

                                        <pluginArtifact>
                                            <groupId>com.atlassian.servicedesk.plugins</groupId>
                                            <artifactId>servicedesk-search-plugin</artifactId>
                                            <version>${project.version}</version>
                                        </pluginArtifact>

                                        <pluginArtifact>
                                            <groupId>${project.groupId}</groupId>
                                            <artifactId>servicedesk-knowledge-base-plugin</artifactId>
                                            <version>${project.version}</version>
                                        </pluginArtifact>

                                        <pluginArtifact>
                                            <groupId>com.atlassian.jira</groupId>
                                            <artifactId>jira-email-processor-plugin</artifactId>
                                        </pluginArtifact>

                                        <pluginArtifact>
                                            <groupId>com.atlassian.pocketknife</groupId>
                                            <artifactId>atlassian-pocketknife-api-commons-plugin</artifactId>
                                        </pluginArtifact>

                                        <pluginArtifact>
                                            <groupId>com.atlassian.servicedesk</groupId>
                                            <artifactId>jira-servicedesk-application-cloud</artifactId>
                                        </pluginArtifact>
                                        <pluginArtifact>
                                            <groupId>com.atlassian.servicedesk.plugins.automation</groupId>
                                            <artifactId>servicedesk-automation-testutils-plugin</artifactId>
                                            <version>${automation.version}</version>
                                        </pluginArtifact>

                                        <pluginArtifact>
                                            <groupId>com.atlassian.psmq</groupId>
                                            <artifactId>psmq-plugin</artifactId>
                                            <version>${psmq.version}</version>
                                        </pluginArtifact>
                                        <pluginArtifact>
                                            <groupId>com.atlassian.querydsl.plugins</groupId>
                                            <artifactId>querydsl-${querydsl.version}-provider-plugin</artifactId>
                                            <version>${querydsl.provider.version}</version>
                                        </pluginArtifact>


                                        <!-- End pluginArtifacts copied from default build -->
                                        <pluginArtifact>
                                            <groupId>${project.groupId}</groupId>
                                            <artifactId>applinks-util-plugin</artifactId>
                                            <version>${project.version}</version>
                                        </pluginArtifact>
                                        <pluginArtifact>
                                            <groupId>com.atlassian.jwt</groupId>
                                            <artifactId>jwt-plugin</artifactId>
                                        </pluginArtifact>
                                    </pluginArtifacts>
                                </product>
                                <product>
                                    <id>confluence</id>
                                    <instanceId>confluence</instanceId>
                                    <httpPort>1990</httpPort>
                                    <jvmDebugPort>5005</jvmDebugPort>
                                    <version>${confluence.version}</version>
                                    <output>${project.build.directory}/confluence.log</output>
                                    <productDataVersion>${confluence.version}</productDataVersion>
                                    <containerId>tomcat7x</containerId>
                                    <pluginArtifacts>
                                        <pluginArtifact>
                                            <groupId>${project.groupId}</groupId>
                                            <artifactId>applinks-util-plugin</artifactId>
                                            <version>${project.version}</version>
                                        </pluginArtifact>
                                        <pluginArtifact>
                                            <groupId>com.atlassian.confluence.plugins</groupId>
                                            <artifactId>confluence-scriptsfinished-plugin</artifactId>
                                            <version>${confluence.version}</version>
                                        </pluginArtifact>
                                        <pluginArtifact>
                                            <groupId>com.atlassian.confluence.plugins</groupId>
                                            <artifactId>confluence-functestrpc-plugin</artifactId>
                                            <version>${confluence.version}</version>
                                        </pluginArtifact>
                                        <pluginArtifact>
                                            <groupId>com.atlassian.confluence.plugins</groupId>
                                            <artifactId>confluence-functest-rest-plugin</artifactId>
                                            <!-- We need features of this plugin only available since 5.9 -->
                                            <version>${confluence.version}</version>
                                        </pluginArtifact>
                                    </pluginArtifacts>
                                </product>
                            </products>
                            <testGroups>
                                <testGroup>
                                    <id>sd-confluence-integration</id>
                                    <productIds>
                                        <productId>jira</productId>
                                        <productId>confluence</productId>
                                    </productIds>
                                    <includes>
                                        <include>it/com/atlassian/servicedesk/confluence/**</include>
                                    </includes>
                                </testGroup>
                            </testGroups>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
            <dependencies>
                <dependency>
                    <groupId>com.atlassian.confluence.plugins</groupId>
                    <artifactId>confluence-scriptsfinished-plugin</artifactId>
                    <version>${confluence.version}</version>
                </dependency>
                <dependency>
                    <groupId>com.atlassian.confluence.plugins</groupId>
                    <artifactId>confluence-functestrpc-plugin</artifactId>
                    <version>${confluence.version}</version>
                </dependency>
                <dependency>
                    <groupId>com.atlassian.confluence.plugins</groupId>
                    <artifactId>confluence-functest-rest-plugin</artifactId>
                    <version>${confluence.version}</version>
                </dependency>
                <dependency>
                    <groupId>${project.groupId}</groupId>
                    <artifactId>applinks-util-plugin</artifactId>
                    <version>${project.version}</version>
                    <scope>provided</scope>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>ci-it</id>

            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>run_servicedesk_integration_test</id>
                                <goals>
                                    <goal>integration-test</goal>
                                </goals>
                                <phase>integration-test</phase>
                                <configuration>
                                    <failIfNoTests>false</failIfNoTests>
                                    <includes>
                                        <include>**/NoDataRestoreTestBatch.java</include>
                                        <include>**/DataRestoreTestBatch.java</include>
                                    </includes>
                                    <properties>
                                        <property>
                                            <name>listener</name>
                                            <value>com.atlassian.servicedesk.test.utils.JUnitFlakyTestListener</value>
                                        </property>
                                    </properties>
                                    <systemPropertyVariables>
                                        <junitflakylistener.runnerId>${bamboo.build.key}-${bamboo.build.no}</junitflakylistener.runnerId>
                                        <junitflakylistener.create.jira.issue>${atb.trackFlakyTest}</junitflakylistener.create.jira.issue>
                                    </systemPropertyVariables>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>rest-tests</id>

            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>exec-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>run-rest-tests</id>
                                <phase>integration-test</phase>
                                <configuration>
                                    <executable>node</executable>
                                    <arguments>
                                        <argument>node_modules/gulp/bin/gulp.js</argument>
                                        <argument>all-it</argument>
                                        <argument>--junit</argument>
                                    </arguments>
                                    <successCodes>
                                        <successCode>0</successCode>
                                        <successCode>1</successCode>
                                    </successCodes>
                                </configuration>
                                <goals>
                                    <goal>exec</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <workingDirectory>../../../</workingDirectory>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <dependencies>
        <dependency>
            <groupId>com.atlassian.servicedesk.plugins.automation</groupId>
            <artifactId>servicedesk-automation-testutils</artifactId>
            <version>${automation.version}</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.jibx.config.osgi.wrapped</groupId>
                    <artifactId>org.jibx.config.osgi.wrapped.joda-time</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.sun.jersey</groupId>
            <artifactId>jersey-core</artifactId>
        </dependency>
        <dependency>
            <groupId>com.sun.jersey</groupId>
            <artifactId>jersey-client</artifactId>
        </dependency>
        <dependency>
            <groupId>com.sun.jersey</groupId>
            <artifactId>jersey-json</artifactId>
        </dependency>
        <dependency>
            <groupId>com.sun.jersey.contribs</groupId>
            <artifactId>jersey-multipart</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-projects-page-objects</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.pojosontheweb</groupId>
            <artifactId>monte-repack</artifactId>
            <version>1.0</version>
        </dependency>
        <dependency>
            <groupId>com.atlassian.confluence</groupId>
            <artifactId>atlassian-confluence-pageobjects</artifactId>
            <version>${confluence.version}</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>com.atlassian.selenium</groupId>
                    <artifactId>atlassian-webdriver-core</artifactId>
                </exclusion>
                <exclusion>
                    <!-- we should be using junit:junit instead -->
                    <groupId>junit</groupId>
                    <artifactId>junit-dep</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.atlassian.confluence</groupId>
            <artifactId>confluence-test-support</artifactId>
            <version>${confluence.version}</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>javax.mail</groupId>
                    <artifactId>mail</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>javax.servlet</groupId>
                    <artifactId>servlet-api</artifactId>
                </exclusion>
                <exclusion>
                    <!-- we should be using junit:junit instead -->
                    <groupId>junit</groupId>
                    <artifactId>junit-dep</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.atlassian.sal</groupId>
                    <artifactId>sal-spring</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.atlassian.sal</groupId>
                    <artifactId>sal-trust-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.atlassian.sal</groupId>
                    <artifactId>sal-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.atlassian.sal</groupId>
                    <artifactId>sal-spi</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.atlassian.plugins</groupId>
                    <artifactId>atlassian-plugins-webresource-common</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.atlassian.plugins</groupId>
                    <artifactId>atlassian-plugins-osgi-events</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.atlassian.plugins</groupId>
                    <artifactId>atlassian-plugins-spring</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.atlassian.plugins</groupId>
                    <artifactId>atlassian-plugins-osgi</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.atlassian.seraph</groupId>
                    <artifactId>atlassian-seraph</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.atlassian.activeobjects</groupId>
                    <artifactId>activeobjects-dbex</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.atlassian.activeobjects</groupId>
                    <artifactId>activeobjects-spi</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.atlassian.core</groupId>
                    <artifactId>atlassian-core</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.atlassian.plugins</groupId>
                    <artifactId>atlassian-plugins-webfragment</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.atlassian.plugins</groupId>
                    <artifactId>atlassian-plugins-webfragment-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.atlassian.plugins</groupId>
                    <artifactId>atlassian-plugins-core</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.atlassian.plugins.test</groupId>
                    <artifactId>atlassian-plugins-test</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.atlassian.plugins</groupId>
                    <artifactId>atlassian-plugins-schema</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.atlassian.plugins</groupId>
                    <artifactId>atlassian-plugins-servlet</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.atlassian.plugins</groupId>
                    <artifactId>atlassian-plugins-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.atlassian.event</groupId>
                    <artifactId>atlassian-event</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.atlassian.confluence</groupId>
            <artifactId>confluence-test-utils</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>javax.mail</groupId>
                    <artifactId>mail</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>junit</groupId>
                    <artifactId>junit-dep</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.atlassian.plugins.test</groupId>
                    <artifactId>atlassian-plugins-test</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.atlassian.confluence</groupId>
            <artifactId>confluence-rest-client</artifactId>
            <version>${confluence.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.confluence</groupId>
            <artifactId>confluence-rest-serialization</artifactId>
            <version>${confluence.version}</version>
        </dependency>
        <dependency>
            <groupId>com.atlassian.confluence</groupId>
            <artifactId>confluence-api-test-support</artifactId>
            <version>${confluence.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jsoup</groupId>
            <artifactId>jsoup</artifactId>
        </dependency>
        <dependency>
            <groupId>org.scalaz</groupId>
            <artifactId>scalaz-core_${scala.version.base}</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.jsuereth</groupId>
            <artifactId>scala-arm_${scala.version.base}</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.scala-lang</groupId>
            <artifactId>scala-compiler</artifactId>
            <version>${scala.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.scala-lang</groupId>
            <artifactId>scala-library</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>joda-time</groupId>
            <artifactId>joda-time</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.joda</groupId>
            <artifactId>joda-convert</artifactId>
            <version>1.1</version>
            <scope>test</scope>
        </dependency>

        <!-- Unit test dependencies -->
        <dependency>
            <groupId>org.scalatest</groupId>
            <artifactId>scalatest_${scala.version.base}</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
        </dependency>
        <dependency>
            <groupId>com.jayway.restassured</groupId>
            <artifactId>rest-assured</artifactId>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.powermock</groupId>
            <artifactId>powermock-module-junit4</artifactId>
        </dependency>
        <dependency>
            <groupId>org.powermock</groupId>
            <artifactId>powermock-api-mockito</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-api</artifactId>
            <version>${jira.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-core</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-tests</artifactId>
            <version>${jira.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.pocketknife</groupId>
            <artifactId>jira-pocketknife-enablement</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.pocketknife</groupId>
            <artifactId>atlassian-pocketknife-api-commons-jira</artifactId>
            <scope>test</scope>
        </dependency>

        <!-- WebDriver test dependencies -->
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>jira-servicedesk-pageobjects</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>atlassian-jira-pageobjects</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>ka-func-test-framework</artifactId>
            <version>${issuenav.components.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.scalenium</groupId>
            <artifactId>atlassian-scalenium</artifactId>
            <version>1.2</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-connect-integration-tests-support</artifactId>
            <version>${atlassian.connect.version}</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.hamcrest</groupId>
                    <artifactId>hamcrest-all</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.atlassian.jwt</groupId>
            <artifactId>jwt-plugin</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>javax.mail</groupId>
                    <artifactId>mail</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>commons-io</groupId>
                    <artifactId>commons-io</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-connect-modules</artifactId>
            <version>${atlassian.connect.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.webhooks</groupId>
            <artifactId>atlassian-webhooks-plugin</artifactId>
            <version>2.0.0</version>
            <scope>test</scope>
        </dependency>

        <!-- Func test dependencies -->
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-func-tests</artifactId>
            <version>${jira.version}</version>
            <scope>test</scope>
            <exclusions>
                <!-- Parts of this lib are unstable and keep breaking our build if we use it -->
                <exclusion>
                    <groupId>com.atlassian.jira</groupId>
                    <artifactId>jira-rest-plugin</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-tests-lic</artifactId>
            <version>${jira.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>io.spray</groupId>
            <artifactId>spray-json_${scala.version.base}</artifactId>
            <version>${spray.json.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>io.spray</groupId>
            <artifactId>spray-http_${scala.version.base}</artifactId>
            <version>${spray.http.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.jira.plugins.workinghours</groupId>
            <artifactId>jira-workinghours-rest-client</artifactId>
            <version>${workinghours.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian</groupId>
            <artifactId>atlassian-test-categories</artifactId>
            <version>0.5</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <scope>test</scope>
        </dependency>


        <!-- Fixtures, JSON models and more -->

        <dependency>
            <groupId>com.atlassian.jira.tests</groupId>
            <artifactId>jira-testkit-client</artifactId>
            <version>${testkit.version}</version>
        </dependency>

        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-rest-java-client-core</artifactId>
            <version>${rest.java.client.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework</groupId>
                    <artifactId>spring-context</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.atlassian.event</groupId>
                    <artifactId>atlassian-event</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.atlassian.sal</groupId>
                    <artifactId>sal-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>com.atlassian.servicedesk</groupId>
            <artifactId>integration-test-data-api</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-rest-java-client-api</artifactId>
            <version>${rest.java.client.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>com.atlassian.event</groupId>
                    <artifactId>atlassian-event</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient-cache</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpcore</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpmime</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.buildeng.hallelujah</groupId>
            <artifactId>client</artifactId>
            <version>${hallelujah.version}</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>javax.mail</groupId>
                    <artifactId>mail</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>javax.servlet</groupId>
                    <artifactId>servlet-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.atlassian.buildeng.hallelujah</groupId>
            <artifactId>server</artifactId>
            <version>${hallelujah.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.buildeng.hallelujah</groupId>
            <artifactId>api</artifactId>
            <version>${hallelujah.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.reflections</groupId>
            <artifactId>reflections</artifactId>
            <version>0.9.10</version>
            <scope>test</scope>
        </dependency>

        <!-- Fugue Scala interop with Java -->
        <dependency>
            <groupId>com.atlassian.fugue</groupId>
            <artifactId>fugue-scala</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.atlassian.fugue</groupId>
            <artifactId>fugue-scala</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.selenium</groupId>
            <artifactId>atlassian-webdriver-core</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-rest-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.servicemix.bundles</groupId>
            <artifactId>org.apache.servicemix.bundles.javax-inject</artifactId>
            <version>1_2</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-library</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.google.inject</groupId>
            <artifactId>guice</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.codehaus.jackson</groupId>
            <artifactId>jackson-jaxrs</artifactId>
        </dependency>
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-api</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.servicedesk.plugins.automation</groupId>
            <artifactId>servicedesk-automation-testutils-plugin</artifactId>
            <version>${automation.version}</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>commons-io</groupId>
                    <artifactId>commons-io</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.codehaus.jackson</groupId>
            <artifactId>jackson-mapper-asl</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.selenium</groupId>
            <artifactId>atlassian-pageobjects-elements</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.bundles</groupId>
            <artifactId>jsr305</artifactId>
            <version>1.1</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>dom4j</groupId>
            <artifactId>dom4j</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-support</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.selenium</groupId>
            <artifactId>atlassian-pageobjects-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.util.concurrent</groupId>
            <artifactId>atlassian-util-concurrent</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>com.springsource.org.apache.commons.lang</artifactId>
            <version>2.6.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.codehaus.jackson</groupId>
            <artifactId>jackson-core-asl</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.validation</groupId>
            <artifactId>validation-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.fugue</groupId>
            <artifactId>fugue</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>io.atlassian.fugue</groupId>
            <artifactId>fugue</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.mail</groupId>
            <artifactId>atlassian-mail</artifactId>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>com.atlassian.core</groupId>
                    <artifactId>atlassian-core</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.sun.jersey.contribs</groupId>
            <artifactId>jersey-apache-client</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.confluence</groupId>
            <artifactId>confluence-java-api</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>com.atlassian.sal</groupId>
                    <artifactId>sal-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>javax.xml.bind</groupId>
            <artifactId>jaxb-api</artifactId>
            <version>2.2.2</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <!-- TODO really, Spring 3??? -->
            <version>3.2.10.RELEASE</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>javax.ws.rs</groupId>
            <artifactId>jsr311-api</artifactId>
            <version>1.1</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.scala-lang.modules</groupId>
            <artifactId>scala-parser-combinators_2.11</artifactId>
            <version>1.0.4</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.icegreen</groupId>
            <artifactId>greenmail</artifactId>
            <version>1.3</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>javax.mail</groupId>
                    <artifactId>mail</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.atlassian.confluence</groupId>
            <artifactId>confluence-webdriver-pageobjects</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <!-- we should be using junit:junit instead -->
                    <groupId>junit</groupId>
                    <artifactId>junit-dep</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.atlassian.event</groupId>
                    <artifactId>atlassian-event</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.atlassian.plugins</groupId>
                    <artifactId>atlassian-plugins-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.jira.tests</groupId>
            <artifactId>jira-testkit-common</artifactId>
            <version>7.2.0</version>
        </dependency>
        <dependency>
            <groupId>javax.mail</groupId>
            <artifactId>javax.mail-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>cloud.atlassian.core</groupId>
            <artifactId>atlassian-core</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.pocketknife</groupId>
            <artifactId>atlassian-pocketknife-api-commons</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.json</groupId>
            <artifactId>json</artifactId>
            <version>20090211</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>annotations</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.json</groupId>
            <artifactId>org.json</artifactId>
            <version>chargebee-1.0</version>
        </dependency>
        <dependency>
            <groupId>com.sun.mail</groupId>
            <artifactId>javax.mail</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.inject</groupId>
            <artifactId>javax.inject</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>jsr305</artifactId>
        </dependency>

        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>jira-servicedesk-web-test-fixtures</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>com.atlassian.servicedesk</groupId>
            <artifactId>integration-test-runner</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian</groupId>
            <artifactId>test-batching</artifactId>
        </dependency>
        <dependency>
            <groupId>io.atlassian.fugue</groupId>
            <artifactId>fugue-hamcrest</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.pocketknife</groupId>
            <artifactId>atlassian-pocketknife-step</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.servicedesk</groupId>
            <artifactId>db-setup</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.atlassian.servicedesk</groupId>
            <artifactId>jira-servicedesk-application-cloud</artifactId>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <testResources>
            <testResource>
                <directory>src/test/resources</directory>
                <filtering>true</filtering>
                <includes>
                    <include>**/hallelujah.properties</include>
                    <include>**/issuecreator_config.json</include>
                </includes>
            </testResource>
            <testResource>
                <directory>src/test/resources</directory>
                <filtering>false</filtering>
                <excludes>
                    <exclude>**/hallelujah.properties</exclude>
                    <exclude>**/issuecreator_config.json</exclude>
                </excludes>
            </testResource>
        </testResources>

        <resources>
            <resource>
                <directory>src/test/xml</directory>
            </resource>
        </resources>

        <plugins>
            <plugin>
                <groupId>net.alchim31.maven</groupId>
                <artifactId>scala-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>com.atlassian.servicedesk.maven.plugins</groupId>
                <artifactId>maven-jira-plugin</artifactId>
                <configuration>
                    <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>
                    <skipTests>true</skipTests>

                    <skipAmpsPomCheck>true</skipAmpsPomCheck>
                    <skipManifestValidation>true</skipManifestValidation>
                    <skipAllPrompts>true</skipAllPrompts>

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

                    <systemPropertyVariables>
                        <!--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>

                        <atlassian.dev.mode>false</atlassian.dev.mode>
                        <atlassian.mail.senddisabled>false</atlassian.mail.senddisabled>
                        <atlassian.mail.fetchdisabled>false</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>

                        <!-- 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>
                    </systemPropertyVariables>

                    <!--
                    tests/integration-tests-parent/integration-tests/src/test/resources/log4j.properties is the file you can change for effectiveness
                    -->
                    <log4jProperties>src/test/resources/log4j.properties</log4jProperties>

                    <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.plugins</groupId>
                            <artifactId>atlassian-chaperone</artifactId>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>com.atlassian.servicedesk</groupId>
                            <artifactId>jira-servicedesk</artifactId>
                            <version>${project.version}</version>
                        </pluginArtifact>
                        <!--
                            We are keeping the jira-issue-nav-components inside pluginArtifacts
                            due to a bug in the version shipped in JIRA 6.4 which breaks the
                            agent view in dev mode on IE10. DO NOT SHIP THIS ARTIFACT IN THE OBR!
                        -->
                        <pluginArtifact>
                            <groupId>com.atlassian.plugins</groupId>
                            <artifactId>atlassian-client-resource</artifactId>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>${project.groupId}</groupId>
                            <artifactId>servicedesk-testutils-plugin</artifactId>
                            <version>${project.version}</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>com.atlassian.servicedesk.plugins.automation</groupId>
                            <artifactId>servicedesk-automation-testutils-plugin</artifactId>
                            <version>${automation.version}</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>${project.groupId}</groupId>
                            <artifactId>servicedesk-project-ui-plugin</artifactId>
                            <version>${project.version}</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>${project.groupId}</groupId>
                            <artifactId>servicedesk-reports-plugin</artifactId>
                            <version>${project.version}</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>${project.groupId}</groupId>
                            <artifactId>servicedesk-approvals-plugin</artifactId>
                            <version>${project.version}</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>${project.groupId}</groupId>
                            <artifactId>servicedesk-customer-management-plugin</artifactId>
                            <version>${project.version}</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>${project.groupId}</groupId>
                            <artifactId>servicedesk-core-ui-plugin</artifactId>
                            <version>${project.version}</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>${project.groupId}</groupId>
                            <artifactId>jira-servicedesk-public-rest-api-plugin</artifactId>
                            <version>${project.version}</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>com.atlassian.pocketknife</groupId>
                            <artifactId>atlassian-pocketknife-api-commons-plugin</artifactId>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>com.atlassian.jira.plugins.workinghours</groupId>
                            <artifactId>jira-workinghours-plugin</artifactId>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>com.atlassian.plugin.timedpromise</groupId>
                            <artifactId>atlassian-timed-promise-plugin</artifactId>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>com.atlassian.servicedesk.plugins.automation</groupId>
                            <artifactId>servicedesk-automation-plugin</artifactId>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>com.atlassian.servicedesk.plugins.automation</groupId>
                            <artifactId>servicedesk-automation-modules-plugin</artifactId>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>com.atlassian.servicedesk.plugins.automation</groupId>
                            <artifactId>servicedesk-automation-then-webhook-plugin</artifactId>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>com.atlassian.psmq</groupId>
                            <artifactId>psmq-plugin</artifactId>
                            <version>${psmq.version}</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>com.atlassian.querydsl.plugins</groupId>
                            <artifactId>querydsl-${querydsl.version}-provider-plugin</artifactId>
                            <version>${querydsl.provider.version}</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>com.atlassian.servicedesk.plugins</groupId>
                            <artifactId>servicedesk-search-plugin</artifactId>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>com.atlassian.jira</groupId>
                            <artifactId>jira-email-processor-plugin</artifactId>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>com.atlassian.servicedesk</groupId>
                            <artifactId>jira-servicedesk-application-cloud</artifactId>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>com.atlassian.servicedesk.plugins.automation</groupId>
                            <artifactId>servicedesk-automation-testutils-plugin</artifactId>
                            <version>${automation.version}</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>com.atlassian.analytics</groupId>
                            <artifactId>analytics-client</artifactId>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>${project.groupId}</groupId>
                            <artifactId>servicedesk-knowledge-base-plugin</artifactId>
                            <version>${project.version}</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>${project.groupId}</groupId>
                            <artifactId>servicedesk-lingo-plugin</artifactId>
                            <version>${project.version}</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>com.atlassian.servicedesk</groupId>
                            <artifactId>servicedesk-environment-bridge-plugin</artifactId>
                            <version>${project.version}</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>${project.groupId}</groupId>
                            <artifactId>servicedesk-notifications-plugin</artifactId>
                            <version>${project.version}</version>
                        </pluginArtifact>

                        <!-- For Connect -->
                        <pluginArtifact>
                            <groupId>com.atlassian.bundles</groupId>
                            <artifactId>json-schema-validator-atlassian-bundle</artifactId>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>com.atlassian.jwt</groupId>
                            <artifactId>jwt-plugin</artifactId>ex
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>com.atlassian.upm</groupId>
                            <artifactId>atlassian-universal-plugin-manager-plugin</artifactId>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>com.atlassian.plugins</groupId>
                            <artifactId>atlassian-connect-plugin</artifactId>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>com.atlassian.servicedesk</groupId>
                            <artifactId>servicedesk-connect-support-plugin</artifactId>
                            <version>${project.version}</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>com.atlassian.servicedesk</groupId>
                            <artifactId>servicedesk-connect-remote-actions-plugin</artifactId>
                            <version>${project.version}</version>
                        </pluginArtifact>
                    </pluginArtifacts>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.4</version>
                <executions>
                    <execution>
                        <id>test-jar</id>
                        <goals>
                            <goal>test-jar</goal>
                        </goals>
                        <configuration>
                            <forceCreation>true</forceCreation>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <configuration>
                        <excludes>
                            <exclude>**/*$*</exclude>
                            <exclude>it/**</exclude>
                        </excludes>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <configuration>
                        <systemProperties>
                            <xvfb.enable>${xvfb.enable}</xvfb.enable>
                            <atlassian.dev.mode>false</atlassian.dev.mode>
                        </systemProperties>
                        <excludes>
                            <exclude>**/*$*</exclude>
                            <exclude>**/Abstract*</exclude>
                        </excludes>
                    </configuration>
                    <executions>
                        <execution>
                            <goals>
                                <goal>verify</goal>
                            </goals>
                            <phase>verify</phase>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.scalatest</groupId>
                    <artifactId>scalatest-maven-plugin</artifactId>
                    <configuration>
                        <reportsDirectory>${project.build.directory}/failsafe-reports</reportsDirectory>
                        <junitxml>.</junitxml>
                        <!-- for what the letters in stdout mean http://www.scalatest.org/user_guide/using_the_runner -->
                        <filereports>WDF ScalaTestLog.txt</filereports>
                        <stdout>WDF</stdout>
                        <parallel>false</parallel>
                        <systemProperties>
                            <xvfb.enable>${xvfb.enable}</xvfb.enable>
                            <atlassian.dev.mode>false</atlassian.dev.mode>
                        </systemProperties>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
    <properties>
        <confluence.data.version>5.6.6</confluence.data.version>
        <generated-src>${project.build.directory}/generated-src</generated-src>
        <pretty.url.version>1.8</pretty.url.version>
        <atl.lf.version>1.2</atl.lf.version>
        <vp.qa.data>src/test/resources/vp-qa-data.zip</vp.qa.data>
        <jrebel.agent><!-- see jrebel profile to enable --></jrebel.agent>
        <jvmargs><!-- placeholeder for -jvmargs param from atlas-debug  --></jvmargs>
        <artifactDir>${project.basedir}/../../../passed-artifacts</artifactDir>
        <webdriver.browser>firefox</webdriver.browser>
        <hallelujah.queueId>sdTests</hallelujah.queueId>
        <hallelujah.tagsToInclude></hallelujah.tagsToInclude>
        <hallelujah.tagsToExclude></hallelujah.tagsToExclude>
        <hallelujah.packagesToTest>it.com.atlassian.servicedesk.rest,it.com.atlassian.servicedesk.webdriver</hallelujah.packagesToTest>
        <hallelujah.trackFlakyTest>false</hallelujah.trackFlakyTest>
        <atb.trackFlakyTest>false</atb.trackFlakyTest>
        <od.testing.configuration>
            use-maven,3.3.9
            use-java,8
            set-categories,on-trigger="com.atlassian.crowd:user-provisioning-plugin",categories="it.com.atlassian.servicedesk.acceptance.categories.AgainstUMSuiteTest"
            set-categories,on-trigger="com.atlassian.crowd:horde-web-app",categories="it.com.atlassian.servicedesk.acceptance.categories.AgainstHordeSuiteTest"
        </od.testing.configuration>
        <failsafe.rerunFailingTestsCount>2</failsafe.rerunFailingTestsCount>
        <!--it will help us to get result faster in case of system broken-->
        <failsafe.skipAfterFailureCount>20</failsafe.skipAfterFailureCount>

        <dbconfig.path>src/db</dbconfig.path>
    </properties>

</project>
