<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>com.github.phenomics</groupId>
  <artifactId>OntoLib</artifactId>
  <packaging>pom</packaging>
  <version>0.1</version>

  <name>${project.groupId}:${project.artifactId}</name>
  <description>OntoLib contains data structures and algorithms for processing ontologies.</description>
  <url>https://github.com/phenomics/ontolib</url>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

    <hamcrest.version>1.3</hamcrest.version>
    <junit.version>4.12</junit.version>
    <guava.version>22.0</guava.version>
    <checkstyle.version>2.17</checkstyle.version>
    <slf4j.version>1.7.24</slf4j.version>
    <antlr4.version>4.7</antlr4.version>
    <commons.io.version>2.4</commons.io.version>
    <mockito.version>2.8.47</mockito.version>
  </properties>

  <modules>
    <module>ontolib-core</module>
    <module>ontolib-io</module>
  </modules>

  <!-- Inherit artifact from SonaType OSS pom.xml Following this article: 
    http://java.dzone.com/articles/deploy-maven-central -->
  <parent>
    <groupId>org.sonatype.oss</groupId>
    <artifactId>oss-parent</artifactId>
    <version>9</version>
  </parent>

  <!-- License Information for Maven Central -->
  <licenses>
    <license>
      <name>BSD 3-clause Clear License</name>
      <url>https://spdx.org/licenses/BSD-3-Clause-Clear.html</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <!-- Developers Information for Maven Central -->
  <developers>
    <developer>
      <name>Sebastian Bauer</name>
      <email>mail@sebastianbauer.info</email>
    </developer>
    <developer>
      <name>Manuel Holtgrewe</name>
      <email>Manuel.Holtgrewe@bihealth.de</email>
      <organization>Berlin Institute of Health</organization>
      <organizationUrl>https://www.bihealth.de</organizationUrl>
    </developer>
    <developer>
      <name>Sebastian Koehler</name>
      <email>sebastian.koehler@charite.de</email>
      <organization>Charite University Medicine Berlin</organization>
      <organizationUrl>https://www.charite.de</organizationUrl>
    </developer>
  </developers>


  <!-- SCM Information for Maven Central -->
  <scm>
    <connection>scm:git:git@github.com:phenomics/ontolib.git</connection>
    <developerConnection>scm:git:git@github.com:phenomics/ontolib.git</developerConnection>
    <url>scm:git:git@github.com:phenomics/ontolib.git</url>
  </scm>

  <dependencies>
    <!-- JUnit testing -->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
    </dependency>

    <!-- Hamcrest, JUnit addon -->
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-all</artifactId>
      <version>${hamcrest.version}</version>
      <scope>test</scope>
    </dependency>

    <!-- Mockito mocking -->
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <version>${mockito.version}</version>
      <scope>test</scope>
    </dependency>

    <!-- SLF4J API -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>${slf4j.version}</version>
    </dependency>

    <!-- Binding for LOG4J -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
      <version>${slf4j.version}</version>
    </dependency>

    <!-- Google Guava -->
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>${guava.version}</version>
    </dependency>
  </dependencies>



  <build>
    <plugins>
      <!-- JUnit testing -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.20</version>
        <configuration>
          <forkCount>3</forkCount>
          <reuseForks>true</reuseForks>
          <argLine>${argLine} -Xms512m -Xmx1024m -Duser.language=en
            -Duser.region=US -Duser.timezone=UTC</argLine>
          <systemPropertyVariables>
            <user.language>en</user.language>
            <user.region>US</user.region>
          </systemPropertyVariables>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>1.4.1</version>
        <executions>
          <execution>
            <id>enforce</id>
            <configuration>
              <rules>
                <DependencyConvergence />
              </rules>
            </configuration>
            <goals>
              <goal>enforce</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <!-- Javadoc generation. -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>2.10.4</version>
        <configuration>
          <defaultVersion>${project.version}</defaultVersion>
          <additionalparam>-Xdoclint:none</additionalparam>
          <aggregate>true</aggregate>
          <show>public</show>
          <nohelp>true</nohelp>
          <header>${project.artifactId}, ${project.version}</header>
          <footer>${project.artifactId}, ${project.version}</footer>
          <doctitle>${project.artifactId}, ${project.version}</doctitle>
          <destDir>${project.version}</destDir>
          <reportOutputDirectory>${project.reporting.outputDirectory}/apidocs/api/</reportOutputDirectory>
        </configuration>
        <executions>
          <execution>
            <id>aggregate</id>
            <goals>
              <goal>aggregate</goal>
            </goals>
            <phase>site</phase>
            <configuration>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <!-- Source attachments -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>3.0.1</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <!-- Jacoco Coverage Reports -->
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>0.7.2.201409121644</version>
        <executions>
          <!-- Prepares the property pointing to the JaCoCo runtime agent 
            which is passed as VM argument when Maven the Surefire plugin is executed. -->
          <execution>
            <id>pre-unit-test</id>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
          </execution>
          <!-- Ensures that the code coverage report for unit tests is created 
            after unit tests have been run. -->
          <execution>
            <id>post-unit-test</id>
            <phase>test</phase>
            <goals>
              <goal>report</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <!-- Compilation -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.6.1</version>
        <configuration>
          <compilerArgument>-Xlint:all</compilerArgument>
          <showWarnings>true</showWarnings>
          <showDeprecation>true</showDeprecation>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>

      <!-- Set versions into JAR -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>3.0.2</version>
        <configuration>
          <archive>
            <manifest>
              <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
              <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
            </manifest>
          </archive>
        </configuration>
      </plugin>

      <!-- Code style checking -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>2.17</version>
        <dependencies>
          <dependency>
            <groupId>com.puppycrawl.tools</groupId>
            <artifactId>checkstyle</artifactId>
            <version>6.12</version>
          </dependency>
        </dependencies>
        <configuration>
          <configLocation>/google_checks.xml</configLocation>
          <enableFilesSummary>false</enableFilesSummary>
          <sourceDirectories>
            <sourceDirectory>src/main/java</sourceDirectory>
          </sourceDirectories>
        </configuration>
      </plugin>
    </plugins>

    <!-- Ignore various plugins in Eclipse/m2e -->
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.eclipse.m2e</groupId>
          <artifactId>lifecycle-mapping</artifactId>
          <version>1.0.0</version>
          <configuration>
            <lifecycleMappingMetadata>
              <pluginExecutions>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <versionRange>[1.0.0,)</versionRange>
                    <goals>
                      <goal>enforce</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore />
                  </action>
                </pluginExecution>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.jacoco</groupId>
                    <artifactId>
                      jacoco-maven-plugin
                    </artifactId>
                    <versionRange>
                      [0.7.2.201409121644,)
                    </versionRange>
                    <goals>
                      <goal>prepare-agent</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore />
                  </action>
                </pluginExecution>
              </pluginExecutions>
            </lifecycleMappingMetadata>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

</project>
