<?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.0.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.cargo</groupId>
                <artifactId>cargo-maven2-plugin</artifactId>
                <version>1.4.8</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>${maven.test.skip}</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>
                        <output>${project.build.directory}/output.log</output>
                        <log>${project.build.directory}/cargo-log.log</log>
                        <systemProperties>
                            <refapp.home>${project.build.directory}</refapp.home>
                            <baseurl>${baseurl}</baseurl>
                            <baseurl.display>${baseurl}</baseurl.display>
                        </systemProperties>
                        <timeout>240000</timeout>
                    </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}</cargo.jvmargs>
                        </properties>
                    </configuration>
                    <deployables>
                        <deployable>
                            <properties>
                                <context>${refapp.context}</context>
                            </properties>
                        </deployable>
                    </deployables>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <skip>${maven.test.unit.skip}</skip>
                    <excludes>
                        <exclude>it/**/*</exclude>
                        <exclude>**/*Abstract*</exclude>
                        <exclude>**/*Mock*</exclude>
                        <exclude>**/*$*</exclude>
                    </excludes>
                    <argLine>-Dbaseurl.refapp=${baseurl} -Dhttp.refapp.port=${http.port} -Dcontext.refapp.path=${refapp.context} -Dxvfb.enable=${xvfb.enable}</argLine>
                </configuration>
                <executions>
                    <execution>
                        <id>integration-test</id>
                        <phase>integration-test</phase>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <configuration>
                            <skip>${maven.test.it.skip}</skip>
                            <excludes>
                                <exclude>none</exclude>
                                <exclude>**/*Abstract*</exclude>
                                <exclude>**/*Mock*</exclude>
                                <exclude>**/*$*</exclude>
                            </excludes>
                            <includes>
                                <include>it/**/*</include>
                            </includes>
                        </configuration>
                    </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>-agentlib:jdwp=server=y,transport=dt_socket,address=5005,suspend=${debug.suspend}</jvmargs>
            </properties>
        </profile>
        <profile>
            <id>suspend</id>
            <properties>
                <debug.suspend>y</debug.suspend>
                <jvmargs>-agentlib:jdwp=server=y,transport=dt_socket,address=5005,suspend=${debug.suspend}</jvmargs>
            </properties>
        </profile>
        <profile>
            <id>spring4</id>
            <properties>
                <springTestVersion>spring4</springTestVersion>
            </properties>
        </profile>
    </profiles>
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>commons-collections</groupId>
                <artifactId>commons-collections</artifactId>
                <version>3.2.1</version>
                <scope>runtime</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <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>
        </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>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.fugue</groupId>
            <artifactId>fugue</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.security.auth.trustedapps</groupId>
            <artifactId>atlassian-trusted-apps-core</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>javax.servlet</groupId>
                    <artifactId>servlet-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>opensymphony</groupId>
            <artifactId>sitemesh</artifactId>
            <version>2.5-atlassian-3</version>
        </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>log4j</groupId>
            <artifactId>log4j</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-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>commons-beanutils</groupId>
            <artifactId>commons-beanutils</artifactId>
        </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>bouncycastle</groupId>
            <artifactId>bcprov-jdk14</artifactId>
            <version>138</version>
            <scope>compile</scope>
        </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-mock</artifactId>
            <version>2.0.5</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <version>2.0.5</version>
            <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>

    </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>
        <xvfb.enable>true</xvfb.enable>
        <springTestVersion>spring3</springTestVersion>
    </properties>
</project>
