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

    <parent>
        <groupId>com.atlassian.jira</groupId>
        <artifactId>jira-functional-tests</artifactId>
        <version>8.13.12</version>
    </parent>

    <artifactId>jira-johnson-tests</artifactId>

    <name>Atlassian JIRA - Johnson tests</name>
    <description>Tests for the johnson error handling framework in JIRA during startup</description>

    <!-- this is mostly copied from jira-distribution/tpm-standalone/spm/pom.xml -->
    <!-- It uses a profile for each test as JIRA must be started each test-->
    <!-- Common properties -->
    <properties>
        <jiradb.version>1.4</jiradb.version>

        <test.host>localhost</test.host>
        <webdriverTestSettings>${project.build.directory}/classes/jira-surefire-test.properties</webdriverTestSettings>
        <sql.maven.version>1.4</sql.maven.version>
        <!--
            Known issue:
        Changing the appServer.port using system properties does not work if you want to run the JIRA instance
        against the integration tests. For some reason (which I couldn't work out), the filtering of the
        jira-surefire-test.properties file performs the substitution using the specified values in the pom.xml
        (ie 8080) and not the value that has been passed in the system property
         -->
        <appServer.host>localhost</appServer.host>
        <appServer.port>8080</appServer.port>
        <appServer.ssl.port>8081</appServer.ssl.port>
        <appServer.shutdown.port>8081</appServer.shutdown.port>
        <webApp.contextRoot/>

        <numberOfBatches>1</numberOfBatches>
        <batch>1</batch>

        <appServer.install.directory>atlassian-jira-core-${project.version}-standalone</appServer.install.directory>
        <jira.install.directory>${project.build.directory}/${appServer.install.directory}</jira.install.directory>

        <db.host>localhost</db.host>
        <db.instance>jira</db.instance>
        <db.username>jira</db.username>
        <db.password>jira</db.password>
        <db.dataSourceName>defaultDS</db.dataSourceName>

        <db.dumpLogsOnError>ALL</db.dumpLogsOnError>
        <db.type>h2</db.type>


        <jira.functest.maxMemory>768m</jira.functest.maxMemory>
        <jira.functest.minMemory>384m</jira.functest.minMemory>
        <jira.functest.maxPermSize>512m</jira.functest.maxPermSize>
        <jira.functest.jvmargs.hardmode>${jira.user.hardmode.jvmargs}</jira.functest.jvmargs.hardmode>
        <jira.functest.jvmargs>-server -Dmail.mime.decodeparameters=true
            -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true -Xmx${jira.functest.maxMemory}
            -Xms${jira.functest.minMemory} -XX:MaxPermSize=${jira.functest.maxPermSize} -XX:+HeapDumpOnOutOfMemoryError
            -Djira.plugins.bundled.disable=false ${jira.user.jvmargs} -Dfile.encoding=utf-8 -Djira.dump=true
            -Djira.websudo.is.disabled=true -Djira.fisheye.reloadOnClearCache=false -Djira.setup.analytics.iframe.url=""
            ${jira.functest.jvmargs.hardmode}
        </jira.functest.jvmargs>

        <jira.home.directory>${jira.generated.home.directory}</jira.home.directory>
        <jira.generated.resources.directory>${project.build.directory}/generated-resources/jira
        </jira.generated.resources.directory>
        <jira.generated.home.directory>${jira.generated.resources.directory}/home</jira.generated.home.directory>
        <jira.empty.home.directory>/tmp/empty_home/</jira.empty.home.directory>
        <aspectj.version>1.7.4</aspectj.version>


        <allure.version>1.5.4</allure.version>

        <baseURL>http://${appServer.host}:${appServer.port}/${webApp.contextRoot}</baseURL>
    </properties>

    <dependencies>
        <dependency>
            <groupId>ant-contrib</groupId>
            <artifactId>ant-contrib</artifactId>
            <version>1.0b3</version>
            <exclusions>
                <exclusion>
                    <groupId>ant</groupId>
                    <artifactId>ant</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>javax.inject</groupId>
            <artifactId>javax.inject</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>atlassian-jira-pageobjects</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>ru.yandex.qatools.allure</groupId>
            <artifactId>allure-junit-adaptor</artifactId>
            <version>${allure.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>jsr305</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>annotations</artifactId>
            <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>org.hamcrest</groupId>
            <artifactId>hamcrest-all</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.jira.tests</groupId>
            <artifactId>jira-testkit-client</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-clean-plugin</artifactId>
                <version>3.0.0</version>
                <configuration>
                    <filesets>
                        <fileset>
                            <directory>jirahome</directory>
                        </fileset>
                    </filesets>
                </configuration>
            </plugin>

            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <executions>

                    <execution>
                        <id>default-test</id>
                        <phase>test</phase>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <configuration>
                            <skip>true</skip>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-failsafe-plugin</artifactId>
                <!-- TODO: This is a temporary due to broken maven-failsafe-plugin version in parent (2.18.1). Remove <version> once it is bumped there -->
                <version>2.20.1</version>
                <configuration>
                    <systemProperties>
                    <property>
                        <name>test.server.properties</name>
                        <value>${webdriverTestSettings}</value>
                    </property>
                </systemProperties>
                    <testFailureIgnore>false</testFailureIgnore>
                    <argLine>
                        -javaagent:${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar
                    </argLine>
                    <properties>
                        <property>
                            <name>listener</name>
                            <value>ru.yandex.qatools.allure.junit.AllureRunListener</value>
                        </property>
                    </properties>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.aspectj</groupId>
                        <artifactId>aspectjweaver</artifactId>
                        <version>${aspectj.version}</version>
                    </dependency>
                </dependencies>
            </plugin>

        </plugins>

        <resources>
            <resource>
                <directory>src/test/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
    </build>

    <profiles>
        <profile>
            <id>prepare-for-johnson-tests</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <version>2.2</version>
                        <executions>
                            <execution>
                                <id>unpack-jira-standalone</id>
                                <phase>pre-integration-test</phase>

                                <goals>
                                    <goal>unpack</goal>
                                </goals>

                                <configuration>
                                    <artifactItems>
                                        <artifactItem>
                                            <groupId>com.atlassian.jira</groupId>
                                            <artifactId>jira-core-standalone-distribution</artifactId>
                                            <version>${project.version}</version>
                                            <type>tar.gz</type>
                                            <classifier>standalone</classifier>
                                        </artifactItem>
                                    </artifactItems>
                                    <outputDirectory>${project.build.directory}</outputDirectory>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <!-- Each of the profiles below set up one particular test condition, and asserts on the state it gets in  using a single Junit test -->

        <!-- These profiles set up JIRA in such a way that it starts up  -->

        <profile>
            <id>UpgradeSingleErrorDatabaseConfigured</id>
            <properties>
                <it.test>TestJohnsonFrameworkSingleError</it.test>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <configuration>
                            <skip>false</skip>
                        </configuration>
                        <executions>
                            <execution>
                                <id>integration-test</id>
                                <goals>
                                    <goal>integration-test</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>verify</id>
                                <goals>
                                    <goal>verify</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <artifactId>maven-resources-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>prepare-shared-home</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>copy-resources</goal>
                                </goals>
                                <configuration>
                                    <outputDirectory>${jira.generated.home.directory}</outputDirectory>
                                    <resources>
                                        <resource>
                                            <directory>src/test/resources/jira_home</directory>
                                            <filtering>true</filtering>
                                            <includes>
                                                <include>dbconfig.xml</include>
                                            </includes>
                                        </resource>

                                        <resource>
                                            <directory>src/test/resources/jira_home</directory>
                                            <filtering>false</filtering>
                                            <excludes>
                                                <exclude>dbconfig.xml</exclude>
                                            </excludes>
                                        </resource>

                                    </resources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>johnson-standalone-jira-setup</id>
                                <phase>pre-integration-test</phase>
                                <configuration>
                                    <tasks>
                                        <!-- Update the test.properties file to indicate we're testing a Standalone installation type -->
                                        <replace file="${webdriverTestSettings}"
                                                 token="jira.release.info = unknown"
                                                 value="jira.release.info = Standalone"/>

                                        <chmod dir="${project.build.directory}" perm="ugo+rx" includes="**/*.sh"/>

                                        <!-- JRADEV-809: From jira-application properties: Each backslash in your path must be written as a forward slash -->

                                        <!-- Need more heap and permgen space and for func tests -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/bin/setenv.sh"
                                                token='JIRA_MAX_PERM_SIZE=384m'
                                                value='JIRA_MAX_PERM_SIZE=${jira.functest.maxPermSize}'/>
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/bin/setenv.sh"
                                                token='JVM_MAXIMUM_MEMORY="768m"'
                                                value='JVM_MAXIMUM_MEMORY="${jira.functest.maxMemory}"'/>

                                        <!-- Setting jira port -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/conf/server.xml"
                                                token="Connector port=&quot;8080&quot;"
                                                value="Connector port=&quot;${appServer.port}&quot;"/>

                                        <!-- Setting shutdown port -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/conf/server.xml"
                                                token="Server port=&quot;8005&quot;"
                                                value="Server port=&quot;${appServer.shutdown.port}&quot;"/>

                                        <!-- Setting jira home -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/atlassian-jira/WEB-INF/classes/jira-application.properties"
                                                token="jira.home =" value="jira.home = ${jira.generated.home.directory}"/>

                                        <exec executable="${project.build.directory}/${appServer.install.directory}/bin/start-jira.sh"
                                              spawn="false">
                                            <env key="JAVA_OPTS"
                                                 value="-Djira.paths.set.allowed=true ${jira.user.jvmargs} -Djira.websudo.is.disabled=true -Djira.johnson.simulate.failure=DATABASE_CONFIGURED:error"/>
                                            <env key="JIRA_HOME"
                                                 value="${jira.generated.home.directory}"/>
                                        </exec>

                                        <waitfor maxwait="4" maxwaitunit="minute" checkevery="100"
                                                 timeoutproperty="startup-failed">
                                            <http url="${baseURL}"/>
                                        </waitfor>

                                    </tasks>
                                </configuration>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>johnson-standalone-jira-shutdown</id>
                                <phase>post-integration-test</phase>
                                <configuration>
                                    <tasks>
                                        <exec executable="${project.build.directory}/${appServer.install.directory}/bin/stop-jira.sh"
                                              spawn="false">
                                            <env key="JIRA_HOME"
                                                 value="${jira.generated.home.directory}"/>
                                        </exec>
                                    </tasks>
                                </configuration>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>UpgradeSingleErrorPostDatabaseActivated</id>
            <properties>
                <it.test>TestJohnsonFrameworkSingleError</it.test>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <configuration>
                            <skip>false</skip>
                        </configuration>
                        <executions>
                            <execution>
                                <id>integration-test</id>
                                <goals>
                                    <goal>integration-test</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>verify</id>
                                <goals>
                                    <goal>verify</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <artifactId>maven-resources-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>prepare-shared-home</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>copy-resources</goal>
                                </goals>
                                <configuration>
                                    <outputDirectory>${jira.generated.home.directory}</outputDirectory>
                                    <resources>
                                        <resource>
                                            <directory>src/test/resources/jira_home</directory>
                                            <filtering>true</filtering>
                                            <includes>
                                                <include>dbconfig.xml</include>
                                            </includes>
                                        </resource>

                                        <resource>
                                            <directory>src/test/resources/jira_home</directory>
                                            <filtering>false</filtering>
                                            <excludes>
                                                <exclude>dbconfig.xml</exclude>
                                            </excludes>
                                        </resource>

                                    </resources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>johnson-standalone-jira-setup</id>
                                <phase>pre-integration-test</phase>
                                <configuration>
                                    <tasks>
                                        <!-- Update the test.properties file to indicate we're testing a Standalone installation type -->
                                        <replace file="${webdriverTestSettings}"
                                                 token="jira.release.info = unknown"
                                                 value="jira.release.info = Standalone"/>

                                        <chmod dir="${project.build.directory}" perm="ugo+rx" includes="**/*.sh"/>

                                        <!-- JRADEV-809: From jira-application properties: Each backslash in your path must be written as a forward slash -->

                                        <!-- Need more heap and permgen space and for func tests -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/bin/setenv.sh"
                                                token='JIRA_MAX_PERM_SIZE=384m'
                                                value='JIRA_MAX_PERM_SIZE=${jira.functest.maxPermSize}'/>
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/bin/setenv.sh"
                                                token='JVM_MAXIMUM_MEMORY="768m"'
                                                value='JVM_MAXIMUM_MEMORY="${jira.functest.maxMemory}"'/>

                                        <!-- Setting jira port -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/conf/server.xml"
                                                token="Connector port=&quot;8080&quot;"
                                                value="Connector port=&quot;${appServer.port}&quot;"/>

                                        <!-- Setting shutdown port -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/conf/server.xml"
                                                token="Server port=&quot;8005&quot;"
                                                value="Server port=&quot;${appServer.shutdown.port}&quot;"/>

                                        <!-- Setting jira home -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/atlassian-jira/WEB-INF/classes/jira-application.properties"
                                                token="jira.home =" value="jira.home = ${jira.generated.home.directory}"/>

                                        <exec executable="${project.build.directory}/${appServer.install.directory}/bin/start-jira.sh"
                                              spawn="true">
                                            <env key="JAVA_OPTS"
                                                 value="-Djira.paths.set.allowed=true ${jira.user.jvmargs} -Djira.websudo.is.disabled=true -Djira.johnson.simulate.failure=POST_DATABASE_ACTIVATED:error"/>
                                            <env key="JIRA_HOME"
                                                 value="${jira.generated.home.directory}"/>
                                        </exec>

                                        <!--Since this test runs after database launch it needs more time to start up -->
                                        <waitfor maxwait="4" maxwaitunit="minute" checkevery="60"
                                                 timeoutproperty="startup-failed">
                                            <http url="${baseURL}"/>
                                        </waitfor>

                                    </tasks>
                                </configuration>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>johnson-standalone-jira-shutdown</id>
                                <phase>post-integration-test</phase>
                                <configuration>
                                    <tasks>
                                        <exec executable="${project.build.directory}/${appServer.install.directory}/bin/stop-jira.sh"
                                              spawn="false">
                                            <env key="JIRA_HOME"
                                                 value="${jira.generated.home.directory}"/>
                                        </exec>
                                    </tasks>
                                </configuration>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>UpgradeErrorsPostDatabaseActivated</id>
            <properties>
                <it.test>TestJohnsonFrameworkSeveralErrors</it.test>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <configuration>
                            <skip>false</skip>
                        </configuration>
                        <executions>
                            <execution>
                                <id>integration-test</id>
                                <goals>
                                    <goal>integration-test</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>verify</id>
                                <goals>
                                    <goal>verify</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <artifactId>maven-resources-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>prepare-shared-home</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>copy-resources</goal>
                                </goals>
                                <configuration>
                                    <outputDirectory>${jira.generated.home.directory}</outputDirectory>
                                    <resources>
                                        <resource>
                                            <directory>src/test/resources/jira_home</directory>
                                            <filtering>true</filtering>
                                            <includes>
                                                <include>dbconfig.xml</include>
                                            </includes>
                                        </resource>

                                        <resource>
                                            <directory>src/test/resources/jira_home</directory>
                                            <filtering>false</filtering>
                                            <excludes>
                                                <exclude>dbconfig.xml</exclude>
                                            </excludes>
                                        </resource>

                                    </resources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>johnson-standalone-jira-setup</id>
                                <phase>pre-integration-test</phase>
                                <configuration>
                                    <tasks>
                                        <!-- Update the test.properties file to indicate we're testing a Standalone installation type -->
                                        <replace file="${webdriverTestSettings}"
                                                 token="jira.release.info = unknown"
                                                 value="jira.release.info = Standalone"/>
                                        <chmod dir="${project.build.directory}" perm="ugo+rx" includes="**/*.sh"/>

                                        <!-- JRADEV-809: From jira-application properties: Each backslash in your path must be written as a forward slash -->

                                        <!-- Need more heap and permgen space and for func tests -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/bin/setenv.sh"
                                                token='JIRA_MAX_PERM_SIZE=384m'
                                                value='JIRA_MAX_PERM_SIZE=${jira.functest.maxPermSize}'/>
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/bin/setenv.sh"
                                                token='JVM_MAXIMUM_MEMORY="768m"'
                                                value='JVM_MAXIMUM_MEMORY="${jira.functest.maxMemory}"'/>

                                        <!-- Setting jira port -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/conf/server.xml"
                                                token="Connector port=&quot;8080&quot;"
                                                value="Connector port=&quot;${appServer.port}&quot;"/>

                                        <!-- Setting shutdown port -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/conf/server.xml"
                                                token="Server port=&quot;8005&quot;"
                                                value="Server port=&quot;${appServer.shutdown.port}&quot;"/>

                                        <!-- Setting jira home -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/atlassian-jira/WEB-INF/classes/jira-application.properties"
                                                token="jira.home =" value="jira.home = ${jira.generated.home.directory}"/>


                                        <exec executable="${project.build.directory}/${appServer.install.directory}/bin/start-jira.sh"
                                              spawn="false">
                                            <env key="JAVA_OPTS"
                                                 value="-Djira.paths.set.allowed=true ${jira.user.jvmargs} -Djira.websudo.is.disabled=true -Djira.johnson.simulate.failure=POST_DATABASE_ACTIVATED:error,error"/>
                                            <env key="JIRA_HOME"
                                                 value="${jira.generated.home.directory}"/>
                                        </exec>

                                        <!--Since this test runs after database launch it needs more time to start up-->
                                        <waitfor maxwait="4" maxwaitunit="minute" checkevery="100"
                                                 timeoutproperty="startup-failed">
                                            <http url="${baseURL}"/>
                                        </waitfor>
                                    </tasks>
                                </configuration>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>johnson-standalone-jira-shutdown</id>
                                <phase>post-integration-test</phase>
                                <configuration>
                                    <tasks>
                                        <exec executable="${project.build.directory}/${appServer.install.directory}/bin/stop-jira.sh"
                                              spawn="false">
                                            <env key="JIRA_HOME"
                                                 value="${jira.generated.home.directory}"/>
                                        </exec>
                                    </tasks>
                                </configuration>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>UpgradeErrorAndWarningPostConsistencyChecks</id>
            <properties>
                <it.test>TestJohnsonFrameworkErrorAndWarning</it.test>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <configuration>
                            <skip>false</skip>
                        </configuration>
                        <executions>
                            <execution>
                                <id>integration-test</id>
                                <goals>
                                    <goal>integration-test</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>verify</id>
                                <goals>
                                    <goal>verify</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <artifactId>maven-resources-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>prepare-shared-home</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>copy-resources</goal>
                                </goals>
                                <configuration>
                                    <outputDirectory>${jira.generated.home.directory}</outputDirectory>
                                    <resources>
                                        <resource>
                                            <directory>src/test/resources/jira_home</directory>
                                            <filtering>true</filtering>
                                            <includes>
                                                <include>dbconfig.xml</include>
                                            </includes>
                                        </resource>

                                        <resource>
                                            <directory>src/test/resources/jira_home</directory>
                                            <filtering>false</filtering>
                                            <excludes>
                                                <exclude>dbconfig.xml</exclude>
                                            </excludes>
                                        </resource>

                                    </resources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>johnson-standalone-jira-setup</id>
                                <phase>pre-integration-test</phase>
                                <configuration>
                                    <tasks>
                                        <!-- Update the test.properties file to indicate we're testing a Standalone installation type -->
                                        <replace file="${webdriverTestSettings}"
                                                 token="jira.release.info = unknown"
                                                 value="jira.release.info = Standalone"/>

                                        <chmod dir="${project.build.directory}" perm="ugo+rx" includes="**/*.sh"/>

                                        <!-- JRADEV-809: From jira-application properties: Each backslash in your path must be written as a forward slash -->

                                        <!-- Need more heap and permgen space and for func tests -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/bin/setenv.sh"
                                                token='JIRA_MAX_PERM_SIZE=384m'
                                                value='JIRA_MAX_PERM_SIZE=${jira.functest.maxPermSize}'/>
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/bin/setenv.sh"
                                                token='JVM_MAXIMUM_MEMORY="768m"'
                                                value='JVM_MAXIMUM_MEMORY="${jira.functest.maxMemory}"'/>

                                        <!-- Setting jira port -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/conf/server.xml"
                                                token="Connector port=&quot;8080&quot;"
                                                value="Connector port=&quot;${appServer.port}&quot;"/>

                                        <!-- Setting shutdown port -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/conf/server.xml"
                                                token="Server port=&quot;8005&quot;"
                                                value="Server port=&quot;${appServer.shutdown.port}&quot;"/>

                                        <!-- Setting jira home -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/atlassian-jira/WEB-INF/classes/jira-application.properties"
                                                token="jira.home =" value="jira.home = ${jira.generated.home.directory}"/>

                                        <exec executable="${project.build.directory}/${appServer.install.directory}/bin/start-jira.sh"
                                              spawn="false">
                                            <env key="JAVA_OPTS"
                                                 value="-Djira.paths.set.allowed=true ${jira.user.jvmargs} -Djira.websudo.is.disabled=true -Djira.johnson.simulate.failure=POST_CONSISTENCY_CHECKS:warning-dismissible,error"/>
                                            <env key="JIRA_HOME"
                                                 value="${jira.generated.home.directory}"/>
                                        </exec>

                                        <waitfor maxwait="4" maxwaitunit="minute" checkevery="100"
                                                 timeoutproperty="startup-failed">
                                            <http url="${baseURL}"/>
                                        </waitfor>

                                    </tasks>
                                </configuration>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>johnson-standalone-jira-shutdown</id>
                                <phase>post-integration-test</phase>
                                <configuration>
                                    <tasks>
                                        <exec executable="${project.build.directory}/${appServer.install.directory}/bin/stop-jira.sh"
                                              spawn="false">
                                            <env key="JIRA_HOME"
                                                 value="${jira.generated.home.directory}"/>
                                        </exec>
                                    </tasks>
                                </configuration>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>UpgradeNonDismissibleWarningsPostConsistencyChecks</id>
            <properties>
                <it.test>TestJohnsonFrameworkNonDismissibleWarnings</it.test>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <configuration>
                            <skip>false</skip>
                        </configuration>
                        <executions>
                            <execution>
                                <id>integration-test</id>
                                <goals>
                                    <goal>integration-test</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>verify</id>
                                <goals>
                                    <goal>verify</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <artifactId>maven-resources-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>prepare-shared-home</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>copy-resources</goal>
                                </goals>
                                <configuration>
                                    <outputDirectory>${jira.generated.home.directory}</outputDirectory>
                                    <resources>
                                        <resource>
                                            <directory>src/test/resources/jira_home</directory>
                                            <filtering>true</filtering>
                                            <includes>
                                                <include>dbconfig.xml</include>
                                            </includes>
                                        </resource>

                                        <resource>
                                            <directory>src/test/resources/jira_home</directory>
                                            <filtering>false</filtering>
                                            <excludes>
                                                <exclude>dbconfig.xml</exclude>
                                            </excludes>
                                        </resource>

                                    </resources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>johnson-standalone-jira-setup</id>
                                <phase>pre-integration-test</phase>
                                <configuration>
                                    <tasks>
                                        <!-- Update the test.properties file to indicate we're testing a Standalone installation type -->
                                        <replace file="${webdriverTestSettings}"
                                                 token="jira.release.info = unknown"
                                                 value="jira.release.info = Standalone"/>

                                        <chmod dir="${project.build.directory}" perm="ugo+rx" includes="**/*.sh"/>

                                        <!-- JRADEV-809: From jira-application properties: Each backslash in your path must be written as a forward slash -->

                                        <!-- Need more heap and permgen space and for func tests -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/bin/setenv.sh"
                                                token='JIRA_MAX_PERM_SIZE=384m'
                                                value='JIRA_MAX_PERM_SIZE=${jira.functest.maxPermSize}'/>
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/bin/setenv.sh"
                                                token='JVM_MAXIMUM_MEMORY="768m"'
                                                value='JVM_MAXIMUM_MEMORY="${jira.functest.maxMemory}"'/>

                                        <!-- Setting jira port -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/conf/server.xml"
                                                token="Connector port=&quot;8080&quot;"
                                                value="Connector port=&quot;${appServer.port}&quot;"/>

                                        <!-- Setting shutdown port -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/conf/server.xml"
                                                token="Server port=&quot;8005&quot;"
                                                value="Server port=&quot;${appServer.shutdown.port}&quot;"/>

                                        <!-- Setting jira home -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/atlassian-jira/WEB-INF/classes/jira-application.properties"
                                                token="jira.home =" value="jira.home = ${jira.generated.home.directory}"/>

                                        <exec executable="${project.build.directory}/${appServer.install.directory}/bin/start-jira.sh"
                                              spawn="false">
                                            <env key="JAVA_OPTS"
                                                 value="-Djira.paths.set.allowed=true ${jira.user.jvmargs} -Djira.websudo.is.disabled=true -Djira.johnson.simulate.failure=POST_CONSISTENCY_CHECKS:warning,warning"/>
                                            <env key="JIRA_HOME"
                                                 value="${jira.generated.home.directory}"/>
                                        </exec>

                                        <waitfor maxwait="4" maxwaitunit="minute" checkevery="100"
                                                 timeoutproperty="startup-failed">
                                            <http url="${baseURL}"/>
                                        </waitfor>

                                    </tasks>
                                </configuration>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>johnson-standalone-jira-shutdown</id>
                                <phase>post-integration-test</phase>
                                <configuration>
                                    <tasks>
                                        <exec executable="${project.build.directory}/${appServer.install.directory}/bin/stop-jira.sh"
                                              spawn="false">
                                            <env key="JIRA_HOME"
                                                 value="${jira.generated.home.directory}"/>
                                        </exec>
                                    </tasks>
                                </configuration>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>UpgradeOnlyWarningsPluginsStartupFinished</id>
            <properties>
                <it.test>TestJohnsonFrameworkOnlyWarnings</it.test>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <configuration>
                            <skip>false</skip>
                        </configuration>
                        <executions>
                            <execution>
                                <id>integration-test</id>
                                <goals>
                                    <goal>integration-test</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>verify</id>
                                <goals>
                                    <goal>verify</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <artifactId>maven-resources-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>prepare-shared-home</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>copy-resources</goal>
                                </goals>
                                <configuration>
                                    <outputDirectory>${jira.generated.home.directory}</outputDirectory>
                                    <resources>
                                        <resource>
                                            <directory>src/test/resources/jira_home</directory>
                                            <filtering>true</filtering>
                                            <includes>
                                                <include>dbconfig.xml</include>
                                            </includes>
                                        </resource>

                                        <resource>
                                            <directory>src/test/resources/jira_home</directory>
                                            <filtering>false</filtering>
                                            <excludes>
                                                <exclude>dbconfig.xml</exclude>
                                            </excludes>
                                        </resource>

                                    </resources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>johnson-standalone-jira-setup</id>
                                <phase>pre-integration-test</phase>
                                <configuration>
                                    <tasks>
                                        <!-- Update the test.properties file to indicate we're testing a Standalone installation type -->
                                        <replace file="${webdriverTestSettings}"
                                                 token="jira.release.info = unknown"
                                                 value="jira.release.info = Standalone"/>

                                        <chmod dir="${project.build.directory}" perm="ugo+rx" includes="**/*.sh"/>

                                        <!-- JRADEV-809: From jira-application properties: Each backslash in your path must be written as a forward slash -->

                                        <!-- Need more heap and permgen space and for func tests -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/bin/setenv.sh"
                                                token='JIRA_MAX_PERM_SIZE=384m'
                                                value='JIRA_MAX_PERM_SIZE=${jira.functest.maxPermSize}'/>
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/bin/setenv.sh"
                                                token='JVM_MAXIMUM_MEMORY="768m"'
                                                value='JVM_MAXIMUM_MEMORY="${jira.functest.maxMemory}"'/>

                                        <!-- Setting jira port -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/conf/server.xml"
                                                token="Connector port=&quot;8080&quot;"
                                                value="Connector port=&quot;${appServer.port}&quot;"/>

                                        <!-- Setting shutdown port -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/conf/server.xml"
                                                token="Server port=&quot;8005&quot;"
                                                value="Server port=&quot;${appServer.shutdown.port}&quot;"/>

                                        <!-- Setting jira home -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/atlassian-jira/WEB-INF/classes/jira-application.properties"
                                                token="jira.home =" value="jira.home = ${jira.generated.home.directory}"/>

                                        <exec executable="${project.build.directory}/${appServer.install.directory}/bin/start-jira.sh"
                                              spawn="false">
                                            <env key="JAVA_OPTS"
                                                 value="-Djira.paths.set.allowed=true ${jira.user.jvmargs} -Djira.websudo.is.disabled=true -Djira.johnson.simulate.failure=PLUGINS_STARTUP_FINISHED:warning-dismissible,warning-dismissible"/>
                                            <env key="JIRA_HOME"
                                                 value="${jira.generated.home.directory}"/>
                                        </exec>

                                        <!--Since this test runs after database launch it needs more time to start up-->
                                        <waitfor maxwait="4" maxwaitunit="minute" checkevery="100"
                                                 timeoutproperty="startup-failed">
                                            <http url="${baseURL}"/>
                                        </waitfor>

                                    </tasks>
                                </configuration>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>johnson-standalone-jira-shutdown</id>
                                <phase>post-integration-test</phase>
                                <configuration>
                                    <tasks>
                                        <exec executable="${project.build.directory}/${appServer.install.directory}/bin/stop-jira.sh"
                                              spawn="false">
                                            <env key="JIRA_HOME"
                                                 value="${jira.generated.home.directory}"/>
                                        </exec>
                                    </tasks>
                                </configuration>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>UpgradeOnlyDismissibleErrorsPluginsStartupFinished</id>
            <properties>
                <it.test>TestJohnsonFrameworkOnlyDismissibleErrors</it.test>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <configuration>
                            <skip>false</skip>
                        </configuration>
                        <executions>
                            <execution>
                                <id>integration-test</id>
                                <goals>
                                    <goal>integration-test</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>verify</id>
                                <goals>
                                    <goal>verify</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <artifactId>maven-resources-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>prepare-shared-home</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>copy-resources</goal>
                                </goals>
                                <configuration>
                                    <outputDirectory>${jira.generated.home.directory}</outputDirectory>
                                    <resources>
                                        <resource>
                                            <directory>src/test/resources/jira_home</directory>
                                            <filtering>true</filtering>
                                            <includes>
                                                <include>dbconfig.xml</include>
                                            </includes>
                                        </resource>

                                        <resource>
                                            <directory>src/test/resources/jira_home</directory>
                                            <filtering>false</filtering>
                                            <excludes>
                                                <exclude>dbconfig.xml</exclude>
                                            </excludes>
                                        </resource>

                                    </resources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>johnson-standalone-jira-setup</id>
                                <phase>pre-integration-test</phase>
                                <configuration>
                                    <tasks>
                                        <!-- Update the test.properties file to indicate we're testing a Standalone installation type -->
                                        <replace file="${webdriverTestSettings}"
                                                 token="jira.release.info = unknown"
                                                 value="jira.release.info = Standalone"/>

                                        <chmod dir="${project.build.directory}" perm="ugo+rx" includes="**/*.sh"/>

                                        <!-- JRADEV-809: From jira-application properties: Each backslash in your path must be written as a forward slash -->

                                        <!-- Need more heap and permgen space and for func tests -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/bin/setenv.sh"
                                                token='JIRA_MAX_PERM_SIZE=384m'
                                                value='JIRA_MAX_PERM_SIZE=${jira.functest.maxPermSize}'/>
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/bin/setenv.sh"
                                                token='JVM_MAXIMUM_MEMORY="768m"'
                                                value='JVM_MAXIMUM_MEMORY="${jira.functest.maxMemory}"'/>

                                        <!-- Setting jira port -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/conf/server.xml"
                                                token="Connector port=&quot;8080&quot;"
                                                value="Connector port=&quot;${appServer.port}&quot;"/>

                                        <!-- Setting shutdown port -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/conf/server.xml"
                                                token="Server port=&quot;8005&quot;"
                                                value="Server port=&quot;${appServer.shutdown.port}&quot;"/>

                                        <!-- Setting jira home -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/atlassian-jira/WEB-INF/classes/jira-application.properties"
                                                token="jira.home =" value="jira.home = ${jira.generated.home.directory}"/>

                                        <exec executable="${project.build.directory}/${appServer.install.directory}/bin/start-jira.sh"
                                              spawn="false">
                                            <env key="JAVA_OPTS"
                                                 value="-Djira.paths.set.allowed=true ${jira.user.jvmargs} -Djira.websudo.is.disabled=true -Djira.johnson.simulate.failure=PLUGINS_STARTUP_FINISHED:error-dismissible,error-dismissible"/>
                                            <env key="JIRA_HOME"
                                                 value="${jira.generated.home.directory}"/>
                                        </exec>

                                        <!--Since this test runs after database launch it needs more time to start up-->
                                        <waitfor maxwait="4" maxwaitunit="minute" checkevery="100"
                                                 timeoutproperty="startup-failed">
                                            <http url="${baseURL}"/>
                                        </waitfor>

                                    </tasks>
                                </configuration>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>johnson-standalone-jira-shutdown</id>
                                <phase>post-integration-test</phase>
                                <configuration>
                                    <tasks>
                                        <exec executable="${project.build.directory}/${appServer.install.directory}/bin/stop-jira.sh"
                                              spawn="false">
                                            <env key="JIRA_HOME"
                                                 value="${jira.generated.home.directory}"/>
                                        </exec>
                                    </tasks>
                                </configuration>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>UpgradeWarningInPreDatabaseLaunchAndThenErrorInDatabaseConfigured</id>
            <properties>
                <it.test>TestJohnsonFrameworkWarningAndThenInALaterPhaseError</it.test>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <configuration>
                            <skip>false</skip>
                        </configuration>
                        <executions>
                            <execution>
                                <id>integration-test</id>
                                <goals>
                                    <goal>integration-test</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>verify</id>
                                <goals>
                                    <goal>verify</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <artifactId>maven-resources-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>prepare-shared-home</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>copy-resources</goal>
                                </goals>
                                <configuration>
                                    <outputDirectory>${jira.generated.home.directory}</outputDirectory>
                                    <resources>
                                        <resource>
                                            <directory>src/test/resources/jira_home</directory>
                                            <filtering>true</filtering>
                                            <includes>
                                                <include>dbconfig.xml</include>
                                            </includes>
                                        </resource>

                                        <resource>
                                            <directory>src/test/resources/jira_home</directory>
                                            <filtering>false</filtering>
                                            <excludes>
                                                <exclude>dbconfig.xml</exclude>
                                            </excludes>
                                        </resource>
                                    </resources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>johnson-standalone-jira-setup</id>
                                <phase>pre-integration-test</phase>
                                <configuration>
                                    <tasks>
                                        <!-- Update the test.properties file to indicate we're testing a Standalone installation type -->
                                        <replace file="${webdriverTestSettings}"
                                                 token="jira.release.info = unknown"
                                                 value="jira.release.info = Standalone"/>

                                        <chmod dir="${project.build.directory}" perm="ugo+rx" includes="**/*.sh"/>

                                        <!-- JRADEV-809: From jira-application properties: Each backslash in your path must be written as a forward slash -->

                                        <!-- Need more heap and permgen space and for func tests -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/bin/setenv.sh"
                                                token='JIRA_MAX_PERM_SIZE=384m'
                                                value='JIRA_MAX_PERM_SIZE=${jira.functest.maxPermSize}'/>
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/bin/setenv.sh"
                                                token='JVM_MAXIMUM_MEMORY="768m"'
                                                value='JVM_MAXIMUM_MEMORY="${jira.functest.maxMemory}"'/>

                                        <!-- Setting jira port -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/conf/server.xml"
                                                token="Connector port=&quot;8080&quot;"
                                                value="Connector port=&quot;${appServer.port}&quot;"/>

                                        <!-- Setting shutdown port -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/conf/server.xml"
                                                token="Server port=&quot;8005&quot;"
                                                value="Server port=&quot;${appServer.shutdown.port}&quot;"/>

                                        <!-- Setting jira home -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/atlassian-jira/WEB-INF/classes/jira-application.properties"
                                                token="jira.home =" value="jira.home = ${jira.generated.home.directory}"/>

                                        <exec executable="${project.build.directory}/${appServer.install.directory}/bin/start-jira.sh"
                                              spawn="false">
                                            <env key="JAVA_OPTS"
                                                 value="-Djira.paths.set.allowed=true ${jira.user.jvmargs} -Djira.websudo.is.disabled=true -Djira.johnson.simulate.failure=PRE_DATABASE_LAUNCH:warning-dismissible\;DATABASE_CONFIGURED:error"/>
                                            <env key="JIRA_HOME"
                                                 value="${jira.generated.home.directory}"/>
                                        </exec>

                                        <waitfor maxwait="4" maxwaitunit="minute" checkevery="100"
                                                 timeoutproperty="startup-failed">
                                            <http url="${baseURL}"/>
                                        </waitfor>

                                    </tasks>
                                </configuration>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>johnson-standalone-jira-shutdown</id>
                                <phase>post-integration-test</phase>
                                <configuration>
                                    <tasks>
                                        <exec executable="${project.build.directory}/${appServer.install.directory}/bin/stop-jira.sh"
                                              spawn="false">
                                            <env key="JIRA_HOME"
                                                 value="${jira.generated.home.directory}"/>
                                        </exec>
                                    </tasks>
                                </configuration>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <!-- These profiles set up JIRA in such a way that it starts up without needing to upgrade it's data to a new version -->
        <profile>
            <id>PreUpgradedMultipleErrorsPresentPreDatabase</id>
            <properties>
                <it.test>TestJohnsonFrameworkSeveralErrors</it.test>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <configuration>
                            <skip>false</skip>
                        </configuration>
                        <executions>
                            <execution>
                                <id>integration-test</id>
                                <goals>
                                    <goal>integration-test</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>verify</id>
                                <goals>
                                    <goal>verify</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <artifactId>maven-resources-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>prepare-shared-home</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>copy-resources</goal>
                                </goals>
                                <configuration>
                                    <outputDirectory>${jira.generated.home.directory}</outputDirectory>
                                    <resources>
                                        <resource>
                                            <directory>src/test/resources/jira_home</directory>
                                            <filtering>true</filtering>
                                            <includes>
                                                <include>dbconfig.xml</include>
                                            </includes>
                                        </resource>

                                        <resource>
                                            <directory>src/test/resources/jira_home</directory>
                                            <filtering>false</filtering>
                                            <excludes>
                                                <exclude>dbconfig.xml</exclude>
                                            </excludes>
                                        </resource>

                                    </resources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>johnson-standalone-jira-setup</id>
                                <phase>pre-integration-test</phase>
                                <configuration>
                                    <tasks>
                                        <!-- Update the test.properties file to indicate we're testing a Standalone installation type -->
                                        <replace file="${webdriverTestSettings}"
                                                 token="jira.release.info = unknown"
                                                 value="jira.release.info = Standalone"/>

                                        <chmod dir="${project.build.directory}" perm="ugo+rx" includes="**/*.sh"/>

                                        <!-- JRADEV-809: From jira-application properties: Each backslash in your path must be written as a forward slash -->

                                        <!-- Need more heap and permgen space and for func tests -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/bin/setenv.sh"
                                                token='JIRA_MAX_PERM_SIZE=384m'
                                                value='JIRA_MAX_PERM_SIZE=${jira.functest.maxPermSize}'/>
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/bin/setenv.sh"
                                                token='JVM_MAXIMUM_MEMORY="768m"'
                                                value='JVM_MAXIMUM_MEMORY="${jira.functest.maxMemory}"'/>

                                        <!-- Setting jira port -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/conf/server.xml"
                                                token="Connector port=&quot;8080&quot;"
                                                value="Connector port=&quot;${appServer.port}&quot;"/>

                                        <!-- Setting shutdown port -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/conf/server.xml"
                                                token="Server port=&quot;8005&quot;"
                                                value="Server port=&quot;${appServer.shutdown.port}&quot;"/>

                                        <!-- Setting jira home -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/atlassian-jira/WEB-INF/classes/jira-application.properties"
                                                token="jira.home =" value="jira.home = ${jira.generated.home.directory}"/>

                                        <exec executable="${project.build.directory}/${appServer.install.directory}/bin/start-jira.sh"
                                              spawn="true">
                                            <env key="JAVA_OPTS"
                                                 value="-Djira.paths.set.allowed=true ${jira.user.jvmargs} -Djira.websudo.is.disabled=true -Djira.johnson.simulate.failure=PRE_DATABASE_LAUNCH:error,error"/>
                                            <env key="JIRA_HOME"
                                                 value="${jira.generated.home.directory}"/>
                                        </exec>

                                        <!--JIRA should fail fast -->
                                        <waitfor maxwait="1" maxwaitunit="minute" checkevery="100"
                                                 timeoutproperty="startup-failed">
                                            <http url="${baseURL}"/>
                                        </waitfor>
                                    </tasks>
                                </configuration>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>johnson-standalone-jira-shutdown</id>
                                <phase>post-integration-test</phase>
                                <configuration>
                                    <tasks>
                                        <exec executable="${project.build.directory}/${appServer.install.directory}/bin/stop-jira.sh"
                                              spawn="false">
                                        </exec>
                                    </tasks>
                                </configuration>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>PreupgradedErrorAndWarningPreDatabaseLaunch</id>
            <properties>
                <it.test>TestJohnsonFrameworkErrorAndWarning</it.test>
            </properties>
            <build>
                <plugins>

                    <plugin>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <configuration>
                            <skip>false</skip>
                        </configuration>
                        <executions>
                            <execution>
                                <id>integration-test</id>
                                <goals>
                                    <goal>integration-test</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>verify</id>
                                <goals>
                                    <goal>verify</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <artifactId>maven-resources-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>prepare-shared-home</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>copy-resources</goal>
                                </goals>
                                <configuration>
                                    <outputDirectory>${jira.generated.home.directory}</outputDirectory>
                                    <resources>
                                        <resource>
                                            <directory>src/test/resources/jira_home</directory>
                                            <filtering>true</filtering>
                                            <includes>
                                                <include>dbconfig.xml</include>
                                            </includes>
                                        </resource>

                                        <resource>
                                            <directory>src/test/resources/jira_home</directory>
                                            <filtering>false</filtering>
                                            <excludes>
                                                <exclude>dbconfig.xml</exclude>
                                            </excludes>
                                        </resource>

                                    </resources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>johnson-standalone-jira-setup</id>
                                <phase>pre-integration-test</phase>
                                <configuration>
                                    <tasks>
                                        <!-- Update the test.properties file to indicate we're testing a Standalone installation type -->
                                        <replace file="${webdriverTestSettings}"
                                                 token="jira.release.info = unknown"
                                                 value="jira.release.info = Standalone"/>

                                        <chmod dir="${project.build.directory}" perm="ugo+rx" includes="**/*.sh"/>

                                        <!-- JRADEV-809: From jira-application properties: Each backslash in your path must be written as a forward slash -->

                                        <!-- Need more heap and permgen space and for func tests -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/bin/setenv.sh"
                                                token='JIRA_MAX_PERM_SIZE=384m'
                                                value='JIRA_MAX_PERM_SIZE=${jira.functest.maxPermSize}'/>
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/bin/setenv.sh"
                                                token='JVM_MAXIMUM_MEMORY="768m"'
                                                value='JVM_MAXIMUM_MEMORY="${jira.functest.maxMemory}"'/>

                                        <!-- Setting jira port -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/conf/server.xml"
                                                token="Connector port=&quot;8080&quot;"
                                                value="Connector port=&quot;${appServer.port}&quot;"/>

                                        <!-- Setting shutdown port -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/conf/server.xml"
                                                token="Server port=&quot;8005&quot;"
                                                value="Server port=&quot;${appServer.shutdown.port}&quot;"/>

                                        <!-- Setting jira home -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/atlassian-jira/WEB-INF/classes/jira-application.properties"
                                                token="jira.home =" value="jira.home = ${jira.generated.home.directory}"/>

                                        <!--Since we're firing ths error in the pre-database-launch phase, when jira has not yet connected to the database, a
                                        nd has no idea that it's not upgraded, it's not necessary to upgrade the data to simulate a failure in this phase in the pre-upgraded scenario -->
                                        <exec executable="${project.build.directory}/${appServer.install.directory}/bin/start-jira.sh"
                                              spawn="true">
                                            <env key="JAVA_OPTS"
                                                 value="-Djira.paths.set.allowed=true ${jira.user.jvmargs} -Djira.websudo.is.disabled=true -Djira.johnson.simulate.failure=PRE_DATABASE_LAUNCH:warning-dismissible,error"/>
                                            <env key="JIRA_HOME"
                                                 value="${jira.generated.home.directory}"/>
                                        </exec>

                                        <waitfor maxwait="1" maxwaitunit="minute" checkevery="60"
                                                 timeoutproperty="startup-failed">
                                            <http url="${baseURL}"/>
                                        </waitfor>

                                    </tasks>
                                </configuration>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>johnson-standalone-jira-shutdown</id>
                                <phase>post-integration-test</phase>
                                <configuration>
                                    <tasks>
                                        <exec executable="${project.build.directory}/${appServer.install.directory}/bin/stop-jira.sh"
                                              spawn="false">
                                        </exec>
                                    </tasks>
                                </configuration>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>PreupgradedMultipleErrorsDatabaseConfigured</id>
            <properties>
                <it.test>TestJohnsonFrameworkErrorAndWarning</it.test>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <configuration>
                            <skip>false</skip>
                        </configuration>
                        <executions>
                            <execution>
                                <id>integration-test</id>
                                <goals>
                                    <goal>integration-test</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>verify</id>
                                <goals>
                                    <goal>verify</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <artifactId>maven-resources-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>prepare-shared-home</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>copy-resources</goal>
                                </goals>
                                <configuration>
                                    <outputDirectory>${jira.generated.home.directory}</outputDirectory>
                                    <resources>
                                        <resource>
                                            <directory>src/test/resources/jira_home</directory>
                                            <filtering>true</filtering>
                                            <includes>
                                                <include>dbconfig.xml</include>
                                            </includes>
                                        </resource>

                                        <resource>
                                            <directory>src/test/resources/jira_home</directory>
                                            <filtering>false</filtering>
                                            <excludes>
                                                <exclude>dbconfig.xml</exclude>
                                            </excludes>
                                        </resource>

                                    </resources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>johnson-standalone-jira-setup</id>
                                <phase>pre-integration-test</phase>
                                <configuration>
                                    <tasks>
                                        <!-- Update the test.properties file to indicate we're testing a Standalone installation type -->
                                        <replace file="${webdriverTestSettings}"
                                                 token="jira.release.info = unknown"
                                                 value="jira.release.info = Standalone"/>

                                        <chmod dir="${project.build.directory}" perm="ugo+rx" includes="**/*.sh"/>

                                        <!-- JRADEV-809: From jira-application properties: Each backslash in your path must be written as a forward slash -->

                                        <!-- Need more heap and permgen space and for func tests -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/bin/setenv.sh"
                                                token='JIRA_MAX_PERM_SIZE=384m'
                                                value='JIRA_MAX_PERM_SIZE=${jira.functest.maxPermSize}'/>
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/bin/setenv.sh"
                                                token='JVM_MAXIMUM_MEMORY="768m"'
                                                value='JVM_MAXIMUM_MEMORY="${jira.functest.maxMemory}"'/>

                                        <!-- Setting jira port -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/conf/server.xml"
                                                token="Connector port=&quot;8080&quot;"
                                                value="Connector port=&quot;${appServer.port}&quot;"/>

                                        <!-- Setting shutdown port -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/conf/server.xml"
                                                token="Server port=&quot;8005&quot;"
                                                value="Server port=&quot;${appServer.shutdown.port}&quot;"/>

                                        <!-- Setting jira home -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/atlassian-jira/WEB-INF/classes/jira-application.properties"
                                                token="jira.home =" value="jira.home = ${jira.generated.home.directory}"/>

                                        <exec executable="${project.build.directory}/${appServer.install.directory}/bin/start-jira.sh"
                                              spawn="false">
                                            <env key="JAVA_OPTS"
                                                 value="-Djira.paths.set.allowed=true ${jira.user.jvmargs} -Djira.websudo.is.disabled=true"/>
                                            <env key="JIRA_HOME"
                                                 value="${jira.generated.home.directory}"/>
                                        </exec>

                                        <!--Shutdown and upgrade -->
                                        <waitfor maxwait="4" maxwaitunit="minute" checkevery="100"
                                                 timeoutproperty="startup-failed">
                                            <http url="${baseURL}"/>
                                        </waitfor>

                                        <exec executable="${project.build.directory}/${appServer.install.directory}/bin/stop-jira.sh"
                                              spawn="false">
                                            <env key="JIRA_HOME"
                                                 value="${jira.generated.home.directory}"/>
                                        </exec>

                                        <exec executable="${project.build.directory}/${appServer.install.directory}/bin/start-jira.sh"
                                              spawn="false">
                                            <env key="JAVA_OPTS"
                                                 value="-Djira.paths.set.allowed=true ${jira.user.jvmargs} -Djira.websudo.is.disabled=true -Djira.johnson.simulate.failure=DATABASE_CONFIGURED:warning-dismissible,error"/>
                                            <env key="JIRA_HOME"
                                                 value="${jira.generated.home.directory}"/>
                                        </exec>

                                        <waitfor maxwait="2" maxwaitunit="minute" checkevery="100"
                                                 timeoutproperty="startup-failed">
                                            <http url="${baseURL}"/>
                                        </waitfor>
                                    </tasks>
                                </configuration>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>johnson-standalone-jira-shutdown</id>
                                <phase>post-integration-test</phase>
                                <configuration>
                                    <tasks>
                                        <exec executable="${project.build.directory}/${appServer.install.directory}/bin/stop-jira.sh"
                                              spawn="false">
                                            <env key="JIRA_HOME"
                                                 value="${jira.generated.home.directory}"/>
                                        </exec>
                                    </tasks>
                                </configuration>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>PreupgradedNoErrorsDatabaseConfigured</id>
            <properties>
                <it.test>TestJohnsonFrameworkNoErrorNormalOperation</it.test>
            </properties>
            <build>
                <plugins>

                    <plugin>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <configuration>
                            <skip>false</skip>
                        </configuration>
                        <executions>
                            <execution>
                                <id>integration-test</id>
                                <goals>
                                    <goal>integration-test</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>verify</id>
                                <goals>
                                    <goal>verify</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <artifactId>maven-resources-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>prepare-shared-home</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>copy-resources</goal>
                                </goals>
                                <configuration>
                                    <outputDirectory>${jira.generated.home.directory}</outputDirectory>
                                    <resources>
                                        <resource>
                                            <directory>src/test/resources/jira_home</directory>
                                            <filtering>true</filtering>
                                            <includes>
                                                <include>dbconfig.xml</include>
                                            </includes>
                                        </resource>

                                        <resource>
                                            <directory>src/test/resources/jira_home</directory>
                                            <filtering>false</filtering>
                                            <excludes>
                                                <exclude>dbconfig.xml</exclude>
                                            </excludes>
                                        </resource>

                                    </resources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>johnson-standalone-jira-setup</id>
                                <phase>pre-integration-test</phase>
                                <configuration>
                                    <tasks>
                                        <!-- Update the test.properties file to indicate we're testing a Standalone installation type -->
                                        <replace file="${webdriverTestSettings}"
                                                 token="jira.release.info = unknown"
                                                 value="jira.release.info = Standalone"/>

                                        <chmod dir="${project.build.directory}" perm="ugo+rx" includes="**/*.sh"/>

                                        <!-- JRADEV-809: From jira-application properties: Each backslash in your path must be written as a forward slash -->

                                        <!-- Need more heap and permgen space and for func tests -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/bin/setenv.sh"
                                                token='JIRA_MAX_PERM_SIZE=384m'
                                                value='JIRA_MAX_PERM_SIZE=${jira.functest.maxPermSize}'/>
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/bin/setenv.sh"
                                                token='JVM_MAXIMUM_MEMORY="768m"'
                                                value='JVM_MAXIMUM_MEMORY="${jira.functest.maxMemory}"'/>

                                        <!-- Setting jira port -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/conf/server.xml"
                                                token="Connector port=&quot;8080&quot;"
                                                value="Connector port=&quot;${appServer.port}&quot;"/>

                                        <!-- Setting shutdown port -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/conf/server.xml"
                                                token="Server port=&quot;8005&quot;"
                                                value="Server port=&quot;${appServer.shutdown.port}&quot;"/>

                                        <!-- Setting jira home -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/atlassian-jira/WEB-INF/classes/jira-application.properties"
                                                token="jira.home =" value="jira.home = ${jira.generated.home.directory}"/>

                                        <exec executable="${project.build.directory}/${appServer.install.directory}/bin/start-jira.sh"
                                              spawn="false">
                                            <env key="JAVA_OPTS"
                                                 value="-Djira.paths.set.allowed=true ${jira.user.jvmargs} -Djira.websudo.is.disabled=true"/>
                                            <env key="JIRA_HOME"
                                                 value="${jira.generated.home.directory}"/>
                                        </exec>

                                        <!--Shutdown and upgrade -->
                                        <waitfor maxwait="4" maxwaitunit="minute" checkevery="100"
                                                 timeoutproperty="startup-failed">
                                            <http url="${baseURL}"/>
                                        </waitfor>

                                        <exec executable="${project.build.directory}/${appServer.install.directory}/bin/stop-jira.sh"
                                              spawn="false">
                                            <env key="JIRA_HOME"
                                                 value="${jira.generated.home.directory}"/>
                                        </exec>

                                        <exec executable="${project.build.directory}/${appServer.install.directory}/bin/start-jira.sh"
                                              spawn="false">
                                            <env key="JAVA_OPTS"
                                                 value="-Djira.paths.set.allowed=true ${jira.user.jvmargs} -Djira.websudo.is.disabled=true -Djira.johnson.simulate.failure=DATABASE_CONFIGURED:warning-dismissible"/>
                                            <env key="JIRA_HOME"
                                                 value="${jira.generated.home.directory}"/>
                                        </exec>

                                        <waitfor maxwait="2" maxwaitunit="minute" checkevery="100"
                                                 timeoutproperty="startup-failed">
                                            <http url="${baseURL}"/>
                                        </waitfor>
                                    </tasks>
                                </configuration>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>johnson-standalone-jira-shutdown</id>
                                <phase>post-integration-test</phase>
                                <configuration>
                                    <tasks>
                                        <exec executable="${project.build.directory}/${appServer.install.directory}/bin/stop-jira.sh"
                                              spawn="false">
                                            <env key="JIRA_HOME"
                                                 value="${jira.generated.home.directory}"/>
                                        </exec>
                                    </tasks>
                                </configuration>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>PreupgradedErrorAndWarningDatabaseConfigured</id>
            <properties>
                <it.test>TestJohnsonFrameworkErrorAndWarning</it.test>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <configuration>
                            <skip>false</skip>
                        </configuration>
                        <executions>
                            <execution>
                                <id>integration-test</id>
                                <goals>
                                    <goal>integration-test</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>verify</id>
                                <goals>
                                    <goal>verify</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <artifactId>maven-resources-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>prepare-shared-home</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>copy-resources</goal>
                                </goals>
                                <configuration>
                                    <outputDirectory>${jira.generated.home.directory}</outputDirectory>
                                    <resources>
                                        <resource>
                                            <directory>src/test/resources/jira_home</directory>
                                            <filtering>true</filtering>
                                            <includes>
                                                <include>dbconfig.xml</include>
                                            </includes>
                                        </resource>

                                        <resource>
                                            <directory>src/test/resources/jira_home</directory>
                                            <filtering>false</filtering>
                                            <excludes>
                                                <exclude>dbconfig.xml</exclude>
                                            </excludes>
                                        </resource>

                                    </resources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>johnson-standalone-jira-setup</id>
                                <phase>pre-integration-test</phase>
                                <configuration>
                                    <tasks>
                                        <!-- Update the test.properties file to indicate we're testing a Standalone installation type -->
                                        <replace file="${webdriverTestSettings}"
                                                 token="jira.release.info = unknown"
                                                 value="jira.release.info = Standalone"/>

                                        <chmod dir="${project.build.directory}" perm="ugo+rx" includes="**/*.sh"/>

                                        <!-- JRADEV-809: From jira-application properties: Each backslash in your path must be written as a forward slash -->

                                        <!-- Need more heap and permgen space and for func tests -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/bin/setenv.sh"
                                                token='JIRA_MAX_PERM_SIZE=384m'
                                                value='JIRA_MAX_PERM_SIZE=${jira.functest.maxPermSize}'/>
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/bin/setenv.sh"
                                                token='JVM_MAXIMUM_MEMORY="768m"'
                                                value='JVM_MAXIMUM_MEMORY="${jira.functest.maxMemory}"'/>

                                        <!-- Setting jira port -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/conf/server.xml"
                                                token="Connector port=&quot;8080&quot;"
                                                value="Connector port=&quot;${appServer.port}&quot;"/>

                                        <!-- Setting shutdown port -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/conf/server.xml"
                                                token="Server port=&quot;8005&quot;"
                                                value="Server port=&quot;${appServer.shutdown.port}&quot;"/>

                                        <!-- Setting jira home -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/atlassian-jira/WEB-INF/classes/jira-application.properties"
                                                token="jira.home =" value="jira.home = ${jira.generated.home.directory}"/>

                                        <exec executable="${project.build.directory}/${appServer.install.directory}/bin/start-jira.sh"
                                              spawn="false">
                                            <env key="JAVA_OPTS"
                                                 value="-Djira.paths.set.allowed=true ${jira.user.jvmargs} -Djira.websudo.is.disabled=true"/>
                                            <env key="JIRA_HOME"
                                                 value="${jira.generated.home.directory}"/>
                                        </exec>

                                        <!--Shutdown and upgrade -->
                                        <waitfor maxwait="4" maxwaitunit="minute" checkevery="100"
                                                 timeoutproperty="startup-failed">
                                            <http url="${baseURL}"/>
                                        </waitfor>

                                        <exec executable="${project.build.directory}/${appServer.install.directory}/bin/stop-jira.sh"
                                              spawn="false">
                                        <env key="JIRA_HOME"
                                             value="${jira.generated.home.directory}"/>
                                        </exec>

                                        <exec executable="${project.build.directory}/${appServer.install.directory}/bin/start-jira.sh"
                                              spawn="false">
                                            <env key="JAVA_OPTS"
                                                 value="-Djira.paths.set.allowed=true ${jira.user.jvmargs} -Djira.websudo.is.disabled=true -Djira.johnson.simulate.failure=DATABASE_CONFIGURED:warning-dismissible,error"/>
                                            <env key="JIRA_HOME"
                                                 value="${jira.generated.home.directory}"/>
                                        </exec>

                                        <waitfor maxwait="2" maxwaitunit="minute" checkevery="100"
                                                 timeoutproperty="startup-failed">
                                            <http url="${baseURL}"/>
                                        </waitfor>
                                    </tasks>
                                </configuration>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>johnson-standalone-jira-shutdown</id>
                                <phase>post-integration-test</phase>
                                <configuration>
                                    <tasks>
                                        <exec executable="${project.build.directory}/${appServer.install.directory}/bin/stop-jira.sh"
                                              spawn="false">
                                            <env key="JIRA_HOME"
                                                 value="${jira.generated.home.directory}"/>
                                        </exec>
                                    </tasks>
                                </configuration>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>PreupgradedWarningInPreDatabaseLaunchAndThenErrorInDatabaseConfigured</id>
            <properties>
                <it.test>TestJohnsonFrameworkWarningAndThenInALaterPhaseError</it.test>
            </properties>
            <build>
                <plugins>

                    <plugin>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <configuration>
                            <skip>false</skip>
                        </configuration>
                        <executions>
                            <execution>
                                <id>integration-test</id>
                                <goals>
                                    <goal>integration-test</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>verify</id>
                                <goals>
                                    <goal>verify</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <artifactId>maven-resources-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>prepare-shared-home</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>copy-resources</goal>
                                </goals>
                                <configuration>
                                    <outputDirectory>${jira.generated.home.directory}</outputDirectory>
                                    <resources>
                                        <resource>
                                            <directory>src/test/resources/jira_home</directory>
                                            <filtering>true</filtering>
                                            <includes>
                                                <include>dbconfig.xml</include>
                                            </includes>
                                        </resource>

                                        <resource>
                                            <directory>src/test/resources/jira_home</directory>
                                            <filtering>false</filtering>
                                            <excludes>
                                                <exclude>dbconfig.xml</exclude>
                                            </excludes>
                                        </resource>

                                    </resources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>johnson-standalone-jira-setup</id>
                                <phase>pre-integration-test</phase>
                                <configuration>
                                    <tasks>
                                        <!-- Update the test.properties file to indicate we're testing a Standalone installation type -->
                                        <replace file="${webdriverTestSettings}"
                                                 token="jira.release.info = unknown"
                                                 value="jira.release.info = Standalone"/>


                                        <chmod dir="${project.build.directory}" perm="ugo+rx" includes="**/*.sh"/>

                                        <!-- JRADEV-809: From jira-application properties: Each backslash in your path must be written as a forward slash -->

                                        <!-- Need more heap and permgen space and for func tests -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/bin/setenv.sh"
                                                token='JIRA_MAX_PERM_SIZE=384m'
                                                value='JIRA_MAX_PERM_SIZE=${jira.functest.maxPermSize}'/>
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/bin/setenv.sh"
                                                token='JVM_MAXIMUM_MEMORY="768m"'
                                                value='JVM_MAXIMUM_MEMORY="${jira.functest.maxMemory}"'/>

                                        <!-- Setting jira port -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/conf/server.xml"
                                                token="Connector port=&quot;8080&quot;"
                                                value="Connector port=&quot;${appServer.port}&quot;"/>

                                        <!-- Setting shutdown port -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/conf/server.xml"
                                                token="Server port=&quot;8005&quot;"
                                                value="Server port=&quot;${appServer.shutdown.port}&quot;"/>

                                        <!-- Setting jira home -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/atlassian-jira/WEB-INF/classes/jira-application.properties"
                                                token="jira.home =" value="jira.home = ${jira.generated.home.directory}"/>

                                        <exec executable="${project.build.directory}/${appServer.install.directory}/bin/start-jira.sh"
                                              spawn="false">
                                            <env key="JAVA_OPTS"
                                                 value="-Djira.paths.set.allowed=true ${jira.user.jvmargs} -Djira.websudo.is.disabled=true"/>
                                            <env key="JIRA_HOME"
                                                 value="${jira.generated.home.directory}"/>
                                        </exec>

                                        <waitfor maxwait="4" maxwaitunit="minute" checkevery="100"
                                                 timeoutproperty="startup-failed">
                                            <http url="${baseURL}"/>
                                        </waitfor>

                                        <exec executable="${project.build.directory}/${appServer.install.directory}/bin/stop-jira.sh"
                                              spawn="false">
                                            <env key="JIRA_HOME"
                                                 value="${jira.generated.home.directory}"/>
                                        </exec>

                                        <exec executable="${project.build.directory}/${appServer.install.directory}/bin/start-jira.sh"
                                              spawn="false">
                                            <env key="JAVA_OPTS"
                                                 value="-Djira.paths.set.allowed=true ${jira.user.jvmargs} -Djira.websudo.is.disabled=true -Djira.johnson.simulate.failure=PRE_DATABASE_LAUNCH:warning-dismissible\;DATABASE_CONFIGURED:error"/>
                                            <env key="JIRA_HOME"
                                                 value="${jira.generated.home.directory}"/>
                                        </exec>

                                        <waitfor maxwait="4" maxwaitunit="minute" checkevery="100"
                                                 timeoutproperty="startup-failed">
                                            <http url="${baseURL}"/>
                                        </waitfor>

                                    </tasks>
                                </configuration>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>johnson-standalone-jira-shutdown</id>
                                <phase>post-integration-test</phase>
                                <configuration>
                                    <tasks>
                                        <exec executable="${project.build.directory}/${appServer.install.directory}/bin/stop-jira.sh"
                                              spawn="false">
                                            <env key="JIRA_HOME"
                                                 value="${jira.generated.home.directory}"/>
                                        </exec>
                                    </tasks>
                                </configuration>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <!-- These profiles set up JIRA in such a way that it has an empty home directory and needs to be set up -->

        <profile>
            <id>NewInstallationPreDatabaseLaunchWarningsOnly</id>
            <properties>
                <it.test>TestJohnsonFrameworkNoWarningsOnStartup</it.test>
                <jira.home.directory>${jira.empty.home.directory}</jira.home.directory>
            </properties>
            <build>
                <plugins>

                    <plugin>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <configuration>
                            <skip>false</skip>
                        </configuration>
                        <executions>
                            <execution>
                                <id>integration-test</id>
                                <goals>
                                    <goal>integration-test</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>verify</id>
                                <goals>
                                    <goal>verify</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>johnson-standalone-jira-setup</id>
                                <phase>pre-integration-test</phase>
                                <configuration>
                                    <tasks>
                                        <mkdir dir="${jira.home.directory}"/>
                                        <!-- Update the test.properties file to indicate we're testing a Standalone installation type -->
                                        <replace file="${webdriverTestSettings}"
                                                 token="jira.release.info = unknown"
                                                 value="jira.release.info = Standalone"/>

                                        <chmod dir="${project.build.directory}" perm="ugo+rx" includes="**/*.sh"/>

                                        <!-- JRADEV-809: From jira-application properties: Each backslash in your path must be written as a forward slash -->

                                        <!-- Need more heap and permgen space and for func tests -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/bin/setenv.sh"
                                                token='JIRA_MAX_PERM_SIZE=384m'
                                                value='JIRA_MAX_PERM_SIZE=${jira.functest.maxPermSize}'/>
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/bin/setenv.sh"
                                                token='JVM_MAXIMUM_MEMORY="768m"'
                                                value='JVM_MAXIMUM_MEMORY="${jira.functest.maxMemory}"'/>

                                        <!-- Setting jira port -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/conf/server.xml"
                                                token="Connector port=&quot;8080&quot;"
                                                value="Connector port=&quot;${appServer.port}&quot;"/>

                                        <!-- Setting shutdown port -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/conf/server.xml"
                                                token="Server port=&quot;8005&quot;"
                                                value="Server port=&quot;${appServer.shutdown.port}&quot;"/>

                                        <!-- Setting jira home -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/atlassian-jira/WEB-INF/classes/jira-application.properties"
                                                token="jira.home =" value="jira.home = ${jira.home.directory}"/>


                                        <exec executable="${project.build.directory}/${appServer.install.directory}/bin/start-jira.sh"
                                              spawn="false">
                                            <env key="JAVA_OPTS"
                                                 value="-Djira.paths.set.allowed=true ${jira.user.jvmargs} -Djira.websudo.is.disabled=true -Djira.johnson.simulate.failure=PRE_DATABASE_LAUNCH:warning-dismissible"/>
                                            <env key="JIRA_HOME"
                                                 value="${jira.home.directory}"/>
                                        </exec>

                                        <waitfor maxwait="2" maxwaitunit="minute" checkevery="100"
                                                 timeoutproperty="startup-failed">
                                            <http url="${baseURL}/secure/SetupMode!default.jspa"/>
                                        </waitfor>


                                    </tasks>
                                </configuration>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>johnson-standalone-jira-shutdown</id>
                                <phase>post-integration-test</phase>
                                <configuration>
                                    <tasks>
                                        <exec executable="${project.build.directory}/${appServer.install.directory}/bin/stop-jira.sh"
                                              spawn="false">
                                            <env key="JIRA_HOME"
                                                 value="${jira.home.directory}"/>
                                        </exec>
                                    </tasks>
                                </configuration>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>NewInstallationPreDatabaseLaunchDismissibleErrorsOnly</id>
            <properties>
                <it.test>TestJohnsonFrameworkNoDismissibleErrorsOnStartup</it.test>
                <jira.home.directory>${jira.empty.home.directory}</jira.home.directory>
            </properties>
            <build>
                <plugins>

                    <plugin>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <configuration>
                            <skip>false</skip>
                        </configuration>
                        <executions>
                            <execution>
                                <id>integration-test</id>
                                <goals>
                                    <goal>integration-test</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>verify</id>
                                <goals>
                                    <goal>verify</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>johnson-standalone-jira-setup</id>
                                <phase>pre-integration-test</phase>
                                <configuration>
                                    <tasks>
                                        <mkdir dir="${jira.home.directory}"/>
                                        <!-- Update the test.properties file to indicate we're testing a Standalone installation type -->
                                        <replace file="${webdriverTestSettings}"
                                                 token="jira.release.info = unknown"
                                                 value="jira.release.info = Standalone"/>

                                        <chmod dir="${project.build.directory}" perm="ugo+rx" includes="**/*.sh"/>

                                        <!-- JRADEV-809: From jira-application properties: Each backslash in your path must be written as a forward slash -->

                                        <!-- Need more heap and permgen space and for func tests -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/bin/setenv.sh"
                                                token='JIRA_MAX_PERM_SIZE=384m'
                                                value='JIRA_MAX_PERM_SIZE=${jira.functest.maxPermSize}'/>
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/bin/setenv.sh"
                                                token='JVM_MAXIMUM_MEMORY="768m"'
                                                value='JVM_MAXIMUM_MEMORY="${jira.functest.maxMemory}"'/>

                                        <!-- Setting jira port -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/conf/server.xml"
                                                token="Connector port=&quot;8080&quot;"
                                                value="Connector port=&quot;${appServer.port}&quot;"/>

                                        <!-- Setting shutdown port -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/conf/server.xml"
                                                token="Server port=&quot;8005&quot;"
                                                value="Server port=&quot;${appServer.shutdown.port}&quot;"/>

                                        <!-- Setting jira home -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/atlassian-jira/WEB-INF/classes/jira-application.properties"
                                                token="jira.home =" value="jira.home = ${jira.home.directory}"/>


                                        <exec executable="${project.build.directory}/${appServer.install.directory}/bin/start-jira.sh"
                                              spawn="false">
                                            <env key="JAVA_OPTS"
                                                 value="-Djira.paths.set.allowed=true ${jira.user.jvmargs} -Djira.websudo.is.disabled=true -Djira.johnson.simulate.failure=PRE_DATABASE_LAUNCH:error-dismissible"/>
                                            <env key="JIRA_HOME"
                                                 value="${jira.home.directory}"/>
                                        </exec>

                                        <waitfor maxwait="2" maxwaitunit="minute" checkevery="100"
                                                 timeoutproperty="startup-failed">
                                            <http url="${baseURL}/secure/SetupMode!default.jspa"/>
                                        </waitfor>


                                    </tasks>
                                </configuration>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>johnson-standalone-jira-shutdown</id>
                                <phase>post-integration-test</phase>
                                <configuration>
                                    <tasks>
                                        <exec executable="${project.build.directory}/${appServer.install.directory}/bin/stop-jira.sh"
                                              spawn="false">
                                            <env key="JIRA_HOME"
                                                 value="${jira.home.directory}"/>
                                        </exec>
                                    </tasks>
                                </configuration>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>NewInstallationPreDatabaseLaunchMultipleErrors</id>
            <properties>
                <it.test>TestJohnsonFrameworkSeveralErrors</it.test>
                <jira.home>${jira.home.directory}</jira.home>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <configuration>
                            <skip>false</skip>
                        </configuration>
                        <executions>
                            <execution>
                                <id>integration-test</id>
                                <goals>
                                    <goal>integration-test</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>verify</id>
                                <goals>
                                    <goal>verify</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>johnson-standalone-jira-setup</id>
                                <phase>pre-integration-test</phase>
                                <configuration>
                                    <tasks>
                                        <mkdir dir="${jira.home.directory}"/>
                                        <!-- Update the test.properties file to indicate we're testing a Standalone installation type -->
                                        <replace file="${webdriverTestSettings}"
                                                 token="jira.release.info = unknown"
                                                 value="jira.release.info = Standalone"/>


                                        <chmod dir="${project.build.directory}" perm="ugo+rx" includes="**/*.sh"/>

                                        <!-- JRADEV-809: From jira-application properties: Each backslash in your path must be written as a forward slash -->

                                        <!-- Need more heap and permgen space and for func tests -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/bin/setenv.sh"
                                                token='JIRA_MAX_PERM_SIZE=384m'
                                                value='JIRA_MAX_PERM_SIZE=${jira.functest.maxPermSize}'/>
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/bin/setenv.sh"
                                                token='JVM_MAXIMUM_MEMORY="768m"'
                                                value='JVM_MAXIMUM_MEMORY="${jira.functest.maxMemory}"'/>

                                        <!-- Setting jira port -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/conf/server.xml"
                                                token="Connector port=&quot;8080&quot;"
                                                value="Connector port=&quot;${appServer.port}&quot;"/>

                                        <!-- Setting shutdown port -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/conf/server.xml"
                                                token="Server port=&quot;8005&quot;"
                                                value="Server port=&quot;${appServer.shutdown.port}&quot;"/>

                                        <!-- Setting jira home -->
                                        <replace
                                                file="${project.build.directory}/${appServer.install.directory}/atlassian-jira/WEB-INF/classes/jira-application.properties"
                                                token="jira.home =" value="jira.home = ${jira.home.directory}"/>


                                        <exec executable="${project.build.directory}/${appServer.install.directory}/bin/start-jira.sh"
                                              spawn="false">
                                            <env key="JAVA_OPTS"
                                                 value="-Djira.paths.set.allowed=true ${jira.user.jvmargs} -Djira.websudo.is.disabled=true -Djira.johnson.simulate.failure=PRE_DATABASE_LAUNCH:error,error"/>
                                            <env key="JIRA_HOME"
                                                 value="${jira.home.directory}"/>
                                        </exec>

                                        <waitfor maxwait="2" maxwaitunit="minute" checkevery="100"
                                                 timeoutproperty="startup-failed">
                                            <http url="${baseURL}"/>
                                        </waitfor>
                                    </tasks>
                                </configuration>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>johnson-standalone-jira-shutdown</id>
                                <phase>post-integration-test</phase>
                                <configuration>
                                    <tasks>
                                        <exec executable="${project.build.directory}/${appServer.install.directory}/bin/stop-jira.sh"
                                              spawn="false">
                                            <env key="JIRA_HOME"
                                                 value="${jira.home.directory}"/>
                                        </exec>
                                    </tasks>
                                </configuration>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
