<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
         xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>

  <groupId>org.chessplorer</groupId>
  <artifactId>Chessplorer-Lib</artifactId>
  <version>1.0-RC1</version>
  <packaging>jar</packaging>

  <name>Chessplorer-Lib</name>
  <description>Chessplorer-Lib is an open source chess library written in Java.</description>
  <url>http://chessplorer.org</url>
  <organization>
    <name>Chessplorer.org</name>
    <url>http://chessplorer.org/</url>
  </organization>
  <licenses>
    <license>
      <name>GNU Lesser General Public License version 2.1</name>
      <url>http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt</url>
    </license>
  </licenses>

  <developers>
    <developer>
      <id>andy</id>
      <name>Andreas Rudolph</name>
      <email>andy@openindex.de</email>
      <organization>Chessplorer.org</organization>
      <organizationUrl>http://chessplorer.org/</organizationUrl>
    </developer>
    <developer>
      <id>gkalab</id>
      <name>Gerhard Kalab</name>
      <email>gerhard.kalab@gmail.com</email>
      <url>https://code.google.com/archive/p/chesspressong/</url>
    </developer>
    <developer>
      <id>BerniMan</id>
      <name>Bernhard Seybold</name>
      <url>http://chesspresso.sourceforge.net/</url>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:https://github.com/Chessplorer/Chessplorer-Lib.git</connection>
    <developerConnection>scm:git:[fetch=]https://github.com/Chessplorer/Chessplorer-Lib.git[push=]ssh://git@github.com:Chessplorer/Chessplorer-Lib.git</developerConnection>
    <url>https://github.com/Chessplorer/Chessplorer-Lib</url>
  </scm>
  <distributionManagement>
    <snapshotRepository>
      <id>chessplorer-ossrh</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
  </distributionManagement>

  <properties>
    <createChecksum>true</createChecksum>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.releaseDir>${basedir}/release</project.releaseDir>
    <project.releaseSkip>true</project.releaseSkip>
    <maven.build.timestamp.format>yyyy-MM-dd HH:mm Z</maven.build.timestamp.format>
  </properties>

  <dependencies>
    <dependency>
      <groupId>com.google.code.findbugs</groupId>
      <artifactId>annotations</artifactId>
      <version>3.0.1u2</version>
      <scope>compile</scope>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>com.googlecode.gettext-commons</groupId>
      <artifactId>gettext-commons</artifactId>
      <version>0.9.8</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.12</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>log4j</groupId>
      <artifactId>log4j</artifactId>
      <version>1.2.17</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>1.7.21</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
      <version>1.7.21</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <resources>
      <resource>
        <directory>${project.basedir}/src/main/resources</directory>
        <filtering>true</filtering>
        <includes>
          <include>**/*.properties</include>
        </includes>
      </resource>
      <resource>
        <directory>${project.basedir}/src/main/resources</directory>
        <filtering>false</filtering>
        <excludes>
          <exclude>**/*.properties</exclude>
        </excludes>
      </resource>
    </resources>
    <testResources>
      <testResource>
        <directory>${project.basedir}/src/test/resources</directory>
        <filtering>false</filtering>
      </testResource>
    </testResources>
    <plugins>

      <!-- resources -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <version>3.0.1</version>
        <configuration>
          <encoding>${project.build.sourceEncoding}</encoding>
        </configuration>
      </plugin>

      <!-- clean -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-clean-plugin</artifactId>
        <version>3.0.0</version>
        <configuration>
          <failOnError>false</failOnError>
          <filesets>
            <fileset>
              <directory>${project.releaseDir}</directory>
              <followSymlinks>false</followSymlinks>
            </fileset>
          </filesets>
        </configuration>
      </plugin>

      <!-- compiler -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.5.1</version>
        <configuration>
          <source>1.6</source>
          <target>1.6</target>
          <showDeprecation>true</showDeprecation>
          <debug>false</debug>
          <encoding>${project.build.sourceEncoding}</encoding>
        </configuration>
      </plugin>

      <!-- source -->
      <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-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <!-- javadoc -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>2.10.4</version>
        <executions>
          <execution>
            <id>generate-javadoc-jar</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>jar</goal>
            </goals>
            <configuration>
              <skip>${project.releaseSkip}</skip>
              <quiet>true</quiet>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <!-- findbugs -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>findbugs-maven-plugin</artifactId>
        <version>3.0.3</version>
        <configuration>
          <failOnError>false</failOnError>
          <excludeFilterFile>${project.basedir}/findbugs-exclude.xml</excludeFilterFile>
        </configuration>
      </plugin>

      <!-- gettext / http://gettext-commons.googlecode.com/svn/maven2-plugins-site/plugin-info.html -->
      <plugin>
        <groupId>com.googlecode.gettext-commons</groupId>
        <artifactId>gettext-maven-plugin</artifactId>
        <version>1.2.4</version>
        <configuration>
          <targetBundle>org.chessplorer.lib.resources.Messages</targetBundle>
          <poDirectory>${project.basedir}/src/main/i18n</poDirectory>
          <outputDirectory>${project.basedir}/src/main/resources</outputDirectory>
          <outputFormat>class</outputFormat>

          <!-- set path to the gettext utilities, if they are not found automatically -->
          <!--
          <msgcatCmd>msgcat</msgcatCmd>
          <msgfmtCmd>msgfmt</msgfmtCmd>
          <msgmergeCmd>msgmerge</msgmergeCmd>
          <xgettextCmd>xgettext</xgettextCmd>
          -->
        </configuration>
        <executions>
          <execution>
            <id>i18n-generate-bundle</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>dist</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <!-- dependencies -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>2.10</version>
        <executions>
          <execution>
            <id>copy-dependency-sources</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>copy-dependencies</goal>
            </goals>
            <configuration>
              <skip>${project.releaseSkip}</skip>
              <silent>true</silent>
              <classifier>sources</classifier>
              <outputDirectory>${project.build.directory}/3rdparty</outputDirectory>
              <excludeGroupIds>com.google.code.findbugs,net.jcip</excludeGroupIds>
              <includeScope>runtime</includeScope>
            </configuration>
          </execution>
          <execution>
            <id>copy-dependency-javadoc</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>copy-dependencies</goal>
            </goals>
            <configuration>
              <skip>${project.releaseSkip}</skip>
              <silent>true</silent>
              <classifier>javadoc</classifier>
              <outputDirectory>${project.build.directory}/3rdparty</outputDirectory>
              <excludeGroupIds>com.google.code.findbugs,net.jcip</excludeGroupIds>
              <includeScope>runtime</includeScope>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <!-- assembly -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <version>2.6</version>
        <executions>
          <execution>
            <id>build-release</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <skipAssembly>${project.releaseSkip}</skipAssembly>
              <finalName>Chessplorer-Lib-${project.version}</finalName>
              <outputDirectory>${project.releaseDir}</outputDirectory>
              <appendAssemblyId>false</appendAssemblyId>
              <attach>false</attach>
              <ignoreDirFormatExtensions>true</ignoreDirFormatExtensions>
              <tarLongFileMode>gnu</tarLongFileMode>
              <descriptors>
                <descriptor>${project.basedir}/assembly.xml</descriptor>
              </descriptors>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <!-- signing before deployment -->
      <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>
            <configuration>
              <skip>${project.releaseSkip}</skip>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <!-- deployment -->
      <!--
        see http://central.sonatype.org/pages/apache-maven.html
        and http://books.sonatype.com/nexus-book/reference/staging-deployment.html
      -->
      <plugin>
        <groupId>org.sonatype.plugins</groupId>
        <artifactId>nexus-staging-maven-plugin</artifactId>
        <version>1.6.7</version>
        <extensions>true</extensions>
        <configuration>
          <serverId>chessplorer-ossrh</serverId>
          <nexusUrl>https://oss.sonatype.org/</nexusUrl>
          <autoReleaseAfterClose>true</autoReleaseAfterClose>
        </configuration>
      </plugin>

    </plugins>
  </build>

  <profiles>

    <!-- release profile -->
    <profile>
      <id>chessplorer-release</id>
      <properties>
        <project.releaseSkip>false</project.releaseSkip>
      </properties>
    </profile>

  </profiles>
</project>
