<?xml version="1.0" encoding="UTF-8"?>
<!--
  Copyright (C) 2013, RedHat, Inc.

      http://www.redhat.com/

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<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.deephacks.lmdbjni</groupId>
  <artifactId>lmdbjni-project</artifactId>
  <version>0.4.2</version>
  <packaging>pom</packaging>

  <name>${project.artifactId}</name>
  <description>lmdbjni is a jni library for accessing lmdb.</description>
  <url>http://lmdbjni.deephacks.org</url>

  <properties>
    <hawtjni-version>1.9</hawtjni-version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <modules>
    <module>lmdbjni</module>
  </modules>

  <issueManagement>
    <system>github</system>
    <url>https://github.com/deephacks/lmdbjni/issues</url>
  </issueManagement>
  <scm>
    <connection>scm:git:git@github.com:deephacks/lmdbjni.git</connection>
    <developerConnection>scm:git:git@github.com:deephacks/lmdbjni.git</developerConnection>
    <url>scm:git:git@github.com/deephacks/lmdbjni</url>
  </scm>
  <licenses>
    <license>
      <name>The Apache Software License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <developers>
    <developer>
      <name>Kristoffer Sjogren</name>
      <id>krisskross</id>
      <email>stoffe -at- gmail.com</email>
      <organization/>
      <roles>
        <role>Developer</role>
      </roles>
      <url>http://stoffe.deephacks.org/</url>
      <timezone>+1</timezone>
    </developer>
  </developers>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.10</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <!-- run with mvn clean test site
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
        <configuration>
          <effort>Max</effort>
          <reportPlugins>
            <plugin>
              <groupId>org.codehaus.mojo</groupId>
              <artifactId>findbugs-maven-plugin</artifactId>
            </plugin>
          </reportPlugins>
        </configuration>
      </plugin>
      -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>2.3.2</version>
        <configuration>
          <source>1.7</source>
          <target>1.7</target>
          <compilerArgument>-XDignore.symbol.file</compilerArgument>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-deploy-plugin</artifactId>
        <groupId>org.apache.maven.plugins</groupId>
        <version>2.8.2</version>
      </plugin>
      <plugin>
        <artifactId>maven-release-plugin</artifactId>
        <version>2.5.2</version>
        <configuration>
          <useReleaseProfile>false</useReleaseProfile>
          <arguments>-P sign-artifacts</arguments>
          <autoVersionSubmodules>true</autoVersionSubmodules>
          <allowTimestampedSnapshots>false</allowTimestampedSnapshots>
          <tagNameFormat>@{project.version}</tagNameFormat>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <groupId>org.apache.maven.plugins</groupId>
        <version>2.10</version>
        <configuration>
          <redirectTestOutputToFile>true</redirectTestOutputToFile>
          <trimStackTrace>false</trimStackTrace>
          <printSummary>true</printSummary>
          <excludes>
            <exclude>**/*PerfTest*.java</exclude>
          </excludes>
          <useFile>true</useFile>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <groupId>org.apache.maven.plugins</groupId>
        <version>2.3.2</version>
        <configuration>
          <archive>
            <manifestEntries>
              <Specification-Title>${project.name}</Specification-Title>
              <Specification-Version>${project.version}</Specification-Version>
              <Specification-Vendor>deephacks</Specification-Vendor>
              <Implementation-Title>${project.name}</Implementation-Title>
              <Implementation-Version>${project.version}</Implementation-Version>
              <Implementation-Vendor>deephacks</Implementation-Vendor>
              <Implementation-Vendor-Id>org.deephacks</Implementation-Vendor-Id>
              <url>http://lmdbjni.deephacks.org</url>
            </manifestEntries>
          </archive>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>2.1.2</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>sign-artifacts</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-javadoc-plugin</artifactId>
            <groupId>org.apache.maven.plugins</groupId>
            <version>2.8</version>
            <configuration>
              <additionalparam>-Xdoclint:none</additionalparam>
              <failOnError>false</failOnError>
            </configuration>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
              <execution>
                <goals>
                  <goal>aggregate</goal>
                </goals>
                <phase>site</phase>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.6</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>full</id>
      <modules>
        <module>lmdbjni-osx64</module>
        <module>lmdbjni-linux64</module>
        <module>lmdbjni-android</module>
        <module>lmdbjni-win64</module>
      </modules>
    </profile>

    <profile>
      <id>osx64</id>
      <modules>
        <module>lmdbjni-osx64</module>
      </modules>
    </profile>

    <profile>
      <id>linux64</id>
      <modules>
        <module>lmdbjni-linux64</module>
      </modules>
      <build>
        <plugins>
          <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <version>0.7.2.201409121644</version>
            <configuration>
              <excludes>
                <!-- tested by third party -->
                <exclude>**/DirectBuffer*</exclude>
                <!-- this is LMDB -->
                <exclude>**/JNI*</exclude>
                <exclude>**/Util*</exclude>
              </excludes>
            </configuration>
            <executions>
              <execution>
                <id>prepare-agent</id>
                <goals>
                  <goal>prepare-agent</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.eluder.coveralls</groupId>
            <artifactId>coveralls-maven-plugin</artifactId>
            <version>3.0.1</version>
            <configuration>
              <sourceEncoding>utf8</sourceEncoding>
              <repoToken>t0ZqivSo91X1wfD5BNbbKDH5pwiI4y9YM</repoToken>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>android</id>
      <modules>
        <module>lmdbjni-android</module>
      </modules>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <excludes>
                <!-- hawtjni-callback.c bind() does not work on android -->
                <exclude>**/ComparatorTest*</exclude>
              </excludes>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>win64</id>
      <modules>
        <module>lmdbjni-win64</module>
      </modules>
    </profile>
  </profiles>

  <distributionManagement>
    <repository>
      <id>sonatype-nexus-staging</id>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
  </distributionManagement>

</project>
