<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/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>com.atlassian.crowd</groupId>
        <artifactId>crowd-user-management</artifactId>
        <version>3.2.0-101</version>
    </parent>

    <artifactId>crowd-user-management-plugin</artifactId>
    <packaging>atlassian-plugin</packaging>
    <name>Atlassian User Management - Plugin</name>

    <dependencies>
        <!-- User Management dependencies -->
        <dependency>
            <groupId>com.atlassian.crowd</groupId>
            <artifactId>crowd-user-management-common</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.crowd</groupId>
            <artifactId>crowd-rest-plugin</artifactId>
            <version>${crowd.version}</version>
            <scope>compile</scope>
        </dependency>

        <!-- Admin Chrome dependencies-->
        <dependency>
            <groupId>com.atlassian.crowd</groupId>
            <artifactId>unified-admin-chrome</artifactId>
            <scope>compile</scope>
        </dependency>

        <!-- Crowd dependencies -->
        <dependency>
            <groupId>com.atlassian.crowd</groupId>
            <artifactId>crowd-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.crowd</groupId>
            <artifactId>crowd-persistence</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.crowd</groupId>
            <artifactId>crowd-server-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- This should be removed once ForgottenLoginManager is moved to crowd-server-api -->
        <dependency>
            <groupId>com.atlassian.crowd</groupId>
            <artifactId>crowd-server-common</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <artifactId>joda-time</artifactId>
            <groupId>joda-time</groupId>
            <scope>provided</scope>
        </dependency>

        <!-- We need compile scope here so Crowd's REST entities are actually included in the plugin and can be found
             by the Jersey's annotation scanner. However, we don't want any of its compile-scoped dependencies to be
             included as well, so we exclude them. -->
        <dependency>
            <groupId>com.atlassian.crowd</groupId>
            <artifactId>crowd-rest-common</artifactId>
            <scope>compile</scope>
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

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

        <dependency>
            <groupId>com.atlassian.soy</groupId>
            <artifactId>soy-template-renderer-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-webresource</artifactId>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>commons-io</groupId>
                    <artifactId>commons-io</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>com.atlassian.sal</groupId>
            <artifactId>sal-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.plugins.rest</groupId>
            <artifactId>atlassian-rest-module</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.plugins.rest</groupId>
            <artifactId>atlassian-rest-common</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.fugue</groupId>
            <artifactId>fugue</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.applinks</groupId>
            <artifactId>applinks-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.security</groupId>
            <artifactId>atlassian-secure-random</artifactId>
            <scope>provided</scope>
        </dependency>

        <!--
        <dependency>
            <groupId>com.github.axet</groupId>
            <artifactId>kaptcha</artifactId>
            <scope>compile</scope>
        </dependency>
        -->

        <dependency>
            <groupId>com.google.code.maven-play-plugin.net.tanesha.recaptcha4j</groupId>
            <artifactId>recaptcha4j</artifactId>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.util</groupId>
            <artifactId>product-license-util</artifactId>
            <scope>compile</scope>
        </dependency>

        <!-- Start Test Dependencies -->
        <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.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.qunit</groupId>
            <artifactId>atlassian-qunit-plugin-util</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.crowd</groupId>
            <artifactId>crowd-pageobjects</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.crowd</groupId>
            <artifactId>crowd-test-utils</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.selenium</groupId>
            <artifactId>atlassian-pageobjects-elements</artifactId>
            <scope>test</scope>
        </dependency>

        <!-- atlassian-pageobjects requires at least 2.5 -->
        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <scope>test</scope>
        </dependency>

        <!-- Seems to be needed by qunit -->
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-library</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.scala-lang</groupId>
            <artifactId>scala-library</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.federation</groupId>
            <artifactId>federated-api-ctk-server</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.federation</groupId>
            <artifactId>federated-api-ctk-test-utilities</artifactId>
            <scope>test</scope>
        </dependency>

        <!-- required by selenium but not specified as a dependency for some reason -->
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <profiles>
        <profile>
            <id>release</id>
            <properties>
                <skipTests>true</skipTests>
            </properties>
        </profile>
    </profiles>

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
                <excludes>
                    <!-- We don't want to filter binaries or they'll get corrupted -->
                    <exclude>images/*</exclude>
                </excludes>
            </resource>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>false</filtering>
                <includes>
                    <include>images/*</include>
                </includes>
            </resource>
        </resources>
        <testResources>
            <testResource>
                <directory>src/test/resources</directory>
                <filtering>true</filtering>
            </testResource>
        </testResources>
        <plugins>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <excludes>
                        <exclude>it/**/*</exclude>
                    </excludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.lukegb.mojo</groupId>
                <artifactId>gitdescribe-maven-plugin</artifactId>
                <version>2.0</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>gitdescribe</goal>
                        </goals>
                        <id>git-describe</id>
                        <phase>initialize</phase>
                        <configuration>
                            <extraArguments />
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>maven-crowd-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <excludeAllTestDependencies>true</excludeAllTestDependencies>
                    <instructions>
                        <Import-Package>
                            !com.ibm.uvm.tools*,
                            !org.apache.jackrabbit*,
                            !org.apache.commons.net.ftp*,
                            !org.apache.tools.ant*,
                            !org.codehaus.plexus.interpolation*,
                            !com.jcraft.jsch*,
                            javax.jmdns*;resolution:=optional,
                            javax.jms*;resolution:=optional,
                            !com.sun.jdmk.comm*,
                            !com.sun.msv.grammar*,
                            !com.sun.msv.reader*,
                            !com.sun.msv.util*,
                            !com.sun.msv.verifier*,
                            !org.relaxng.datatype*,
                            !org.springframework.security.core.context*,
                            *
                        </Import-Package>
                        <Export-Package>
                            com.atlassian.crowd.plugin.usermanagement*
                        </Export-Package>
                    </instructions>
                    <testInstructions>
                        <Import-Package>
                            !com.jcraft.jsch*,
                            scala.*;resolution:=optional
                        </Import-Package>
                    </testInstructions>
                    <jvmDebugPort>${crowd.debug.port}</jvmDebugPort>
                    <productVersion>${crowd.version}</productVersion>
                    <productDataVersion>${crowd.data.version}</productDataVersion>
                    <productDataPath>${project.basedir}/src/test/resources/generated-test-resources/crowd-home</productDataPath>
                    <pluginArtifacts>
                        <pluginArtifact>
                            <groupId>com.atlassian.aui</groupId>
                            <artifactId>auiplugin</artifactId>
                            <version>${aui.version}</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>com.atlassian.plugins</groupId>
                            <artifactId>jquery</artifactId>
                            <version>${jquery.version}</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>com.atlassian.plugins</groupId>
                            <artifactId>less-transformer-plugin</artifactId>
                            <version>${atlassian.less.version}</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>com.atlassian.plugins.rest</groupId>
                            <artifactId>atlassian-rest-module</artifactId>
                            <version>${atlassian.rest.version}</version>
                        </pluginArtifact>
                        <!-- The QUnit plugin provides it inside the product. See: https://bitbucket.org/atlassian/atlassian-qunit-plugin -->
                        <pluginArtifact>
                            <groupId>com.atlassian.qunit</groupId>
                            <artifactId>atlassian-qunit-plugin</artifactId>
                            <version>${qunit.version}</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>com.atlassian.crowd</groupId>
                            <artifactId>unified-admin-chrome</artifactId>
                            <version>${project.version}</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>com.atlassian.plugins.browser.metrics</groupId>
                            <artifactId>browser-metrics-plugin</artifactId>
                            <version>${browser.metrics.version}</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>com.atlassian.plugins</groupId>
                            <artifactId>atlassian-dark-features-rest-plugin</artifactId>
                            <version>${atlassian.dark.features.version}</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>com.atlassian.crowd</groupId>
                            <artifactId>crowd-user-management-test-resources-plugin</artifactId>
                            <version>${project.version}</version>
                        </pluginArtifact>
                    </pluginArtifacts>
                    <systemPropertyVariables>
                        <qunit.testoutput.location>${project.build.directory}/qunit-surefire-reports</qunit.testoutput.location>
                        <xvfb.enable>${xvfb.enable}</xvfb.enable>
                        <applinks.cache.expiry>0</applinks.cache.expiry> <!-- disable DefaultReadOnlyApplicationLinkService cache -->
                    </systemPropertyVariables>
                    <functionalTestPattern>it/**/Test*.java</functionalTestPattern>
                </configuration>
            </plugin>
            <plugin>
                <groupId>net.alchim31.maven</groupId>
                <artifactId>scala-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>testCompile</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
