<?xml version="1.0"?>
<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>

  <parent>
    <groupId>org.openidentityplatform.commons</groupId>
    <artifactId>parent</artifactId>
    <version>3.1.1</version>
  </parent>

  <artifactId>persistit</artifactId>
  <packaging>pom</packaging>

  <name>${project.groupId}.${project.artifactId}</name>
  <description>Java B+Tree Key-Value Store Library</description>
  <inceptionYear>2005</inceptionYear>
  

  <modules>
    <module>core</module>
    <module>ui</module>
  </modules>

  <properties>
    <!-- To configure animal-sniffer to check API compat -->
    <animal-sniffer.signature.groupId>org.codehaus.mojo.signature</animal-sniffer.signature.groupId>
    <animal-sniffer.signature.artifactId>java17</animal-sniffer.signature.artifactId>
    <animal-sniffer.signature.version>1.0</animal-sniffer.signature.version>
    <version.animal-sniffer.plugin>1.20</version.animal-sniffer.plugin>
    <version.maven-license.plugin>2.6</version.maven-license.plugin>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.13.1</version>
        <scope>test</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <build><finalName>${project.groupId}.${project.artifactId}</finalName>
    <pluginManagement>
      <!-- Plugins ordered by shortname (assembly, antrun ...) -->
      <plugins>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>animal-sniffer-maven-plugin</artifactId>
          <version>${version.animal-sniffer.plugin}</version>
          <configuration>
            <signature>
              <groupId>${animal-sniffer.signature.groupId}</groupId>
              <artifactId>${animal-sniffer.signature.artifactId}</artifactId>
              <version>${animal-sniffer.signature.version}</version>
            </signature>
            <skip>${skipSanityChecks}</skip>
          </configuration>
          <executions>
            <execution>
              <id>enforce-java-api-compatibility</id>
              <phase>verify</phase>
              <goals>
                <goal>check</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>build-helper-maven-plugin</artifactId>
          <version>1.8</version>
          <executions>
            <execution>
              <id>reserve-network-port</id>
              <goals>
                <goal>reserve-network-port</goal>
              </goals>
              <phase>process-resources</phase>
              <configuration>
                <portNames>
                  <portName>rmiport</portName>
                </portNames>
              </configuration>
            </execution>
          </executions>
        </plugin>
        
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.18</version>
          <configuration>
            <systemPropertyVariables>
              <buildDirectory>${project.build.directory}</buildDirectory>
            </systemPropertyVariables>
            <argLine>-Drmiport=${rmiport}</argLine>
            <includes>
              <include>**/*Test.java</include>
              <include>**/*Test?.java</include>
            </includes>
          </configuration>
        </plugin>
        
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>rmic-maven-plugin</artifactId>
          <version>1.0</version>
          <configuration>
            <outputDirectory>target/classes/</outputDirectory>
          </configuration>
          <executions>
            <execution>
              <id>rmi compilation</id>
              <goals>
                <goal>rmic</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        
        <!-- check copyright/license headers -->
        <plugin>
          <groupId>com.mycila</groupId>
          <artifactId>license-maven-plugin</artifactId>
          <version>${version.maven-license.plugin}</version>
          <configuration>
            <!-- WORKAROUND: This has been disabled because pattern doesn't match copyright modifications
                 done by ForgeRock. -->
            <!--
            <header>${project.basedir}/../copyright.txt</header>
            <headerSections>
              <headerSection>
                <key>__YEAR_SECTION__</key>
                <defaultValue>2015</defaultValue>
                <ensureMatch>20(05|06|07|08|09|10|11)\-20(12|13|14|15)|20(12|13|14|15)</ensureMatch>
              </headerSection>
              <headerSection>
                <key>__ORG__</key>
                <defaultValue>Open Identity Platform CommunityAS</defaultValue>
                <ensureMatch>(SonarSource|Akiban\ Technologies\,\ Inc\.|Open Identity Platform CommunityAS)</ensureMatch>
              </headerSection>
            </headerSections>
            !-->
            <aggregate>true</aggregate>
            <strictCheck>true</strictCheck>
            <failIfMissing>true</failIfMissing>
            <excludes>
              <!-- Non-distributed benchmark code -->
              <exclude>bench/**</exclude>
              <!-- Docs -->
              <exclude>doc/**</exclude>
              <exclude>src/main/resources/**</exclude>
              <exclude>src/test/resources/**</exclude>
              <!-- IDE files -->
              <exclude>.idea/**</exclude>
              <exclude>.settings/**</exclude>
              <exclude>.project</exclude>
              <exclude>.classpath</exclude>
              <exclude>.bzrignore</exclude>
              <exclude>src/etc/eclipse*.xml</exclude>
              <!-- Other -->
              <exclude>README.rst</exclude>
              <exclude>pom.xml</exclude>
            </excludes>
            <mapping>
              <java>JAVADOC_STYLE</java>
            </mapping>
            <skip>${skipSanityChecks}</skip>
          </configuration>
          <executions>
            <execution>
              <id>enforce-license-headers</id>
              <phase>validate</phase>
              <goals>
                <goal>check</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>
</project>
