<?xml version="1.0" encoding="UTF-8"?>
<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>de.charite.compbio</groupId>
    <artifactId>ontologizer-parent</artifactId>
    <version>2.1-SNAPSHOT</version>
  </parent>
  <artifactId>ontologizer-core</artifactId>
  <name>Ontologizer - Core library</name>

  <properties>
    <maven.build.timestamp.format>yyyy-MM-dd'T'HH:mm:ssZ</maven.build.timestamp.format>
    <build.date>${maven.build.timestamp}</build.date>
  </properties>

  <dependencies>
    <dependency>
      <groupId>com.att.research</groupId>
      <artifactId>grappa</artifactId>
      <version>1.2.1</version>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.12</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
      </resource>
    </resources>

    <plugins>
      <!-- Generate the native changelog -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-changelog-plugin</artifactId>
        <version>2.3</version>
        <executions>
          <execution>
            <phase>generate-resources</phase>
            <goals>
              <goal>changelog</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <basedir>..</basedir>
          <type>date</type>
          <dates>
            <date implementation="java.lang.String">2000-01-01T00:00:00Z</date>
            <date implementation="java.lang.String">${build.date}</date>
          </dates>
          <dateFormat>${maven.build.timestamp.format}</dateFormat>
        </configuration>
      </plugin>

      <!-- Generate the user-facing changelog -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>1.3.2</version>
        <executions>
          <execution>
            <id>generate-changelog</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>java</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <mainClass>sonumina.util.changelog.BuildChangeLog</mainClass>
          <arguments>
            <argument>${project.build.outputDirectory}/ChangeLog</argument>
          </arguments>
        </configuration>
      </plugin>

      <!-- Generate the build number -->
      <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>
        <configuration>
          <getRevisionOnlyOnce>true</getRevisionOnlyOnce>
          <shortRevisionLength>8</shortRevisionLength>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>
