<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-rest</artifactId>
        <version>2.10.5-j11</version>
    </parent>

    <groupId>com.atlassian.crowd</groupId>
    <artifactId>crowd-rest-plugin</artifactId>

    <packaging>atlassian-plugin</packaging>

    <name>Atlassian Crowd REST Plugin</name>

    <description>REST API Implementation for Crowd</description>

    <dependencies>
        <dependency>
            <groupId>com.atlassian.crowd</groupId>
            <artifactId>crowd-rest-common</artifactId>
            <scope>compile</scope>
            <exclusions>
                <exclusion>
                    <!--
                    Exclude all compile time transitive dependencies on crowd-rest-common. These should all be have
                    provided scope for crowd-rest-plugin as we only want the classes actually defined in
                    crowd-rest-common to be included
                    -->
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <!-- CWD-3144: this is a workaround for JRA-26214. Remove when fixed -->
        <dependency>
            <groupId>org.codehaus.woodstox</groupId>
            <artifactId>wstx-asl</artifactId>
            <scope>runtime</scope>
            <version>3.2.4</version>
            <exclusions>
                <exclusion>
                    <groupId>stax</groupId>
                    <artifactId>stax-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

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


        <dependency>
            <groupId>com.atlassian.crowd</groupId>
            <artifactId>crowd-api</artifactId>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework.security</groupId>
                    <artifactId>spring-security-core</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

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

        <dependency>
            <groupId>com.atlassian.crowd</groupId>
            <artifactId>crowd-integration-client-common</artifactId>
            <scope>provided</scope>
        </dependency>

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

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

        <dependency>
            <groupId>commons-codec</groupId>
            <artifactId>commons-codec</artifactId>
            <scope>provided</scope>
        </dependency>

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

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

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

        <dependency>
            <groupId>javax.ws.rs</groupId>
            <artifactId>jsr311-api</artifactId>
            <scope>provided</scope>
        </dependency>

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

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


        <!-- Test dependencies -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-junit</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jcl-over-slf4j</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.github.stefanbirkner</groupId>
            <artifactId>system-rules</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>maven-amps-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <Import-Package>
                            com.atlassian.sal.api;version="2.10.0",
                            com.atlassian.crowd.*,
                            org.apache.commons.lang3*,
                            org.apache.commons.codec*;version="1.5",
                            com.atlassian.plugins.rest.common*;version="${atlassian.rest.osgi.version}",
                            javax.annotation,
                            javax.ws.rs*;version="1.0.0",
                            javax.xml.bind*;version="2.1.0",
                            javax.servlet.*;version="0.0.0",
                            javax.xml.stream.*;version="0.0.0",
                            javax.xml.transform.*;version="0.0.0",
                            javax.xml.namespace.*;version="0.0.0",
                            com.google.common*;version="${guava.osgi.version}",
                            com.sun.jersey*;version="0.0.0",
                            org.slf4j.*;version="${slf4j.osgi.version}",
                            org.xml.sax.*;version="0.0.0",
                            org.codehaus.jackson.annotate;version="${jackson.osgi.version}",
                            com.atlassian.annotations.security;version=0.9
                        </Import-Package>
                    </instructions>
                    <httpPort>8095</httpPort>
                    <contextPath>/crowd</contextPath>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <executions>
                    <execution>
                        <id>enforce-repackage-whitelist</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <bannedDependencies>
                                    <excludes>
                                        <exclude>*:*:*:*:compile</exclude>
                                        <exclude>*:*:*:*:runtime</exclude>
                                    </excludes>
                                    <includes>
                                        <include>com.atlassian.crowd:crowd-rest-common</include>
                                        <include>org.codehaus.woodstox:wstx-asl</include>
                                    </includes>
                                    <searchTransitive>true</searchTransitive>
                                    <message>
                                        Only dependencies explicitly included via the whitelist can be used
                                        as compile/runtime scope in crowd-rest-plugin because the dependencies
                                        are exploded into the jar
                                    </message>
                                </bannedDependencies>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>
