<?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.refapp</groupId>
        <artifactId>atlassian-refapp-parent</artifactId>
        <version>3.2.0-m004</version>
    </parent>
    <artifactId>atlassian-refapp</artifactId>
    <packaging>war</packaging>
    <name>Atlassian Reference Application</name>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>extract-framework-bundles</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>com.atlassian.plugins</groupId>
                                    <artifactId>atlassian-plugins-framework-bundles</artifactId>
                                    <type>zip</type>
                                    <classifier>${springTestVersion}</classifier>
                                    <outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/framework-bundles</outputDirectory>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>sql-maven-plugin</artifactId>
            </plugin>

            <plugin>
                <groupId>org.codehaus.cargo</groupId>
                <artifactId>cargo-maven2-plugin</artifactId>
                <version>1.4.16</version>
                <executions>
                    <execution>
                        <id>start-container</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>start</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>stop-container</id>
                        <phase>post-integration-test</phase>
                        <goals>
                            <goal>stop</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <skip>${skipCargo}</skip>
                    <container>
                        <containerId>${tomcat.version}</containerId>
                        <artifactInstaller>
                            <groupId>org.apache.tomcat</groupId>
                            <artifactId>apache-tomcat</artifactId>
                            <type>zip</type>
                            <version>8.0.9</version>
                            <extractDir>${project.build.directory}/cargo-installs</extractDir>
                        </artifactInstaller>
                        <timeout>${debug.timeout}</timeout>
                        <output>${project.build.directory}/refapp-${project.version}.log</output>
                        <systemProperties>
                            <baseurl>${baseurl}</baseurl>
                            <baseurl.display>${baseurl}</baseurl.display>
                            <refapp.home>${project.build.directory}</refapp.home>
                            <com.atlassian.plugin.instrumentation.PluginSystemInstrumentation.enabled>${plugins.instrumentation.enabled}</com.atlassian.plugin.instrumentation.PluginSystemInstrumentation.enabled>
                        </systemProperties>
                    </container>
                    <configuration>
                        <home>${project.build.directory}/tomcat8x</home>
                        <properties>
                            <cargo.servlet.port>${http.port}</cargo.servlet.port>
                            <cargo.rmi.port>${rmi.port}</cargo.rmi.port>
                            <cargo.jvmargs>${jvmargs.debug} ${jvmargs}</cargo.jvmargs>
                        </properties>
                    </configuration>
                    <deployables>
                        <deployable>
                            <properties>
                                <context>${refapp.context}</context>
                            </properties>
                        </deployable>
                    </deployables>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <excludes>
                        <exclude>**/*</exclude>
                    </excludes>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-failsafe-plugin</artifactId>
                <configuration>
                    <argLine>-Dbaseurl.refapp=${baseurl} -Dhttp.refapp.port=${http.port} -Dcontext.refapp.path=${refapp.context} -Dxvfb.enable=${xvfb.enable}</argLine>
                    <includes>
                        <include>it/**/*</include>
                    </includes>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <executions>
                    <execution>
                        <!--We only do guava from now on -->
                        <id>ban_google_colllections</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <phase>validate</phase>
                        <configuration>
                            <rules>
                                <bannedDependencies>
                                    <searchTransitive>true</searchTransitive>
                                    <message>make sure google-collection is not accidentally included as transitive dependency</message>
                                    <excludes>
                                        <exclude>com.google.collections:google-collections</exclude>
                                    </excludes>
                                </bannedDependencies>
                            </rules>
                            <fail>true</fail>
                        </configuration>
                    </execution>
                    <execution>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <bannedDependencies>
                                    <searchTransitive>true</searchTransitive>
                                    <excludes>
                                        <exclude>javax.servlet:servlet-api</exclude>
                                    </excludes>
                                </bannedDependencies>
                            </rules>
                            <fail>true</fail>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.3</version>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>debug</id>
            <properties>
                <debug.suspend>n</debug.suspend>
                <jvmargs.debug>${jvmargs.debug.template}</jvmargs.debug>
            </properties>
        </profile>
        <profile>
            <id>suspend</id>
            <properties>
                <debug.suspend>y</debug.suspend>
                <jvmargs.debug>${jvmargs.debug.template}</jvmargs.debug>
            </properties>
        </profile>
        <profile>
            <id>spring42x</id>
            <properties>
                <springTestVersion>spring42x</springTestVersion>
            </properties>
        </profile>
        <profile>
            <id>skipCargoWhenSkipTests</id>
            <activation>
                <property>
                    <name>skipTests</name>
                </property>
            </activation>
            <properties>
                <skipCargo>true</skipCargo>
            </properties>
        </profile>
        <profile>
            <id>skipCargoWhenMavenSkipTest</id>
            <activation>
                <property>
                    <name>maven.test.skip</name>
                    <value>true</value>
                </property>
            </activation>
            <properties>
                <skipCargo>true</skipCargo>
            </properties>
        </profile>
        <profile>
            <id>ess-cloud</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.atlassian.maven.plugins</groupId>
                        <artifactId>maven-amps-plugin</artifactId>
                        <configuration>
                            <systemPropertyVariables>
                                <ess.btf>false</ess.btf>
                                <ess.baseurl>${ess.baseurl}</ess.baseurl>
                            </systemPropertyVariables>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
            <properties>
                <ess.baseurl>http://localhost:8080/</ess.baseurl>
            </properties>
        </profile>
        <profile>
            <id>platform-ctk</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <configuration>
                            <includes>
                                <include>ctk/**/*</include>
                            </includes>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.cargo</groupId>
                        <artifactId>cargo-maven2-plugin</artifactId>
                        <configuration>
                            <container>
                                <systemProperties>
                                    <platform.ctk.test.admin.username>admin</platform.ctk.test.admin.username>
                                    <platform.ctk.test.admin.password>admin</platform.ctk.test.admin.password>
                                    <platform.ctk.test.admin.fullname>A. D. Ministrator (Sysadmin)</platform.ctk.test.admin.fullname>
                                    <platform.ctk.test.validlicense>
                                        AAACVA0ODAoPeNqdVk1vozAQvfMrkPZMBE20h0pI2ya0i5qv3dBLb4ZMEq/ARLbJbv79gsHlywbRU
                                        xR/zJt5783gb8ElM18gNB3bdJzHuf04/256h8B8sB3HCFESpulsjSMgDLx/V0zvK8TB3c9/GgegN
                                        6D+yn1eLDaWvdjZ1sfh4816dfa/jIimf4+zJQXEcUrEnSKiZT9Yjp3vZhEOY5gtU8JRxLcoAdcnH
                                        M5UnDcDQInxB1MksYP7FcSpIE/O375WAPldfAOX0wzqoHtEOQEqjndLOOIivvu+XfsbP/BWxgmzC
                                        9xHMinBdvSMCGZi3X3iMWIMI1LjejcUZ+VuO6ENwnlEgkjU5VCit1IWdWvAxJ4+XpSSU5uUYkHHY
                                        cXNNktCoLvTs/i7TiMUP52BcOZaThlADyjy0crcAFfdWwGLKL6KEqtj5iml5j5GPP9NzGXwZnJgH
                                        JNzzaY6oMCaGLAQtStaxUlfS+HncZMMaCP2B8yp8XgF6uWRYxfXqNYRbuwHktaYRWlSsjBknaY3x
                                        IIU/50BLQUv08xodEEMupJWGesUL+0wIWHZACMWnSZsQcLo6NGwJBPS+GKIW7UxZcAm88rG+w1Jy
                                        qHReZ9DUltKodQw6mBr9rQXZeikb9WonaPD6Wjo6/BRe1EoOcX/krNeKJnByOwc8b3ye/OlBCc5W
                                        nbdBKDqiq6e7jTtNZ7k6wsjVT/OKkxFK4zIMv5OaM3VUkrFpO2fUg96xVSUjwsNoZ13xKThp+7Dw
                                        Zo/Hw4jc3oohnIK5bqSxndgkvwi7S6h/wEUMrYWMCwCFFBwk1DQL0qqxQbV15RZa/W8ESB7AhQ3b
                                        E9VSUvHT1S7vDj6p4zb0Oabdw==X02rr
                                    </platform.ctk.test.validlicense>
                                    <platform.ctk.test.search.term>refapp</platform.ctk.test.search.term>
                                    <platform.ctk.test.search.matches>http://foo.com,http://bar.com</platform.ctk.test.search.matches>
                                    <atlassian.darkfeature.foo>true</atlassian.darkfeature.foo>
                                    <atlassian.darkfeature.bar>false</atlassian.darkfeature.bar>
                                </systemProperties>
                            </container>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <dependencies>

        <dependency>
            <groupId>com.atlassian.refapp</groupId>
            <artifactId>atlassian-refapp-core</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>atlassian-bundled-plugins</artifactId>
            <version>${project.version}</version>
            <type>war</type>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.mail</groupId>
            <artifactId>atlassian-mail</artifactId>
            <version>2.4.1</version>
            <scope>runtime</scope>
            <exclusions>
                <exclusion>
                    <artifactId>commons-logging</artifactId>
                    <groupId>commons-logging</groupId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>com.atlassian.extras</groupId>
            <artifactId>atlassian-extras</artifactId>
        </dependency>

        <dependency>
            <groupId>com.atlassian.sal</groupId>
            <artifactId>sal-api</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.applinks</groupId>
            <artifactId>applinks-api</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.applinks</groupId>
            <artifactId>applinks-host</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.applinks</groupId>
            <artifactId>applinks-spi</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-core</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-servlet</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-webfragment</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-webresource</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-main</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.security</groupId>
            <artifactId>atlassian-secure-random</artifactId>
            <version>1.0</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.event</groupId>
            <artifactId>atlassian-event</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.http</groupId>
            <artifactId>atlassian-http</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>jsr305</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.fugue</groupId>
            <artifactId>fugue</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.security.auth.trustedapps</groupId>
            <artifactId>atlassian-trusted-apps-core</artifactId>
            <scope>compile</scope>
            <exclusions>
                <exclusion>
                    <groupId>javax.servlet</groupId>
                    <artifactId>servlet-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.atlassian.annotations</groupId>
            <artifactId>atlassian-annotations</artifactId>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>opensymphony</groupId>
            <artifactId>sitemesh</artifactId>
            <version>2.5-atlassian-3</version>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jcl-over-slf4j</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>javax.activation</groupId>
            <artifactId>activation</artifactId>
            <version>1.1</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>commons-codec</groupId>
            <artifactId>commons-codec</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>commons-collections</groupId>
            <artifactId>commons-collections</artifactId>
            <version>3.2.1</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>commons-beanutils</groupId>
            <artifactId>commons-beanutils</artifactId>
            <exclusions>
                <exclusion>
                    <artifactId>commons-logging</artifactId>
                    <groupId>commons-logging</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>commons-httpclient</groupId>
            <artifactId>commons-httpclient</artifactId>
            <version>3.0</version>
            <scope>compile</scope>
            <exclusions>
                <exclusion>
                    <groupId>commons-logging</groupId>
                    <artifactId>commons-logging</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>xerces</groupId>
            <artifactId>xercesImpl</artifactId>
            <version>2.9.1</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.tuckey</groupId>
            <artifactId>urlrewritefilter</artifactId>
            <version>4.0.4</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>joda-time</groupId>
            <artifactId>joda-time</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>xalan</groupId>
            <artifactId>xalan</artifactId>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>javax.servlet.jsp</groupId>
            <artifactId>javax.servlet.jsp-api</artifactId>
            <version>2.2.1</version>
            <scope>provided</scope>
        </dependency>

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

        <dependency>
            <groupId>com.atlassian.json</groupId>
            <artifactId>atlassian-json-api</artifactId>
            <version>0.9</version>
        </dependency>

        <dependency>
            <groupId>com.atlassian.html</groupId>
            <artifactId>atlassian-html-encoder</artifactId>
            <version>1.4</version>
        </dependency>
        <!-- todo:  James to remove when thirdparty has the dependency -->
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
        </dependency>

        <dependency>
            <groupId>com.atlassian.bundles</groupId>
            <artifactId>velocity</artifactId>
            <version>1.6.2-1</version>
            <exclusions>
                <exclusion>
                    <artifactId>velocity</artifactId>
                    <groupId>org.apache.velocity</groupId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>com.atlassian.ip</groupId>
            <artifactId>atlassian-ip</artifactId>
            <version>3.0</version>
        </dependency>

        <dependency>
            <groupId>com.atlassian.functest</groupId>
            <artifactId>functest-plugin</artifactId>
            <version>${fp.libversion}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.sun.jersey</groupId>
            <artifactId>jersey-client</artifactId>
            <version>1.19</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <properties>
        <http.port>8179</http.port>
        <rmi.port>8580</rmi.port>
        <refapp.context>refapp</refapp.context>
        <baseurl>http://localhost:${http.port}/${refapp.context}</baseurl>
        <jvmargs>-Xms128m -Xmx1024m -XX:MaxPermSize=256m -Dupm.pac.disable=true -Datlassian.dev.mode=true -Djava.awt.headless=true</jvmargs>
        <debug.suspend />
        <jvmargs.debug.template>-Djava.compiler=NONE -Xnoagent -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=5005,suspend=${debug.suspend}</jvmargs.debug.template>
        <jvmargs.debug />
        <xvfb.enable>true</xvfb.enable>
        <springTestVersion>spring41x</springTestVersion>
        <skipCargo>false</skipCargo>
        <debug.timeout>240000</debug.timeout>
    </properties>

</project>
