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

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-bundled-plugins</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}/bundled-plugins</outputDirectory>
                            <includeScope>provided</includeScope>
                            <includeTypes>jar,bundle</includeTypes>
                            <excludeTransitive>true</excludeTransitive>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>2.2-beta-2</version>
                <executions>
                    <execution>
                        <id>pack-bundled-plugins</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>attached</goal>
                        </goals>
                        <configuration>
                            <descriptors>
                                <descriptor>src/main/assembly/bundled-plugins.xml</descriptor>
                            </descriptors>
                            <outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes</outputDirectory>
                            <finalName>atlassian-bundled-plugins</finalName>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-war-plugin</artifactId>
                <configuration>
                    <overlays>
                        <overlay>
                            <groupId>com.atlassian.plugins</groupId>
                            <artifactId>atlassian-plugins-refimpl</artifactId>
                            <excludes>
                                <!-- This conflicts with the version used by the seraph-refimpl-plugin -->
                                <exclude>WEB-INF/lib/atlassian-seraph-0.38.jar</exclude>
                            </excludes>
                        </overlay>
                    </overlays>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.cargo</groupId>
                <artifactId>cargo-maven2-plugin</artifactId>
                <version>1.0-alpha-5</version>
                <executions>
                    <execution>
                        <id>start-container</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>start</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <wait>${cargo.wait}</wait>
                    <container>
                        <containerId>tomcat5x</containerId>
                        <zipUrlInstaller>
                            <url>${tomcat.installer.url}</url>
                            <installDir>${project.build.directory}</installDir>
                        </zipUrlInstaller>
                        <output>${project.build.directory}/output.log</output>
                        <log>${project.build.directory}/cargo-log.log</log>
                        <systemProperties>
                            <baseurl>${baseurl}</baseurl>
                        </systemProperties>
                    </container>
                    <configuration>
                        <home>${project.build.directory}/tomcat5x</home>
                        <deployables>
                            <deployable>
                                <properties>
                                    <context>atlassian-refapp</context>
                                </properties>
                            </deployable>
                        </deployables>
                        <properties>
                            <cargo.servlet.port>${http.port}</cargo.servlet.port>
                            <cargo.rmi.port>${rmi.port}</cargo.rmi.port>
                            <cargo.jvmargs>${jvmargs}</cargo.jvmargs>
                        </properties>
                    </configuration>
                </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>
                    <systemProperties>
                        <property>
                            <name>baseurl</name>
                            <value>${baseurl}</value>
                        </property>
                    </systemProperties>
                </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/**/*java</include>
                            </includes>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>debug</id>
            <properties>
                <cargo.wait>true</cargo.wait>
                <debug.suspend>n</debug.suspend>
                <jvmargs>-agentlib:jdwp=server=y,transport=dt_socket,address=5005,suspend=${debug.suspend}</jvmargs>
                <maven.test.skip>true</maven.test.skip>
            </properties>
        </profile>
    </profiles>

    <dependencies>
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-refimpl</artifactId>
            <version>${atlassian.plugins.version}</version>
            <type>war</type>
            <scope>runtime</scope>
        </dependency>

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

        <!--
            These are plugins that we want to install in the refimpl container.  They're marked as scope provided so the
            Maven WAR plugin doesn't try to package them in WEB-INF/lib.
        -->
        <dependency>
            <groupId>com.atlassian.refapp</groupId>
            <artifactId>atlassian-refapp-auth-plugin</artifactId>
            <version>${pom.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.refapp</groupId>
            <artifactId>atlassian-refapp-trusted-apps-plugin</artifactId>
            <version>${pom.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.refapp</groupId>
            <artifactId>atlassian-refapp-trusted-apps-client-plugin</artifactId>
            <version>${pom.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.refapp</groupId>
            <artifactId>atlassian-refapp-cache-plugin</artifactId>
            <version>${pom.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.refapp</groupId>
            <artifactId>atlassian-refapp-web-item-plugin</artifactId>
            <version>${pom.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.refapp</groupId>
            <artifactId>atlassian-refapp-decorator-plugin</artifactId>
            <version>${pom.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.refapp</groupId>
            <artifactId>atlassian-refapp-charlie-plugin</artifactId>
            <version>${pom.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.refapp</groupId>
            <artifactId>atlassian-refapp-jquery-plugin</artifactId>
            <version>${pom.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.pdkinstall</groupId>
            <artifactId>pdkinstall-plugin</artifactId>
            <version>0.2</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.sal</groupId>
            <artifactId>sal-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.sal</groupId>
            <artifactId>sal-spi</artifactId>
            <version>${sal.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.sal</groupId>
            <artifactId>sal-refimpl-appproperties-plugin</artifactId>
            <version>${sal.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.sal</groupId>
            <artifactId>sal-refimpl-auth-plugin</artifactId>
            <version>${sal.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.sal</groupId>
            <artifactId>sal-refimpl-component-plugin</artifactId>
            <version>${sal.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.sal</groupId>
            <artifactId>sal-refimpl-executor-plugin</artifactId>
            <version>${sal.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.sal</groupId>
            <artifactId>sal-refimpl-lifecycle-plugin</artifactId>
            <version>${sal.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.sal</groupId>
            <artifactId>sal-refimpl-license-plugin</artifactId>
            <version>${sal.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.sal</groupId>
            <artifactId>sal-refimpl-message-plugin</artifactId>
            <version>${sal.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.sal</groupId>
            <artifactId>sal-refimpl-net-plugin</artifactId>
            <version>${sal.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.sal</groupId>
            <artifactId>sal-refimpl-pluginsettings-plugin</artifactId>
            <version>${sal.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.sal</groupId>
            <artifactId>sal-refimpl-project-plugin</artifactId>
            <version>${sal.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.sal</groupId>
            <artifactId>sal-refimpl-search-plugin</artifactId>
            <version>${sal.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.sal</groupId>
            <artifactId>sal-refimpl-scheduling-plugin</artifactId>
            <version>${sal.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.sal</groupId>
            <artifactId>sal-refimpl-transaction-plugin</artifactId>
            <version>${sal.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.sal</groupId>
            <artifactId>sal-refimpl-upgrade-plugin</artifactId>
            <version>${sal.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.sal</groupId>
            <artifactId>sal-refimpl-user-plugin</artifactId>
            <version>${sal.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.templaterenderer</groupId>
            <artifactId>atlassian-template-renderer-api</artifactId>
            <version>${template.renderer.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.templaterenderer</groupId>
            <artifactId>atlassian-template-renderer-velocity16-plugin</artifactId>
            <version>${template.renderer.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.bundles</groupId>
            <artifactId>google-collections</artifactId>
            <version>${google.collections.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>biz.aQute</groupId>
            <artifactId>bndlib</artifactId>
            <version>0.0.255</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins.rest</groupId>
            <artifactId>atlassian-rest-module</artifactId>
            <version>${rest.module.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugin.rest</groupId>
            <artifactId>atlassian-rest-plugin-manager-plugin</artifactId>
            <version>0.3.2</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.oauth</groupId>
            <artifactId>atlassian-oauth-api</artifactId>
            <version>${oauth.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.oauth</groupId>
            <artifactId>atlassian-oauth-consumer-spi</artifactId>
            <version>${oauth.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.oauth</groupId>
            <artifactId>atlassian-oauth-consumer-sal-plugin</artifactId>
            <version>${oauth.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.oauth</groupId>
            <artifactId>atlassian-oauth-consumer-plugin</artifactId>
            <version>${oauth.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.oauth</groupId>
            <artifactId>atlassian-oauth-service-provider-spi</artifactId>
            <version>${oauth.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.oauth</groupId>
            <artifactId>atlassian-oauth-service-provider-plugin</artifactId>
            <version>${oauth.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.oauth</groupId>
            <artifactId>atlassian-oauth-service-provider-sal-plugin</artifactId>
            <version>${oauth.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.oauth</groupId>
            <artifactId>atlassian-oauth-admin-plugin</artifactId>
            <version>${oauth.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.oauth</groupId>
            <artifactId>atlassian-whoami-plugin</artifactId>
            <version>${oauth.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpcore-osgi</artifactId>
            <version>4.0</version>
            <type>bundle</type>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient-osgi</artifactId>
            <version>4.0</version>
            <type>bundle</type>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>net.jcip</groupId>
            <artifactId>com.springsource.net.jcip.annotations</artifactId>
            <version>1.0.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.aui</groupId>
            <artifactId>auiplugin</artifactId>
            <version>3.0.6</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.bundles</groupId>
            <artifactId>jsr305</artifactId>
            <version>1.0</version>
            <scope>provided</scope>
        </dependency>


        <dependency>
            <groupId>net.sourceforge.jwebunit</groupId>
            <artifactId>jwebunit-htmlunit-plugin</artifactId>
            <version>1.5</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <!-- slf4j (used by htmlunit needs this dependency -->
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.12</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <properties>
        <http.port>8080</http.port>
        <rmi.port>8580</rmi.port>
        <baseurl>http://localhost:${http.port}/atlassian-refapp</baseurl>
        <tomcat.installer.url>
            <!--
                        file:///tmp/apache-tomcat-5.5.25.zip
            -->
            https://m2proxy.atlassian.com/repository/public/org/apache/tomcat/apache-tomcat/5.5.25/apache-tomcat-5.5.25.zip
        </tomcat.installer.url>
        <cargo.wait>false</cargo.wait>
        <jvmargs />
    </properties>
</project>
