<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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>org.dspace</groupId>
    <artifactId>xoai</artifactId>
    <name>XOAI : OAI-PMH Java Toolkit</name>
    <version>3.4.2</version>
    <description>XOAI - a powerful, flexible OAI-PMH Java Toolkit</description>
    <url>https://github.com/dspace/xoai</url>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>${project.build.sourceEncoding}</project.reporting.outputEncoding>
        <java.version>11</java.version>
    </properties>

    <build>
        <!-- Define Maven Plugin Settings / versions. -->
        <pluginManagement>
            <plugins>
                <!-- Use to enforce a particular version of Java and ensure no conflicting dependencies -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>3.6.3</version>
                    <executions>
                        <execution>
                            <id>enforce-java</id>
                            <goals>
                                <goal>enforce</goal>
                            </goals>
                            <configuration>
                                <rules>
                                    <requireJavaVersion>
                                        <version>${java.version}</version>
                                    </requireJavaVersion>
                                    <requireMavenVersion>
                                        <version>[3.8,)</version>
                                    </requireMavenVersion>
                                </rules>
                            </configuration>
                        </execution>
                        <!-- Make sure that we do not have conflicting dependencies-->
                        <execution>
                            <id>enforce-versions</id>
                            <goals>
                                <goal>enforce</goal>
                            </goals>
                            <configuration>
                                <rules>
                                    <DependencyConvergence />
                                </rules>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <!-- Used to compile all Java classes -->
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.15.0</version>
                    <configuration>
                      <release>${java.version}</release>
                    </configuration>
                </plugin>
                <!-- Used to package all JARs -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>3.5.0</version>
                    <configuration>
                        <archive>
                            <manifest>
                                <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                                <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                            </manifest>
                        </archive>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>3.8.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>3.11.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>3.5.0</version>
                </plugin>
                <!-- Used to generate a new release via Sonatype (see release profile). -->
                <plugin>
                    <groupId>org.sonatype.central</groupId>
                    <artifactId>central-publishing-maven-plugin</artifactId>
                    <version>0.10.0</version>
                </plugin>
                <!-- Used to generate JavaDocs for new releases (see release profile). -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>3.12.0</version>
                    <configuration>
                        <!-- Never fail a build based on Javadoc errors -->
                        <failOnError>false</failOnError>
                    </configuration>
                </plugin>
                <!-- Used to generate source JARs for new releases (see release profile). -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>3.4.0</version>
                </plugin>
                <!-- Used to sign new releases via GPG (see release profile). -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>1.6</version>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <!-- Specify our settings for new releases via 'mvn release:*' -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.5.3</version>
                <configuration>
                    <!-- During release:perform, enable the "release" profile (see below) -->
                    <releaseProfiles>release</releaseProfiles>
                    <goals>deploy</goals>
                    <!-- Auto-Version all modules the same as the parent module -->
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
       <!--
         The 'release' profile is used by the 'maven-release-plugin' (see above)
         to actually perform an XOAI release to Maven Central.
         This profile contains settings which are ONLY enabled when performing
         a DSpace module release. See alse https://wiki.duraspace.org/display/DSPACE/Release+Procedure
        -->
        <profile>
            <id>release</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <!--
                      Configure Central Publishing Plugin for new releases via Sonatype.
                      See: https://central.sonatype.org/publish/publish-portal-maven/
                      A few notes on how this plugin works:
                      1. In your settings.xml, your user/password tokens MUST be specified for a <server> tag
                         with <id>central</id>. Otherwise, you will see a 401 Unauthorized error.
                      2. The <distributionManagement> POM section is no longer needed. This plugin defaults to
                         uploading releases to Central Portal (https://central.sonatype.com/publishing)
                         and -SNAPSHOT releases to https://central.sonatype.com/repository/maven-snapshots/
                      3. Sonatype has publishing *requirements* which must be met. Our POM is already configured to
                         meet those requirements: https://central.sonatype.org/publish/requirements/
                    -->
                    <plugin>
                        <groupId>org.sonatype.central</groupId>
                        <artifactId>central-publishing-maven-plugin</artifactId>
                        <extensions>true</extensions>
                    </plugin>
                    <!-- Per Sonatype publishing requirements, generate Source JAR files -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <!-- Per Sonatype publishing requirements, generate JavaDocs for each module -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <!-- Per Sonatype publishing requirements, sign any new releases via GPG.
                         NOTE: you may optionally specify the "gpg.passphrase" in your settings.xml -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <dependencies>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-all</artifactId>
            <version>1.3</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.woodstox</groupId>
            <artifactId>woodstox-core</artifactId>
            <version>6.7.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-core</artifactId>
            <version>2.26.0</version>
        </dependency>
        <dependency>
            <groupId>commons-codec</groupId>
            <artifactId>commons-codec</artifactId>
            <version>1.22.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-collections4</artifactId>
            <version>4.5.0</version>
        </dependency>
        <dependency>
            <groupId>net.sf.saxon</groupId>
            <artifactId>Saxon-HE</artifactId>
            <version>12.9</version>
        </dependency>
        <!-- JAXB is no longer bundled with Java.
             compile only scope as this will be brought in through dspace-api -->
        <dependency>
            <groupId>javax.xml.bind</groupId>
            <artifactId>jaxb-api</artifactId>
            <version>2.3.1</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jaxb</groupId>
            <artifactId>jaxb-runtime</artifactId>
            <version>2.3.9</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
            <version>4.5.14</version>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>3.20.0</version>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>3.12.4</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.13.2</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.22.0</version>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>32.1.3-jre</version>
        </dependency>
        <dependency>
            <groupId>org.dom4j</groupId>
            <artifactId>dom4j</artifactId>
            <version>2.2.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>jaxen</groupId>
            <artifactId>jaxen</artifactId>
            <version>2.0.6</version>
            <scope>runtime</scope>
        </dependency>
    </dependencies>

    <licenses>
        <license>
            <name>DSpace BSD License</name>
            <url>https://raw.github.com/DSpace/DSpace/main/LICENSE</url>
            <distribution>repo</distribution>
            <comments>
                A BSD 3-Clause license for the DSpace codebase.
            </comments>
        </license>
    </licenses>

    <issueManagement>
        <system>GitHub</system>
        <url>https://github.com/DSpace/xoai/issues</url>
    </issueManagement>

    <scm>
        <connection>scm:git:git@github.com:DSpace/xoai.git</connection>
        <developerConnection>scm:git:git@github.com:DSpace/xoai.git</developerConnection>
        <url>https://github.com/DSpace/xoai</url>
        <tag>xoai-3.4.2</tag>
    </scm>

    <repositories>
        <!-- Check Maven Central first (before other repos below) -->
        <repository>
            <id>central</id>
            <url>https://repo.maven.apache.org/maven2</url>
        </repository>
        <!-- Enable access to artifacts in Sonatype's Central Portal snapshot repo for Snapshots ONLY -->
        <repository>
            <id>central-portal-snapshots</id>
            <url>https://central.sonatype.com/repository/maven-snapshots/</url>
            <layout>default</layout>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>

    <developers>
        <developer>
            <name>DSpace @ Lyncode</name>
            <email>dspace@lyncode.com</email>
            <organization>Lyncode</organization>
            <url>http://www.lyncode.com</url>
            <roles>
                <role>original-developer</role>
            </roles>
        </developer>
        <developer>
            <name>DSpace Committers</name>
            <email>dspace-devel@googlegroups.com</email>
            <url>https://wiki.lyrasis.org/display/DSPACE/DSpace+Committers</url>
            <roles>
                <role>committer</role>
            </roles>
        </developer>
    </developers>

</project>
