<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>5.7</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</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.3</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>
                        <executions>
                            <execution>
                                <id>setupTestEnvironment</id>
                                <phase>generate-test-resources</phase>
                                <goals>
                                    <goal>unpack</goal>
                                </goals>
                                <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>
                            </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>
                                <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>
                    
                    <!-- FileWeaver plugin is in charge of initializing & "weaving" together
                         the dspace.cfg file to be used by the Unit Testing environment.
                         It weaves two files, the default 'dspace.cfg' and 'dspace.cfg.more',
                         both of which are included in the testEnvironment.zip. -->
                    <plugin>
                        <groupId>edu.iu.ul.maven.plugins</groupId>
                        <artifactId>fileweaver</artifactId>
                        <version>1.0</version>
                        <configuration>
                            <outputs>
                                <output>
                                    <outputPath>${agnostic.build.dir}/testing</outputPath>
                                    <name>dspace.cfg.woven</name>
                                    <parts>
                                        <part>
                                            <path>${agnostic.build.dir}/testing/dspace/config/dspace.cfg</path>
                                        </part>
                                        <part>
                                            <path>${agnostic.build.dir}/testing/dspace.cfg.more</path>
                                        </part>
                                    </parts>
                                    <properties>
                                        <dspace.install.dir>${agnostic.build.dir}/testing/dspace</dspace.install.dir>
                                    </properties>
                                </output>
                            </outputs>
                        </configuration>
                        <executions>
                            <execution>
                                <id>edit-dspace-cfg</id>
                                <phase>process-test-resources</phase>
                                <goals>
                                    <goal>weave</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <!-- The ant plugin below ensures that the final "woven" dspace.cfg
                         ends up in the /target/testing/dspace/ directory. This becomes
                         our final dspace.cfg for the Unit Testing environment. The dspace
                         service manager needs this "woven" configuration file when it starts.-->
                    <plugin>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                            <execution>
                                <phase>process-test-resources</phase>
                                <configuration>
                                    <target>
                                        <copy file="${agnostic.build.dir}/testing/dspace.cfg.woven" tofile="${agnostic.build.dir}/testing/dspace/config/dspace.cfg" />
                                    </target>
                                </configuration>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <!-- Run Unit/Integration Testing! This plugin just kicks off the tests (when enabled). -->
                    <plugin>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <systemPropertyVariables>
                                <!-- Specify the dspace.cfg file to use for test environment -->
                                <dspace.configuration>${agnostic.build.dir}/testing/dspace/config/dspace.cfg</dspace.configuration>
                                <!-- 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.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.lucene</groupId>
            <artifactId>lucene-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-analyzers-common</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-queryparser</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>commons-dbcp</groupId>
            <artifactId>commons-dbcp</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>commons-pool</groupId>
            <artifactId>commons-pool</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>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.apache.pdfbox</groupId>
           <artifactId>jempbox</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>
        </dependency>
        <dependency>
            <groupId>xml-apis</groupId>
            <artifactId>xmlParserAPIs</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.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>
        </dependency>
        <dependency>
            <groupId>gr.ekt.bte</groupId>
            <artifactId>bte-io</artifactId>
            <version>0.9.3.5</version>
        </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>
            <version>1.8</version>
        </dependency>
        <dependency>
            <groupId>com.maxmind.geoip</groupId>
            <artifactId>geoip-api</artifactId>
            <version>1.2.11</version>
        </dependency>
        <dependency>
            <groupId>org.apache.ant</groupId>
            <artifactId>ant</artifactId>
        </dependency>
        <dependency>
            <groupId>dnsjava</groupId>
            <artifactId>dnsjava</artifactId>
            <version>2.1.1</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>18.0</version>
        </dependency>


        <dependency>
            <groupId>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>3.0</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.3</version>
        </dependency>
        <dependency>
            <groupId>javax.inject</groupId>
            <artifactId>javax.inject</artifactId>
            <version>1</version>
            <type>jar</type>
        </dependency>
    </dependencies>

</project>
