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

    <parent>
        <groupId>com.atlassian.support</groupId>
        <artifactId>stp-parent</artifactId>
        <version>3.5.3</version>
    </parent>

    <artifactId>stp</artifactId>

    <name>Support Tools Plugin</name>

    <packaging>atlassian-plugin</packaging>

    <!-- A few general notes on our dependencies: # Where possible, the STP
        sets dependencies that are exposed by all products to "provided", and specifies
        the lowest common version. # When a dependency is required for all products
        but only provided in some products, a local version is provided but not exported.
        # If a dependency is unique to a single product, it will be flagged as provided
        for all products but as optional in the OSGI import instructions # The exclusions
        used below are generally there because they prevent one product from bringing
        in the wrong version of a dependency and breaking another product. -->
    <dependencies>
        <dependency>
            <groupId>com.atlassian.bamboo</groupId>
            <artifactId>atlassian-bamboo-web</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.bamboo</groupId>
            <artifactId>atlassian-bamboo-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.stash</groupId>
            <artifactId>stash-branch-permissions</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.stash</groupId>
            <artifactId>stash-spi</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.stash</groupId>
            <artifactId>stash-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.extras</groupId>
            <artifactId>atlassian-extras-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.stash</groupId>
            <artifactId>stash-page-objects</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.confluence</groupId>
            <artifactId>confluence</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.crucible</groupId>
            <artifactId>atlassian-crucible-scmutils</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.fisheye</groupId>
            <artifactId>atlassian-fisheye-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.fisheye</groupId>
            <artifactId>fisheye-jar</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.functest</groupId>
            <artifactId>functest-plugin</artifactId>
            <scope>test</scope>
        </dependency>

        <!-- Never EVER put this to product scope -->
        <dependency>
            <groupId>com.atlassian.extras</groupId>
            <artifactId>atlassian-extras-encoder</artifactId>
            <version>3.1.0</version>
            <scope>test</scope>
        </dependency>
        <!-- Never EVER put this to product scope -->

        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>atlassian-jira</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.mail</groupId>
            <artifactId>atlassian-mail</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-core</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-main</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-osgi</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-servlet</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-webfragment</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-webresource</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.sal</groupId>
            <artifactId>sal-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.security</groupId>
            <artifactId>atlassian-secure-random</artifactId>
            <optional>true</optional>
        </dependency>
        <!-- reenable this when we're ready to try detecting studio from inside
            the products -->
        <!--<dependency>-->
            <!--<groupId>com.atlassian.studio</groupId>-->
            <!--<artifactId>studio-common</artifactId>-->
            <!--<scope>provided</scope>-->
        <!--</dependency>-->

        <dependency>
            <groupId>com.atlassian.spring</groupId>
            <artifactId>atlassian-spring</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.support</groupId>
            <artifactId>sisyphus-scanner-tools</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>com.atlassian.templaterenderer</groupId>
            <artifactId>atlassian-template-renderer-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.osgi</groupId>
            <artifactId>spring-osgi-core</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>commons-validator</groupId>
            <artifactId>commons-validator</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>opensymphony</groupId>
            <artifactId>oscore</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.velocity</groupId>
            <artifactId>velocity</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.velocity</groupId>
            <artifactId>velocity-tools</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.springframework.osgi</groupId>
            <artifactId>spring-osgi-extender</artifactId>
            <scope>provided</scope>
            <!-- Provided by application -->
        </dependency>

        <!-- Test Dependencies -->
        <!-- This doesn't seem to work, uncomment it when you're ready to try mail
            tests for Confluence -->
        <!--<dependency>-->
            <!--<groupId>com.atlassian.confluence.plugins</groupId>-->
            <!--<artifactId>confluence-functestrpc-plugin</artifactId>-->
            <!--<scope>test</scope>-->
        <!--</dependency>-->
        <dependency>
            <groupId>com.atlassian.confluence</groupId>
            <artifactId>confluence-test-support</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.confluence.plugins</groupId>
            <artifactId>confluence-functestrpc-plugin</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.selenium</groupId>
            <artifactId>atlassian-selenium-browsers-auto</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.webwork1</groupId>
            <artifactId>atlassian-webwork1</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.icegreen</groupId>
            <artifactId>greenmail</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>maven-amps-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <!-- Uncomment this when you're ready to try working with mail testing
                        in Confluence -->
                    <!--<pluginDependencies>-->
                        <!--<pluginDependency>-->
                            <!--<groupId>com.atlassian.confluence.plugins</groupId>-->
                            <!--<artifactId>confluence-functestrpc-plugin</artifactId>-->
                        <!--</pluginDependency>-->
                    <!--</pluginDependencies>-->

                    <systemPropertyVariables>
                        <plugin.i18n.directory>${basedir}/src/main/resources/i18n</plugin.i18n.directory>
                        <plugin.test.directory>${basedir}/src/test/resources</plugin.test.directory>
                    </systemPropertyVariables>
                    <instructions>
                        <DynamicImport-Package>
                            com.atlassian.stash.hooks.permissions
                        </DynamicImport-Package>
                        <Import-Package>
                            com.atlassian.applinks*;resolution:=optional,
                            com.atlassian.bamboo*;resolution:=optional,
                            com.atlassian.stash*;;resolution:=optional,
                            com.atlassian.config*;,
                            com.atlassian.confluence*;;resolution:=optional,
                            com.atlassian.crucible*;;resolution:=optional,
                            com.atlassian.extras*;;resolution:=optional,
                            com.atlassian.fisheye*;;resolution:=optional,
                            com.atlassian.jdk.utilities*;;resolution:=optional,
                            com.atlassian.jira*;;resolution:=optional,
                            com.atlassian.license*,
                            com.atlassian.mail*;version="1.16";resolution:=optional,
                            com.atlassian.modzdetector*;;resolution:=optional,
                            com.atlassian.plugin*,
                            com.atlassian.plugin.web.*,
                            com.atlassian.sal*;version="2.4.0",
                            com.atlassian.sal.stash*;resolution:=optional,
                            com.atlassian.sal.confluence*;resolution:=optional,
                            com.atlassian.sal.fisheye*;resolution:=optional,
                            com.atlassian.sal.fisheye.appconfig;resolution:=optional,
                            com.atlassian.sal.jira.*;resolution:=optional,
                            com.atlassian.spring.container.*;resolution:=optional,
                            com.atlassian.templaterenderer.*;version="1.0.0",
                            com.atlassian.user.*;resolution:=optional,
                            com.cenqua.crucible*;resolution:=optional,
                            com.cenqua.fisheye*;resolution:=optional,
                            com.opensymphony.*;version="0.0.0";resolution:=optional,
                            javax.activation.*;,
                            javax.crypto.*;,
                            javax.security.auth;version="0.0.0",
                            javax.servlet.*;version="2.1",
                            javax.net.*;,
                            javax.ws.rs.*;,
                            javax.xml.bind.*;,
                            java.lang.management.*;,
                            javax.mail.*;resolution:=optional,
                            javax.xml.datatype;version="0.0.0",
                            org.apache.commons.beanutils;version="1.6.1";resolution:=optional,
                            org.apache.commons.codec.*,
                            org.apache.commons.collections.*,
                            org.apache.commons.io*;version="1.4",
                            org.apache.commons.lang*;version="2.4",
                            org.apache.log4j;,
                            org.dom4j*;version="1.4",
                            org.hibernate*;resolution:=optional,
                            org.jdom*;version="1.0";resolution:=optional,
                            org.joda.time*;version="1.4";resolution:=optional,
                            org.slf4j*;version="1.5",
                            org.springframework.context*;resolution:=optional,
                            org.springframework.core.io;version="2.0.8",
                            org.springframework.beans*,
                            org.osgi.util.tracker*,
                            org.osgi.framework*,
                            org.springframework.osgi*
                        </Import-Package>
                    </instructions>

                    <products>
                        <product>
                            <id>bamboo</id>
                            <version>${bamboo.version}</version>
                            <productDataVersion>${bamboo.data.version}</productDataVersion>
                        </product>
                        <product>
                            <id>stash</id>
                            <version>${stash.version}</version>
                            <dataVersion>${stash.data.version}</dataVersion>
                            <containerId>tomcat7x</containerId>
                        </product>
                        <product>
                            <id>confluence</id>
                            <version>${confluence.version}</version>
                            <productDataVersion>${confluence.data.version}</productDataVersion>
                            <log4jProperties>src/aps/log4j/confluence.properties</log4jProperties>
                        </product>
                        <product>
                            <id>fecru</id>
                            <version>${fecru.version}</version>
                            <productDataVersion>${fecru.data.version}</productDataVersion>
                            <log4jProperties>src/aps/log4j/fecru.xml</log4jProperties>
                            <productDataPath>${basedir}/src/test/resources/fecru-test-resources.zip</productDataPath>
                        </product>
                        <product>
                            <id>jira</id>
                            <version>${jira.version}</version>
                            <productDataVersion>${jira.data.version}</productDataVersion>
                            <productDataPath>${basedir}/src/test/resources/jira-test-resources.zip</productDataPath>
                        </product>
                        <product>
                            <id>refapp</id>
                            <version>${refapp.version}</version>
                            <!-- The refapp doesn't include a few key jars that the rest of the
                                products do, so we add them manually during the deployment -->
                            <libArtifacts>
                                <libArtifact>
                                    <groupId>com.atlassian.mail</groupId>
                                    <artifactId>atlassian-mail</artifactId>
                                    <version>${atlassian.mail.version}</version>
                                </libArtifact>
                                <libArtifact>
                                    <groupId>javax.mail</groupId>
                                    <artifactId>mail</artifactId>
                                    <version>1.4.1</version>
                                </libArtifact>
                            </libArtifacts>
                        </product>
                    </products>
                    <!--<testGroups>-->
                        <!--<testGroup>-->
                            <!--<id>refapp</id>-->
                            <!--<productIds>-->
                                <!--<productId>refapp</productId>-->
                            <!--</productIds>-->
                            <!--<includes>-->
                                <!--<include>it/common/**</include>-->
                            <!--</includes>-->
                        <!--</testGroup>-->
                        <!--<testGroup>-->
                            <!--<id>confluence</id>-->
                            <!--<productIds>-->
                                <!--<productId>confluence</productId>-->
                            <!--</productIds>-->
                            <!--<includes>-->
                                <!--<include>it/common/**</include>-->
                                <!--<include>it/confluence/**</include>-->
                            <!--</includes>-->
                        <!--</testGroup>-->
                        <!--<testGroup>-->
                            <!--<id>jira</id>-->
                            <!--<productIds>-->
                                <!--<productId>jira</productId>-->
                            <!--</productIds>-->
                            <!--<includes>-->
                                <!--<include>it/common/**</include>-->
                            <!--</includes>-->
                        <!--</testGroup>-->
                        <!--<testGroup>-->
                            <!--<id>fecru</id>-->
                            <!--<productIds>-->
                                <!--<productId>fecru</productId>-->
                            <!--</productIds>-->
                            <!--<includes>-->
                                <!--<include>it/common/**</include>-->
                            <!--</includes>-->
                        <!--</testGroup>-->
                        <!--<testGroup>-->
                            <!--<id>bamboo</id>-->
                            <!--<productIds>-->
                                <!--<productId>bamboo</productId>-->
                            <!--</productIds>-->
                            <!--<includes>-->
                                <!--<include>it/common/**</include>-->
                            <!--</includes>-->
                        <!--</testGroup>-->
                    <!--</testGroups>-->
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>selenium-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>start-xvfb-instance</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>xvfb</goal>
                        </goals>
                        <configuration>
                            <skip>${selenium.xvfb.skip}</skip>
                            <display>${selenium.xvfb.display}</display>
                        </configuration>
                    </execution>

                    <execution>
                        <id>start-selenium-server</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>start-server</goal>
                        </goals>
                        <configuration>
                            <background>true</background>
                            <singleWindow>true</singleWindow>
                            <port>${selenium.server.port}</port>
                            <firefoxProfileTemplate>${selenium.firefox.profile}</firefoxProfileTemplate>
                        </configuration>
                    </execution>
                    <execution>
                        <id>stop-selenium-server</id>
                        <phase>post-integration-test</phase>
                        <goals>
                            <goal>stop-server</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <!-- don't run tests in default phase, hold off until integration-test
                        phase -->
                    <skip>false</skip>
                    <systemPropertyVariables combine.children="append">
                        <selenium.location>${selenium.server.location}</selenium.location>
                        <selenium.port>${selenium.server.port}</selenium.port>
                        <selenium.browser>${selenium.browser}</selenium.browser>
                        <selenium.max.wait.time>${selenium.max.wait.time}</selenium.max.wait.time>
                        <selenium.max.action.wait.time>${selenium.max.action.wait.time}</selenium.max.action.wait.time>
                        <selenium.max.editor.wait.time>${selenium.max.editor.wait.time}</selenium.max.editor.wait.time>
                        <selenium.max.comment.editor.wait.time>${selenium.max.comment.editor.wait.time}
                        </selenium.max.comment.editor.wait.time>
                        <ie6.mode>${ie6.mode}</ie6.mode>
                    </systemPropertyVariables>
                </configuration>
                <!--<executions>-->
                    <!--<execution>-->
                        <!--<id>run-selenium_tests</id>-->
                        <!--<phase>integration-test</phase>-->
                        <!--<goals>-->
                            <!--<goal>test</goal>-->
                        <!--</goals>-->
                        <!--<configuration>-->
                            <!--<skip>false</skip>-->
                        <!--</configuration>-->
                    <!--</execution>-->
                <!--</executions>-->
            </plugin>
        </plugins>
    </build>

    <profiles>
        <!-- profiles to allow Selenium to run particular browsers on BDAC -->
        <profile>
            <id>bamboo-firefox2</id>
            <properties>
                <selenium.browser>*firefoxproxy
                    /import/tools/firefox/2.0/firefox-bin
                </selenium.browser>
                <selenium.xvfb.skip>false</selenium.xvfb.skip>
                <test.exclusion.suffix>NotFF2*Test</test.exclusion.suffix>
            </properties>
        </profile>
        <profile>
            <id>bamboo-firefox3</id>
            <properties>
                <selenium.browser>*firefoxproxy
                    /import/tools/firefox/3.0/firefox-bin
                </selenium.browser>
                <selenium.xvfb.skip>false</selenium.xvfb.skip>
                <test.exclusion.suffix>NotFF3*Test</test.exclusion.suffix>
            </properties>
        </profile>
        <profile>
            <id>bamboo-firefox35</id>
            <properties>
                <selenium.browser.path>/import/tools/firefox/3.5/firefox-bin</selenium.browser.path>
                <selenium.browser>*firefoxproxy ${selenium.browser.path}</selenium.browser>
                <selenium.xvfb.skip>false</selenium.xvfb.skip>
                <test.exclusion.suffix>NotFF35*Test</test.exclusion.suffix>
            </properties>
        </profile>
        <profile>
            <id>bamboo-firefox36</id>
            <properties>
                <selenium.browser.path>/import/tools/firefox/3.6/firefox-bin</selenium.browser.path>
                <selenium.browser>*firefoxproxy ${selenium.browser.path}</selenium.browser>
                <selenium.xvfb.skip>false</selenium.xvfb.skip>
                <test.exclusion.suffix>NotFF36*Test</test.exclusion.suffix>
            </properties>
        </profile>
    </profiles>
</project>
