<?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.bitbucket.server</groupId>
        <artifactId>bitbucket-webapp-parent</artifactId>
        <version>4.6.3</version>
    </parent>

    <artifactId>bitbucket-webapp</artifactId>
    <packaging>war</packaging>
    <name>Bitbucket Server - Web Application</name>

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

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>set-up-plugin-framework</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <!-- The Gemini Blueprint artifacts -->
                                <artifactItem>
                                    <groupId>org.eclipse.gemini.blueprint</groupId>
                                    <artifactId>gemini-blueprint-core</artifactId>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.eclipse.gemini.blueprint</groupId>
                                    <artifactId>gemini-blueprint-extender</artifactId>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.eclipse.gemini.blueprint</groupId>
                                    <artifactId>gemini-blueprint-io</artifactId>
                                </artifactItem>

                                <!-- The Spring framework -->
                                <artifactItem>
                                    <groupId>org.apache.servicemix.bundles</groupId>
                                    <artifactId>org.apache.servicemix.bundles.spring-aop</artifactId>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.apache.servicemix.bundles</groupId>
                                    <artifactId>org.apache.servicemix.bundles.spring-beans</artifactId>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.apache.servicemix.bundles</groupId>
                                    <artifactId>org.apache.servicemix.bundles.spring-context</artifactId>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.apache.servicemix.bundles</groupId>
                                    <artifactId>org.apache.servicemix.bundles.spring-context-support</artifactId>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.apache.servicemix.bundles</groupId>
                                    <artifactId>org.apache.servicemix.bundles.spring-core</artifactId>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.apache.servicemix.bundles</groupId>
                                    <artifactId>org.apache.servicemix.bundles.spring-expression</artifactId>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.apache.servicemix.bundles</groupId>
                                    <artifactId>org.apache.servicemix.bundles.spring-web</artifactId>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.apache.servicemix.bundles</groupId>
                                    <artifactId>org.apache.servicemix.bundles.spring-webmvc</artifactId>
                                </artifactItem>

                                <!-- Spring Dependencies -->
                                <artifactItem>
                                    <groupId>org.apache.servicemix.bundles</groupId>
                                    <artifactId>org.apache.servicemix.bundles.aopalliance</artifactId>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.apache.servicemix.bundles</groupId>
                                    <artifactId>org.apache.servicemix.bundles.cglib</artifactId>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.apache.servicemix.bundles</groupId>
                                    <artifactId>org.apache.servicemix.bundles.javax-inject</artifactId>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.apache.servicemix.bundles</groupId>
                                    <artifactId>org.apache.servicemix.bundles.velocity</artifactId>
                                </artifactItem>

                                <!-- Plugin Framework -->
                                <artifactItem>
                                    <groupId>com.atlassian.plugins</groupId>
                                    <artifactId>atlassian-plugins-osgi-bridge</artifactId>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>com.atlassian.plugins</groupId>
                                    <artifactId>atlassian-plugins-osgi-spring-extender</artifactId>
                                </artifactItem>

                                <!-- OSGi Compendium implementation -->
                                <artifactItem>
                                    <groupId>org.apache.felix</groupId>
                                    <artifactId>org.osgi.compendium</artifactId>
                                </artifactItem>

                                <!-- 3rd party libs -->
                                <artifactItem>
                                    <groupId>commons-pool</groupId>
                                    <artifactId>commons-pool</artifactId>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>commons-lang</groupId>
                                    <artifactId>commons-lang</artifactId>
                                </artifactItem>
                            </artifactItems>
                            <outputDirectory>
                                ${project.build.directory}/${project.build.finalName}/WEB-INF/osgi-framework-bundles
                            </outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </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>com.atlassian.minify</groupId>
                <artifactId>minify-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>compress-bower-components</id>
                        <goals>
                            <goal>minify-webresources</goal>
                        </goals>
                        <configuration>
                            <resourceBaseDirectory>${basedir}/src/main/webapp</resourceBaseDirectory>
                            <pluginXmlFiles>
                                <pluginXmlFile>${basedir}/src/main/resources/bitbucket-plugin.xml</pluginXmlFile>
                                <pluginXmlFile>${basedir}/src/main/resources/bitbucket-plugins/bbui-components.xml</pluginXmlFile>
                                <pluginXmlFile>${basedir}/src/main/resources/bitbucket-plugins/bower-components.xml</pluginXmlFile>
                                <pluginXmlFile>${basedir}/src/main/resources/bitbucket-plugins/client-web-fragments.xml</pluginXmlFile>
                                <pluginXmlFile>${basedir}/src/main/resources/bitbucket-plugins/feature-compare.xml</pluginXmlFile>
                                <pluginXmlFile>${basedir}/src/main/resources/bitbucket-plugins/highlight.xml</pluginXmlFile>
                                <pluginXmlFile>${basedir}/src/main/resources/bitbucket-plugins/page-data.xml</pluginXmlFile>
                                <pluginXmlFile>${basedir}/src/main/resources/bitbucket-plugins/web-api.xml</pluginXmlFile>
                            </pluginXmlFiles>
                            <outputDirectory>${project.build.directory}/${project.artifactId}-${project.version}</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.atlassian.lesscss</groupId>
                <artifactId>lesscss-maven-plugin</artifactId>
                <configuration>
                    <excludes>
                        <exclude>static/bower/**/*.less</exclude>
                    </excludes>
                </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>
            <!-- Runs on the release (and checks) build only -->
            <id>bom</id>
            <build>
                <plugins>
                    <!-- Generate the bom -->
                    <plugin>
                        <groupId>com.atlassian.maven.plugins</groupId>
                        <artifactId>license-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>generate-sources</id>
                                <phase>generate-sources</phase>
                                <goals>
                                    <goal>bom</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>com.atlassian.maven.plugins</groupId>
                        <artifactId>maven-licensing-bom-processor-plugin</artifactId>
                        <version>0.3</version>
                        <executions>
                            <execution>
                                <id>generate-sources</id>
                                <phase>generate-sources</phase>
                                <goals>
                                    <goal>generate</goal>
                                </goals>
                                <configuration>
                                    <bom>${project.build.directory}/bom.csv</bom>
                                    <template>${basedir}/src/build/resources/static/lgplTemplate.soy</template>
                                    <templateName>bitbucket.internal.build.generate.licenseTemplates</templateName>
                                    <output>${project.build.directory}/${project.artifactId}-${project.version}/static/page/about/lgpl.soy</output>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <!-- Used to launch the gogo shell to aid with debugging -->
            <!-- Never, never ever use in production -->
            <id>gogo</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>copy-felix-gogo-shell</id>
                                <phase>prepare-package</phase>
                                <goals>
                                    <goal>copy</goal>
                                </goals>
                                <configuration>
                                    <artifactItems>
                                        <artifactItem>
                                            <groupId>org.apache.felix</groupId>
                                            <artifactId>org.apache.felix.gogo.runtime</artifactId>
                                            <version>0.16.2</version>
                                        </artifactItem>
                                        <artifactItem>
                                            <groupId>org.apache.felix</groupId>
                                            <artifactId>org.apache.felix.gogo.command</artifactId>
                                            <version>0.14.0</version>
                                        </artifactItem>
                                        <artifactItem>
                                            <groupId>org.apache.felix</groupId>
                                            <artifactId>org.apache.felix.shell.remote</artifactId>
                                            <version>1.1.2</version>
                                        </artifactItem>
                                        <artifactItem>
                                            <groupId>org.apache.felix</groupId>
                                            <artifactId>org.apache.felix.gogo.shell</artifactId>
                                            <version>0.10.0</version>
                                        </artifactItem>
                                    </artifactItems>
                                <outputDirectory>
                                    ${project.build.directory}/${project.build.finalName}/WEB-INF/framework-bundles
                                </outputDirectory>
                            </configuration>
                        </execution>
                    </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

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

        <dependency>
            <groupId>com.atlassian.beehive</groupId>
            <artifactId>beehive-hazelcast</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.cache</groupId>
            <artifactId>atlassian-cache-hazelcast</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.hazelcast</groupId>
            <artifactId>atlassian-hazelcast-extras-osgi</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.cache</groupId>
            <artifactId>atlassian-cache-memory</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.crowd</groupId>
            <artifactId>crowd-persistence-hibernate4</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-plugins</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.johnson</groupId>
            <artifactId>atlassian-johnson-spring</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.json</groupId>
            <artifactId>atlassian-json-api</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.markup</groupId>
            <artifactId>atlassian-markup-api</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.markup</groupId>
            <artifactId>atlassian-markup-renderer-api</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-client-resource</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.security</groupId>
            <artifactId>atlassian-secure-utils</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.soy</groupId>
            <artifactId>soy-template-renderer-api</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.soy</groupId>
            <artifactId>atlassian-soy-spring-mvc-support</artifactId>
        </dependency>
        <!--
        Yes we are including a plugin as a runtime library  dependency! It is very intentional.
        To avoid running into plugin startup concurrency issues we are exposing the compatibility
        implementation of the tenant APIs from the host application.
        -->
        <dependency>
            <groupId>com.atlassian.tenancy</groupId>
            <artifactId>atlassian-tenancy-compatibility-plugin</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.utils</groupId>
            <artifactId>atlassian-processutils</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.http</groupId>
            <artifactId>atlassian-http</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.uri</groupId>
            <artifactId>atlassian-uri</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-codec</groupId>
            <artifactId>commons-codec</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-fileupload</groupId>
            <artifactId>commons-fileupload</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
        </dependency>
        <dependency>
            <groupId>com.jhlabs</groupId>
            <artifactId>filters</artifactId>
        </dependency>
        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
        </dependency>
        <dependency>
            <groupId>com.hazelcast</groupId>
            <artifactId>hazelcast-cloud</artifactId>
        </dependency>
        <dependency>
            <groupId>com.hazelcast</groupId>
            <artifactId>hazelcast-wm</artifactId>
        </dependency>
        <dependency>
            <groupId>com.octo.captcha</groupId>
            <artifactId>jcaptcha-api</artifactId>
        </dependency>
        <dependency>
            <groupId>com.octo.captcha</groupId>
            <artifactId>jcaptcha</artifactId>
        </dependency>
        <dependency>
            <groupId>dom4j</groupId>
            <artifactId>dom4j</artifactId>
        </dependency>
        <!-- Provided by Servlet Container -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <!-- Provided by Servlet Container -->
        <dependency>
            <groupId>javax.servlet.jsp</groupId>
            <artifactId>jsp-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <!-- Provided by Servlet Container -->
        <dependency>
            <groupId>javax.el</groupId>
            <artifactId>javax.el-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>joda-time</groupId>
            <artifactId>joda-time</artifactId>
        </dependency>
        <dependency>
            <groupId>opensymphony</groupId>
            <artifactId>sitemesh</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.velocity</groupId>
            <artifactId>velocity</artifactId>
        </dependency>
        <dependency>
            <groupId>org.codehaus.jackson</groupId>
            <artifactId>jackson-mapper-asl</artifactId>
        </dependency>
        <dependency>
            <groupId>org.codehaus.janino</groupId>
            <artifactId>janino</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.hsqldb</groupId>
            <artifactId>hsqldb</artifactId>
            <scope>runtime</scope>
        </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>com.atlassian.ip</groupId>
            <artifactId>atlassian-ip</artifactId>
        </dependency>
        <dependency>
            <groupId>com.zaxxer</groupId>
            <artifactId>HikariCP</artifactId>
        </dependency>
        <dependency>
            <groupId>org.tuckey</groupId>
            <artifactId>urlrewritefilter</artifactId>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.hazelcast</groupId>
            <artifactId>hazelcast-spring-test-util</artifactId>
            <scope>test</scope>
        </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-core</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.bitbucket.server</groupId>
            <artifactId>bitbucket-test-util</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.bundles</groupId>
            <artifactId>json</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>
