<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>
    <groupId>org.dspace</groupId>
    <artifactId>dspace-swordv2</artifactId>
    <packaging>jar</packaging>
    <name>DSpace SWORD v2</name>
    <description>DSpace SWORD v2 Deposit Service Provider Extension</description>

    <!--
       A Parent POM that Maven inherits DSpace Default
       POM attributes from.
    -->
    <parent>
        <groupId>org.dspace</groupId>
        <artifactId>dspace-parent</artifactId>
        <version>7.2</version>
        <relativePath>..</relativePath>
    </parent>

    <properties>
        <!-- This is the path to the root [dspace-src] directory. -->
        <root.basedir>${basedir}/..</root.basedir>
    </properties>

    <profiles>
        <profile>
            <id>oracle-support</id>
            <activation>
                <property>
                    <name>db.name</name>
                    <value>oracle</value>
                </property>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>com.oracle</groupId>
                    <artifactId>ojdbc6</artifactId>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>postgres-support</id>
            <activation>
                <property>
                    <name>!db.name</name>
                </property>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>org.postgresql</groupId>
                    <artifactId>postgresql</artifactId>
                </dependency>
            </dependencies>
        </profile>
    </profiles>

    <dependencies>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- SWORDv2 Java implementation -->
        <dependency>
            <groupId>org.swordapp</groupId>
            <artifactId>sword2-server</artifactId>
            <version>1.0</version>
            <type>jar</type>
            <classifier>classes</classifier>
            <exclusions>
                <!-- Abdera is unmaintained/obsolete. But, 'fom-impl' is a new Abdera compatible library for Axiom.
                     Therefore, we are using 'fom-impl' instead (see below) -->
                <exclusion>
                    <groupId>org.apache.abdera</groupId>
                    <artifactId>abdera-client</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>javax.servlet</groupId>
                    <artifactId>servlet-api</artifactId>
                </exclusion>
                <!-- Newer version of log4j provided below -->
                <exclusion>
                    <groupId>log4j</groupId>
                    <artifactId>log4j</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-log4j12</artifactId>
                </exclusion>
                <!-- Exclude an old version of Jena in favor of new Apache Jena, which is pulled in by dspace-parent -->
                <exclusion>
                    <groupId>com.hp.hpl.jena</groupId>
                    <artifactId>jena</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <!-- DSpace Java API -->
        <dependency>
            <groupId>org.dspace</groupId>
            <artifactId>dspace-api</artifactId>
        </dependency>

        <!-- Needed to support Spring @Configuration classes (to register servlets/beans with Spring Boot webapp) -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
            <version>${spring-boot.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-logging</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <!-- Log4j -->
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-web</artifactId>
        </dependency>

        <!-- Replacement for Abdera (required by sword2-server dependency). Abdera is no longer maintained
             (https://abdera.apache.org/). But Axiom FOM is backwards compatible with Abdera.
             See https://ws.apache.org/axiom/implementations/fom-impl/index.html -->
        <dependency>
            <groupId>org.apache.ws.commons.axiom</groupId>
            <artifactId>fom-impl</artifactId>
            <version>${axiom.version}</version>
            <exclusions>
                <!-- Exclude Geronimo as it is NOT necessary when using javax.activation (which we use)
                     See: https://ws.apache.org/axiom/userguide/ch04.html#d0e732 -->
                <exclusion>
                    <groupId>org.apache.geronimo.specs</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
                <!-- Exclude Woodstox, as later version provided by Solr dependencies -->
                <exclusion>
                    <groupId>org.codehaus.woodstox</groupId>
                    <artifactId>woodstox-core-asl</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>

</project>
