<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-api</artifactId>
    <name>DSpace Kernel :: API and Implementation</name>
    <description>DSpace core data model and service APIs.</description>

    <!--
       A Parent POM that Maven inherits DSpace Defaults
       POM attributes from.
    -->
    <parent>
        <groupId>org.dspace</groupId>
        <artifactId>dspace-parent</artifactId>
        <version>6.3</version>
        <relativePath>..</relativePath>
    </parent>

    <properties>
        <!-- This is the path to the root [dspace-src] directory. -->
        <root.basedir>${basedir}/..</root.basedir>
    </properties>

    <!--
       Runtime and Compile Time dependencies for DSpace.
    -->
    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <includes>
                    <include>maven.properties</include>
                    <include>scm.properties</include>
                </includes>
                <filtering>true</filtering>
            </resource>
            <resource>
                <directory>src/main/resources</directory>
                <excludes>
                    <exclude>maven.properties</exclude>
                    <exclude>scm.properties</exclude>
                </excludes>
                <filtering>false</filtering>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <debug>true</debug>
                    <showDeprecation>true</showDeprecation>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifest>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                            <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                        </manifest>
                    </archive>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>test-jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!-- Verify OS license headers for all source code files -->
            <plugin>
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <configuration>
                    <excludes>
                        <exclude>**/src/test/resources/**</exclude>
                        <exclude>**/src/test/data/**</exclude>
                        <exclude>**/.gitignore</exclude>
                        <exclude>src/test/data/dspaceFolder/config/spiders/**</exclude>
                        <exclude>src/main/java/org/apache/solr/handler/extraction/ExtractingParams.java</exclude>
                    </excludes>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>1.9.1</version>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>maven-version</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>buildnumber-maven-plugin</artifactId>
                <version>1.4</version>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>create</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

        </plugins>
    </build>


    <profiles>
        <profile>
            <id>findbugs</id>
            <activation>
                <activeByDefault>false</activeByDefault>
                <!-- property>
                    <name>maven.test.skip</name>
                    <value>false</value>
                </property -->
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>findbugs-maven-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <!-- If Unit Testing is enabled, then setup the Unit Test Environment.
             See also the 'skiptests' profile in Parent POM. -->
        <profile>
            <id>test-environment</id>
            <activation>
                <activeByDefault>false</activeByDefault>
                <property>
                    <name>maven.test.skip</name>
                    <value>false</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <!-- Unit/Integration Testing setup: This plugin unzips the
                         'testEnvironment.zip' file (created by dspace-parent POM), into
                         the 'target/testing/' folder, to essentially create a test
                         install of DSpace, against which Tests can be run. -->
                    <plugin>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <version>2.8</version>
                        <configuration>
                            <outputDirectory>${project.build.directory}/testing</outputDirectory>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>org.dspace</groupId>
                                    <artifactId>dspace-parent</artifactId>
                                    <version>${project.version}</version>
                                    <type>zip</type>
                                    <classifier>testEnvironment</classifier>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                        <executions>
                            <execution>
                                <id>setupTestEnvironment</id>
                                <phase>generate-test-resources</phase>
                                <goals>
                                    <goal>unpack</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>setupIntegrationTestEnvironment</id>
                                <phase>pre-integration-test</phase>
                                <goals>
                                    <goal>unpack</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <!-- This plugin allows us to run a Groovy script in our Maven POM
                         (see: http://gmaven.codehaus.org/Executing+Groovy+Code )
                         We are generating a OS-agnostic version (agnostic.build.dir) of
                         the ${project.build.directory} property (full path of target dir).
                         This is needed by the FileWeaver & Surefire plugins (see below)
                         to initialize the Unit Test environment's dspace.cfg file.
                         Otherwise, the Unit Test Framework will not work on Windows OS.
                         This Groovy code was mostly borrowed from:
                         http://stackoverflow.com/questions/3872355/how-to-convert-file-separator-in-maven
                    -->
                    <plugin>
                        <groupId>org.codehaus.gmaven</groupId>
                        <artifactId>groovy-maven-plugin</artifactId>
                        <version>2.0</version>
                        <executions>
                            <execution>
                                <id>setproperty</id>
                                <phase>generate-test-resources</phase> <!-- XXX I think this should be 'initialize' - MHW -->
                                <goals>
                                    <goal>execute</goal>
                                </goals>
                                <configuration>
                                    <source>
                                    project.properties['agnostic.build.dir']=project.build.directory.replace(File.separator,'/');
                                    println("Initializing Maven property 'agnostic.build.dir' to: " + project.properties['agnostic.build.dir']);
                                    </source>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <!-- Run Unit Testing! This plugin just kicks off the tests (when enabled). -->
                    <plugin>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <systemPropertyVariables>
                                <!-- Specify the dspace.dir to use for test environment -->
                                <!-- This system property is loaded by AbstractDSpaceTest to initialize the test environment -->
                                <dspace.dir>${agnostic.build.dir}/testing/dspace/</dspace.dir>
                                <!-- Turn off any DSpace logging -->
                                <dspace.log.init.disable>true</dspace.log.init.disable>
                            </systemPropertyVariables>
                        </configuration>
                    </plugin>


                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>xml-maven-plugin</artifactId>
                        <version>1.0.1</version>
                        <executions>
                          <execution>
                            <id>validate-ALL-xml-and-xsl</id>
                            <phase>process-test-resources</phase>
                            <goals>
                              <goal>validate</goal>
                            </goals>
                          </execution>
                        </executions>
                        <configuration>
                          <validationSets>
                            <!-- validate ALL XML and XSL config files in the testing folder -->
                             <validationSet>
                                 <dir>${agnostic.build.dir}/testing</dir>
                                 <includes>
                                     <include>**/*.xml</include>
                                     <include>**/*.xsl</include>
                                     <include>**/*.xconf</include>
                                 </includes>
                             </validationSet>
                             <!-- validate ALL XML and XSL files throughout the project -->
                             <validationSet>
                                <dir>${root.basedir}</dir>
                                 <includes>
                                     <include>**/*.xml</include>
                                     <include>**/*.xsl</include>
                                     <include>**/*.xmap</include>
                                 </includes>
                                 <excludes>
                                     <exclude>**/node/node_modules/**</exclude>
                                 </excludes>
                              </validationSet>
                          </validationSets>
                        </configuration>
                    </plugin>



                    <!-- Run Integration Testing! This plugin just kicks off the tests (when enabled). -->
                    <plugin>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <configuration>
                            <systemPropertyVariables>
                                <!-- Specify the dspace.dir to use for test environment -->
                                <dspace.dir>${agnostic.build.dir}/testing/dspace/</dspace.dir>
                                <!-- Turn off any DSpace logging -->
                                <dspace.log.init.disable>true</dspace.log.init.disable>
                            </systemPropertyVariables>
                        </configuration>
                    </plugin>
                </plugins>
            </build>

        </profile>
    </profiles>


    <dependencies>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.jboss.logging</groupId>
                    <artifactId>jboss-logging</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
        	<groupId>org.hibernate</groupId>
        	<artifactId>hibernate-ehcache</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-orm</artifactId>
        </dependency>
        <dependency>
            <groupId>org.dspace</groupId>
            <artifactId>handle</artifactId>
        </dependency>
        <dependency>
            <groupId>org.dspace</groupId>
            <artifactId>jargon</artifactId>
        </dependency>
        <dependency>
            <groupId>org.dspace</groupId>
            <artifactId>mets</artifactId>
        </dependency>
        <dependency>
            <groupId>org.dspace.dependencies</groupId>
            <artifactId>dspace-tm-extractors</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.jena</groupId>
            <artifactId>apache-jena-libs</artifactId>
            <type>pom</type>
        </dependency>
        <dependency>
            <groupId>commons-cli</groupId>
            <artifactId>commons-cli</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-codec</groupId>
            <artifactId>commons-codec</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-collections</groupId>
            <artifactId>commons-collections</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-dbcp2</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-fileupload</groupId>
            <artifactId>commons-fileupload</artifactId>
        </dependency>

        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-pool2</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-validator</groupId>
            <artifactId>commons-validator</artifactId>
        </dependency>
        <dependency>
            <groupId>javax.mail</groupId>
            <artifactId>mail</artifactId>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>jaxen</groupId>
            <artifactId>jaxen</artifactId>
            <exclusions>
                <exclusion>
                    <artifactId>xom</artifactId>
                    <groupId>xom</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.jdom</groupId>
            <artifactId>jdom</artifactId>
        </dependency>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
        </dependency>
        <dependency>
            <groupId>oro</groupId>
            <artifactId>oro</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.pdfbox</groupId>
            <artifactId>pdfbox</artifactId>
        </dependency>
        <dependency>
           <groupId>org.apache.pdfbox</groupId>
           <artifactId>fontbox</artifactId>
        </dependency>
        <dependency>
            <groupId>org.bouncycastle</groupId>
            <artifactId>bcprov-jdk15</artifactId>
        </dependency>
        <dependency>
            <groupId>org.bouncycastle</groupId>
            <artifactId>bcmail-jdk15</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-scratchpad</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml</artifactId>
        </dependency>
        <dependency>
            <groupId>rome</groupId>
            <artifactId>rome</artifactId>
        </dependency>
        <dependency>
            <groupId>rome</groupId>
            <artifactId>opensearch</artifactId>
        </dependency>
        <dependency>
            <groupId>xalan</groupId>
            <artifactId>xalan</artifactId>
        </dependency>
        <dependency>
            <groupId>xerces</groupId>
            <artifactId>xercesImpl</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>xml-apis</groupId>
                    <artifactId>xml-apis</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>xml-apis</groupId>
            <artifactId>xml-apis</artifactId>
        </dependency>
        <dependency>
            <groupId>javax.activation</groupId>
            <artifactId>activation</artifactId>
        </dependency>
        <dependency>
            <groupId>com.ibm.icu</groupId>
            <artifactId>icu4j</artifactId>
        </dependency>
        <dependency>
            <groupId>org.dspace</groupId>
            <artifactId>oclc-harvester2</artifactId>
        </dependency>
        <dependency>
            <groupId>org.dspace</groupId>
            <artifactId>dspace-services</artifactId>
        </dependency>
        <dependency> <!-- Keep jmockit before junit -->
            <groupId>org.jmockit</groupId>
            <artifactId>jmockit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.databene</groupId>
            <artifactId>contiperf</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.rometools</groupId>
            <artifactId>rome-modules</artifactId>
            <version>1.0</version>
        </dependency>
        <dependency>
            <groupId>gr.ekt.bte</groupId>
            <artifactId>bte-core</artifactId>
            <version>0.9.3.5</version>
            <exclusions>
                <!-- A more recent version is retrieved from another dependency -->
                <exclusion>
                    <groupId>org.mockito</groupId>
                    <artifactId>mockito-core</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>gr.ekt.bte</groupId>
            <artifactId>bte-io</artifactId>
            <version>0.9.3.5</version>
            <exclusions>
                <!-- A more recent version is retrieved from another dependency -->
                <exclusion>
                    <groupId>org.apache.commons</groupId>
                    <artifactId>commons-lang3</artifactId>
                </exclusion>
                <!-- A more recent version is retrieved from another dependency -->
                <exclusion>
                    <groupId>org.mockito</groupId>
                    <artifactId>mockito-core</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpcore</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.solr</groupId>
            <artifactId>solr-solrj</artifactId>
            <version>${solr.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>jcl-over-slf4j</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>commons-configuration</groupId>
            <artifactId>commons-configuration</artifactId>
        </dependency>
        <dependency>
            <groupId>com.maxmind.geoip2</groupId>
            <artifactId>geoip2</artifactId>
            <version>2.11.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.ant</groupId>
            <artifactId>ant</artifactId>
        </dependency>
        <dependency>
            <groupId>dnsjava</groupId>
            <artifactId>dnsjava</artifactId>
            <version>2.1.7</version>
        </dependency>

        <dependency>
            <groupId>org.elasticsearch</groupId>
            <artifactId>elasticsearch</artifactId>
            <version>1.4.0</version>
        </dependency>

        <dependency>
            <groupId>com.coverity.security</groupId>
            <artifactId>coverity-escapers</artifactId>
            <version>1.1.1</version>
        </dependency>

        <!--  Gson: Java to Json conversion -->
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>19.0</version>
        </dependency>


        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
        </dependency>

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

        <dependency>
            <groupId>jdbm</groupId>
            <artifactId>jdbm</artifactId>
            <version>1.0</version>
        </dependency>

        <!-- For ImageMagick MediaFilters -->
        <dependency>
            <groupId>org.im4java</groupId>
            <artifactId>im4java</artifactId>
            <version>1.4.0</version>
        </dependency>

        <!-- Flyway DB API (flywaydb.org) is used to manage DB upgrades automatically. -->
        <dependency>
            <groupId>org.flywaydb</groupId>
            <artifactId>flyway-core</artifactId>
            <version>4.0.3</version>
        </dependency>

        <!-- Google Analytics -->
        <dependency>
            <groupId>com.google.apis</groupId>
            <artifactId>google-api-services-analytics</artifactId>
        </dependency>
        <dependency>
            <groupId>com.google.api-client</groupId>
            <artifactId>google-api-client</artifactId>
        </dependency>
        <dependency>
            <groupId>com.google.http-client</groupId>
            <artifactId>google-http-client</artifactId>
        </dependency>
        <dependency>
            <groupId>com.google.http-client</groupId>
            <artifactId>google-http-client-jackson2</artifactId>
        </dependency>
        <dependency>
            <groupId>com.google.oauth-client</groupId>
            <artifactId>google-oauth-client</artifactId>
        </dependency>
        <!-- FindBugs -->
        <dependency>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>jsr305</artifactId>
        </dependency>
        <dependency>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>annotations</artifactId>
        </dependency>
        <dependency>
            <groupId>joda-time</groupId>
            <artifactId>joda-time</artifactId>
            <version>2.9.2</version>
        </dependency>
        <dependency>
            <groupId>javax.inject</groupId>
            <artifactId>javax.inject</artifactId>
            <version>1</version>
            <type>jar</type>
        </dependency>

        <dependency>
            <groupId>org.apache.ws.commons.axiom</groupId>
            <artifactId>axiom-impl</artifactId>
            <!-- NOTE: SWORDv2 needs 1.2.14, required by Abdera: https://abdera.apache.org/ -->
            <version>1.2.14</version>
        </dependency>

        <dependency>
            <groupId>org.apache.ws.commons.axiom</groupId>
            <artifactId>axiom-api</artifactId>
            <!-- NOTE: SWORDv2 needs 1.2.14, required by Abdera: https://abdera.apache.org/ -->
            <version>1.2.14</version>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jersey.core</groupId>
            <artifactId>jersey-client</artifactId>
            <version>${jersey.version}</version>
        </dependency>
        <!-- S3 -->
        <dependency>
            <groupId>com.amazonaws</groupId>
            <artifactId>aws-java-sdk-s3</artifactId>
            <version>1.10.50</version>
            <exclusions>
                <exclusion>
                    <groupId>joda-time</groupId>
                    <artifactId>joda-time</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <!-- For ORCID v2 integration -->
        <dependency>
           <groupId>org.dspace</groupId>
           <artifactId>orcid-jaxb-api</artifactId>
           <version>2.1.0</version>
        </dependency>
        <dependency>
            <groupId>org.json</groupId>
            <artifactId>json</artifactId>
            <version>20180130</version>
        </dependency>
    </dependencies>

</project>
