<?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.stash</groupId>
        <artifactId>stash-webapp-parent</artifactId>
        <version>1.1.0-rc2</version>
    </parent>

    <artifactId>stash-webapp</artifactId>
    <packaging>war</packaging>
    <name>Atlassian Stash Web Application</name>

    <properties>
        <http.port>7990</http.port>
        <rmi.port>8580</rmi.port>
        <refapp.context>stash</refapp.context>
        <baseurl>http://localhost:${http.port}/${refapp.context}</baseurl>
        <tomcat.installer.url>
            https://maven.atlassian.com/repository/public/org/apache/tomcat/apache-tomcat/6.0.32/apache-tomcat-6.0.32.zip
        </tomcat.installer.url>
        <cargo.wait>true</cargo.wait>
        <jvmargs>-Dstash.home=${project.build.directory}/stash-home</jvmargs>
        <debug.jvmargs />

        <module.base.dir>${basedir}/src/main/webapp/static/</module.base.dir>

        <timestamp>${maven.build.timestamp}</timestamp>
        <buildNumber>${maven.build.timestamp}</buildNumber>
        <stash.bundled.plugins>stash-bundled-plugins</stash.bundled.plugins>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <additionalClasspathElements> <!--bring the webapp resources (urlrewrite.xml, etc.) in the test classpath-->
                        <additionalClasspathElement>${basedir}/src/main/webapp/</additionalClasspathElement>
                    </additionalClasspathElements>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.codehaus.cargo</groupId>
                <artifactId>cargo-maven2-plugin</artifactId>
                <configuration>
                    <wait>${cargo.wait}</wait>
                    <container>
                        <containerId>tomcat6x</containerId>
                        <zipUrlInstaller>
                            <downloadDir>${project.build.directory}</downloadDir>
                            <extractDir>${project.build.directory}</extractDir>
                            <url>${tomcat.installer.url}</url>
                        </zipUrlInstaller>
                        <output>${project.build.directory}/output.log</output>
                        <log>${project.build.directory}/cargo-log.log</log>
                        <timeout>600000</timeout>
                        <!--10 mins-->
                        <systemProperties>
                            <baseurl>${baseurl}</baseurl>
                            <baseurl.display>${baseurl}</baseurl.display>
                        </systemProperties>
                    </container>
                    <configuration>
                        <home>${project.build.directory}/tomcat6x</home>
                        <deployables>
                            <deployable>
                                <properties>
                                    <context>stash</context>
                                </properties>
                            </deployable>
                        </deployables>
                        <properties>
                            <cargo.servlet.port>${http.port}</cargo.servlet.port>
                            <cargo.servlet.uriencoding>UTF-8</cargo.servlet.uriencoding>
                            <cargo.rmi.port>${rmi.port}</cargo.rmi.port>
                            <cargo.jvmargs>${jvmargs} ${debug.jvmargs}</cargo.jvmargs>
                        </properties>
                    </configuration>
                </configuration>
            </plugin>
            <plugin>
                <groupId>ro.isdc.wro4j</groupId>
                <artifactId>wro4j-maven-plugin</artifactId>
                <!--<executions>
                    <execution>
                        <phase>verify</phase>
                        <goals>
                            <goal>jshint</goal>
                            &lt;!&ndash;
                            <goal>run</goal>
                            <goal>csslint</goal>
                            &ndash;&gt;
                        </goals>
                    </execution>
                </executions>-->
                <configuration>
                    <options>browser,devel,jquery,eqnull,expr</options>
                    <ignoreMissingResources>false</ignoreMissingResources>
                    <failNever>false</failNever>
                    <wroFile>${basedir}/src/main/webapp/WEB-INF/wro.xml</wroFile>
                    <contextFolder>${basedir}/src/main/webapp</contextFolder>
                    <!--
                    <wroManagerFactory>ro.isdc.wro.examples.manager.CustomStandaloneWroManagerFactory</wroManagerFactory>
                    <wroManagerFactory>ro.isdc.wro.maven.plugin.manager.factory.ConfigurableWroManagerFactory</wroManagerFactory>
                    <wroManagerFactory>ro.isdc.wro.extensions.manager.standalone.FingerprintAwareStandaloneManagerFactory</wroManagerFactory>
                    <wroManagerFactory>ro.isdc.wro.extensions.manager.standalone.YUIStandaloneManagerFactory</wroManagerFactory>
                    <wroManagerFactory>ro.isdc.wro.examples.manager.CustomStandaloneWroManagerFactory</wroManagerFactory>
                    <wroManagerFactory>ro.isdc.wro.extensions.manager.standalone.GoogleStandaloneManagerFactory</wroManagerFactory>
                    -->
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>buildnumber-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>get-commit-hash</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>create</goal>
                        </goals>
                        <configuration>
                            <buildNumberPropertyName>commitHash</buildNumberPropertyName>
                            <revisionOnScmFailure>${buildNumber}</revisionOnScmFailure>
                            <scmBranchPropertyName>commitBranch</scmBranchPropertyName>
                            <timestampPropertyName>commitTimestamp</timestampPropertyName>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>debug</id>
            <properties>
                <cargo.wait>true</cargo.wait>
                <debug.suspend>y</debug.suspend>
                <debug.jvmargs>
                    -agentlib:jdwp=server=y,transport=dt_socket,address=5005,suspend=${debug.suspend}
                </debug.jvmargs>
            </properties>
        </profile>
        <profile>
            <id>qunit</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.atlassian.maven.plugins</groupId>
                        <artifactId>qunit-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <phase>test</phase>
                                <goals>
                                    <goal>test</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <dependencies>
        <dependency>
            <groupId>com.atlassian.stash</groupId>
            <artifactId>stash-api</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.stash</groupId>
            <artifactId>stash-bundled-plugins</artifactId>
            <type>zip</type>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.stash</groupId>
            <artifactId>stash-platform</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.stash</groupId>
            <artifactId>stash-model</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.stash</groupId>
            <artifactId>stash-service-api</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.stash</groupId>
            <artifactId>stash-service-impl</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.stash</groupId>
            <artifactId>stash-dao-impl</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.stash</groupId>
            <artifactId>stash-util</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.stash</groupId>
            <artifactId>stash-web-common</artifactId>
        </dependency>

        <dependency>
            <groupId>com.atlassian.crowd</groupId>
            <artifactId>crowd-persistence-hibernate</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.johnson</groupId>
            <artifactId>atlassian-johnson-core</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.johnson</groupId>
            <artifactId>atlassian-johnson-spring</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-core</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-webfragment</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-webresource</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.soy</groupId>
            <artifactId>soy-template-renderer-api</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.utils</groupId>
            <artifactId>atlassian-processutils</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.extras</groupId>
            <artifactId>atlassian-extras</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.http</groupId>
            <artifactId>atlassian-http</artifactId>
        </dependency>

        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
        </dependency>
        <dependency>
            <groupId>dom4j</groupId>
            <artifactId>dom4j</artifactId>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet.jsp</groupId>
            <artifactId>jsp-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.codehaus.janino</groupId>
            <artifactId>janino</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.tuckey</groupId>
            <artifactId>urlrewritefilter</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>opensymphony</groupId>
            <artifactId>sitemesh</artifactId>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jul-to-slf4j</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-web</artifactId>
        </dependency>
        <dependency>
            <groupId>joda-time</groupId>
            <artifactId>joda-time</artifactId>
        </dependency>
        <dependency>
            <groupId>com.octo.captcha</groupId>
            <artifactId>jcaptcha</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</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>
        <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>com.atlassian.stash</groupId>
            <artifactId>stash-test-util</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>
