<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>3.4</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>
        <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>
            <plugin>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.3</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 necessary so that the FileWeaver & Surefire plugins can
                    use it to initialize the Unit Test Framework'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>gmaven-plugin</artifactId>
                <version>1.4</version>
                <executions>
                    <execution>
                        <id>setproperty</id>
                        <phase>generate-test-resources</phase>
                        <goals>
                            <goal>execute</goal>
                        </goals>
                        <configuration>
                            <source>
                            pom.properties['agnostic.build.dir']=project.build.directory.replace('\\','/');
                            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 framework -->
            <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 dspace "woven" configuration file ends up in the dspace directory
                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>
                    <tasks>
                        <copy file="${agnostic.build.dir}/testing/dspace.cfg.woven" tofile="${agnostic.build.dir}/testing/dspace/config/dspace.cfg" />
                    </tasks>
                  </configuration>
                  <goals>
                    <goal>run</goal>
                  </goals>
                </execution>
              </executions>
            </plugin>

            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <systemPropertyVariables>
                        <dspace.dir>${agnostic.build.dir}/testing/dspace</dspace.dir>
                        <dspace.dir.static>${basedir}/src/test/data/dspaceFolder</dspace.dir.static>
                        <dspace.configuration>${agnostic.build.dir}/testing/dspace/config/dspace.cfg</dspace.configuration>
                        <db.schema.path>${agnostic.build.dir}/testing/dspace/etc/h2/database_schema.sql</db.schema.path>
                        <dspace.log.init.disable>true</dspace.log.init.disable>
                    </systemPropertyVariables>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <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</artifactId>
        </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-httpclient</groupId>
            <artifactId>commons-httpclient</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>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>net.java.dev.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>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.dspace.dependencies.jmockit</groupId>
            <artifactId>dspace-jmockit</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</groupId>
            <artifactId>biblio-transformation-engine</artifactId>
            <version>0.82</version>
        </dependency>
        <dependency>
            <groupId>net.sf.opencsv</groupId>
            <artifactId>opencsv</artifactId>
            <version>2.3</version>
        </dependency>
        <dependency>
            <groupId>org.jbibtex</groupId>
            <artifactId>jbibtex</artifactId>
            <version>1.0.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.solr</groupId>
            <artifactId>solr-solrj</artifactId>
            <version>${lucene.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>org.dspace.dependencies</groupId>
            <artifactId>dspace-geoip</artifactId>
            <version>1.2.3</version>
        </dependency>
        <dependency>
            <groupId>org.apache.ant</groupId>
            <artifactId>ant</artifactId>
        </dependency>
        <dependency>
            <groupId>org.dspace.dnsjava</groupId>
            <artifactId>dnsjava</artifactId>
            <version>2.0.6</version>
        </dependency>

        <dependency>
            <groupId>org.elasticsearch</groupId>
            <artifactId>elasticsearch</artifactId>
            <version>0.18.6</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>
            <version>2.2.1</version>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>postgresql</groupId>
            <artifactId>postgresql</artifactId>
        </dependency>

    </dependencies>

</project>
