<?xml version="1.0" encoding="UTF-8"?>
<!--
  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. See accompanying LICENSE file.
-->
<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>com.intel.chimera</groupId>
  <artifactId>chimera</artifactId>
  <packaging>jar</packaging>
  <description>chimera: A fast encryption/decryption library</description>
  <version>0.9.2</version>
  <name>chimera</name>
  <url>https://github.com/intel-hadoop/chimera</url>

  <properties>
    <!-- The property "target.name" is used to specify the ant target, The All target will use
    OSInfo.java to detect the OS info and arch to generate the native binary for detected platform.
    User is able to specify the platform by maven profiles.-->
    <target.name>all</target.name>
    <maven-antrun-plugin.version>1.7</maven-antrun-plugin.version>
    <maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
    <maven-javadoc-plugin.version>2.8.1</maven-javadoc-plugin.version>
    <maven-source-plugin.version>2.3</maven-source-plugin.version>
    <maven-compiler-plugin.version>3.1</maven-compiler-plugin.version>
    <findbugs-maven-plugin.version>3.0.2</findbugs-maven-plugin.version>
    <apache-rat-plugin.version>0.11</apache-rat-plugin.version>
    <nexus-staging-maven-plugin.version>1.6.3</nexus-staging-maven-plugin.version>
    <junit.version>4.8.2</junit.version>
    <guava.version>11.0.2</guava.version>
    <commons-logging.version>1.1.3</commons-logging.version>
    <slf4j-api.version>1.7.10</slf4j-api.version>
    <javac.version>1.7</javac.version>
  </properties>

  <profiles>
    <profile>
      <id>win32</id>
      <properties>
        <target.name>win32</target.name>
      </properties>
    </profile>
    <profile>
      <id>win64</id>
      <properties>
        <target.name>win64</target.name>
      </properties>
    </profile>
    <profile>
      <id>mac32</id>
      <properties>
        <target.name>mac32</target.name>
      </properties>
    </profile>
    <profile>
      <id>linux32</id>
      <properties>
        <target.name>linux32</target.name>
      </properties>
    </profile>
    <profile>
      <id>linux64</id>
      <properties>
        <target.name>linux64</target.name>
      </properties>
    </profile>
    <profile>
      <id>linux-arm</id>
      <properties>
        <target.name>linux-arm</target.name>
      </properties>
    </profile>
    <profile>
      <id>linux-armhf</id>
      <properties>
        <target.name>linux-armhf</target.name>
      </properties>
    </profile>
    <profile>
      <id>linux-aarch64</id>
      <properties>
        <target.name>linux-aarch64</target.name>
      </properties>
    </profile>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <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>

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <configuration>
              <quiet>true</quiet>
              <nonavbar>true</nonavbar>
              <notree>true</notree>
              <nocomment>true</nocomment>
              <nohelp>true</nohelp>
            </configuration>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <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>

          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <extensions>true</extensions>
            <configuration>
              <serverId>ossrh</serverId>
              <nexusUrl>https://oss.sonatype.org/</nexusUrl>
              <autoReleaseAfterClose>false</autoReleaseAfterClose>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <!-- FindBugs -->
    <profile>
      <id>findbugs</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>findbugs-maven-plugin</artifactId>
            <version>${findbugs-maven-plugin.version}</version>
            <configuration>
              <excludeFilterFile>findbugs-exclude.xml</excludeFilterFile>
              <!--
                  Enables analysis which takes more memory but finds more bugs.
                  If you run out of memory, changes the value of the effort element
                  to 'Low'.
                -->
              <effort>Max</effort>
              <failOnError>true</failOnError>
              <threshold>Low</threshold>
              <findbugsXmlOutput>true</findbugsXmlOutput>
              <xmlOutput>true</xmlOutput>
            </configuration>
            <executions>
              <execution>
                <phase>compile</phase>
                <goals>
                  <goal>check</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

  <licenses>
    <license>
      <name>Apache License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
    </license>
  </licenses>
  <developers>
    <developer>
      <id>dianfu</id>
      <name>Dian Fu</name>
      <email>dian.fu@intel.com</email>
      <organization>Intel</organization>
      <roles>
        <role>Chief Developer</role>
      </roles>
      <timezone>+8</timezone>
    </developer>
    <developer>
      <id>chengxu</id>
      <name>Ferdinand Xu</name>
      <email>cheng.a.xu@intel.com</email>
      <organization>Intel</organization>
      <roles>
        <role>Developer</role>
      </roles>
      <timezone>+8</timezone>
    </developer>
  </developers>

  <scm>
    <connection>scm:git@github.com:intel-hadoop/chimera.git</connection>
    <developerConnection>scm:git:git@github.com:intel-hadoop/chimera.git</developerConnection>
    <url>git@github.com:intel-hadoop/chimera.git</url>
  </scm>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-antrun-plugin</artifactId>
          <version>${maven-antrun-plugin.version}</version>
          <dependencies>
            <dependency>
              <groupId>ant-contrib</groupId>
              <artifactId>ant-contrib</artifactId>
              <version>1.0b3</version>
              <exclusions>
                <exclusion>
                  <groupId>ant</groupId>
                  <artifactId>ant</artifactId>
                </exclusion>
              </exclusions>
            </dependency>
            <dependency>
              <groupId>org.apache.ant</groupId>
              <artifactId>ant-nodeps</artifactId>
              <version>1.8.1</version>
            </dependency>
          </dependencies>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-gpg-plugin</artifactId>
          <version>${maven-gpg-plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>${maven-javadoc-plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>${maven-source-plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.sonatype.plugins</groupId>
          <artifactId>nexus-staging-maven-plugin</artifactId>
          <version>${nexus-staging-maven-plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>${maven-compiler-plugin.version}</version>
          <configuration>
            <source>${javac.version}</source>
            <target>${javac.version}</target>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <id>make</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <target name="make">
                <taskdef resource="net/sf/antcontrib/antcontrib.properties"
                         classpathref="maven.plugin.classpath"/>
                <exec executable="make" failonerror="true" dir="${project.basedir}">
                  <arg value="${target.name}"/>
                </exec>
              </target>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.rat</groupId>
        <artifactId>apache-rat-plugin</artifactId>
        <version>${apache-rat-plugin.version}</version>
        <configuration>
          <excludes>
            <exclude>*.cache</exclude>
            <exclude>.travis.yml</exclude>
            <exclude>lib/</exclude>
            <exclude>Makefile</exclude>
            <exclude>Makefile.common</exclude>
            <exclude>project/project/target/config-classes/*</exclude>
            <exclude>project/target/</exclude>
            <exclude>src/main/java/com/intel/chimera/VERSION</exclude>
          </excludes>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
      </plugin>
    </plugins>
  </build>

  <distributionManagement>
    <snapshotRepository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
    <repository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
  </distributionManagement>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <scope>compile</scope>
      <version>${guava.version}</version>
    </dependency>
    <dependency>
      <groupId>commons-logging</groupId>
      <artifactId>commons-logging</artifactId>
      <version>${commons-logging.version}</version>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>${slf4j-api.version}</version>
     </dependency>
  </dependencies>
</project>
