<?xml version="1.0" encoding="UTF-8"?>
<!--
  Copyright 2016 Rob Spoor

  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/xsd/maven-4.0.0.xsd">

  <modelVersion>4.0.0</modelVersion>

  <groupId>com.github.robtimus</groupId>
  <artifactId>fs-core</artifactId>
  <version>1.2</version>
  <packaging>jar</packaging>

  <name>fs-core</name>
  <description>A collection of classes that help in writing NIO.2 file systems</description>
  <url>https://robtimus.github.io/fs-core/</url>
  <inceptionYear>2016</inceptionYear>

  <licenses>
    <license>
      <name>The Apache Software License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
    </license>
  </licenses>

  <developers>
    <developer>
      <name>Rob Spoor</name>
      <email>robtimus@users.noreply.github.com</email>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:git@github.com:robtimus/fs-core.git</connection>
    <developerConnection>scm:git:git@github.com:robtimus/fs-core.git</developerConnection>
    <tag>fs-core-1.2</tag>
    <url>https://github.com/robtimus/fs-core</url>
  </scm>

  <issueManagement>
    <system>GitHub</system>
    <url>https://github.com/robtimus/fs-core/issues</url>
  </issueManagement>

  <distributionManagement>
    <repository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
    <snapshotRepository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
  </distributionManagement>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

    <version.java>1.7</version.java>

    <version.hamcrest>1.3</version.hamcrest>
    <version.junit>4.12</version.junit>
    <version.mockito>1.10.19</version.mockito>

    <version.plugin.antrun>1.8</version.plugin.antrun>
    <version.plugin.assembly>3.0.0</version.plugin.assembly>
    <version.plugin.clean>3.0.0</version.plugin.clean>
    <version.plugin.compiler>3.6.0</version.plugin.compiler>
    <version.plugin.dependency>2.10</version.plugin.dependency>
    <version.plugin.deploy>2.8.2</version.plugin.deploy>
    <version.plugin.gpg>1.6</version.plugin.gpg>
    <version.plugin.info-reports>2.9</version.plugin.info-reports>
    <version.plugin.install>2.5.2</version.plugin.install>
    <!-- do not use 3.0.1 or 3.0.2 to prevent error "org.codehaus.plexus.archiver.jar.Manifest.write(java.io.PrintWriter)" -->
    <version.plugin.jar>3.0.0</version.plugin.jar>
    <version.plugin.javadoc>2.10.4</version.plugin.javadoc>
    <version.plugin.release>2.5.3</version.plugin.release>
    <version.plugin.resources>3.0.2</version.plugin.resources>
    <version.plugin.site>3.6</version.plugin.site>
    <version.plugin.source>3.0.1</version.plugin.source>
    <version.plugin.surefire>2.19.1</version.plugin.surefire>
  </properties>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${version.junit}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-library</artifactId>
      <version>${version.hamcrest}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-all</artifactId>
      <version>${version.mockito}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <resources>
      <!-- add LICENSE.txt to META-INF besides the main resources -->
      <resource>
        <directory>src/main/resources</directory>
      </resource>
      <resource>
        <directory>${basedir}</directory>
        <targetPath>META-INF</targetPath>
        <includes>
          <include>LICENSE.txt</include>
        </includes>
      </resource>
    </resources>

    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>${version.plugin.javadoc}</version>
          <configuration>
            <charset>UTF-8</charset>
            <docencoding>UTF-8</docencoding>
            <splitindex>true</splitindex>
            <author>true</author>
            <version>true</version>
            <notimestamp>true</notimestamp>
            <links>
              <!-- Use an HTTPS URL to the JSE docs -->
              <link>https://docs.oracle.com/javase/8/docs/api/</link>
            </links>
          </configuration>
        </plugin>

        <!-- this plugin is required to make Eclipse lifecycle errors disappear -->
        <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-antrun-plugin</artifactId>
                    <versionRange>[1.0,)</versionRange>
                    <goals>
                      <goal>run</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore />
                  </action>
                </pluginExecution>
              </pluginExecutions>
            </lifecycleMappingMetadata>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>${version.plugin.compiler}</version>
        <configuration>
          <source>${version.java}</source>
          <target>${version.java}</target>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>${version.plugin.dependency}</version>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>${version.plugin.jar}</version>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>${version.plugin.source}</version>
        <executions>
          <execution>
            <phase>verify</phase>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <version>${version.plugin.resources}</version>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <executions>
          <execution>
            <phase>verify</phase>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-antrun-plugin</artifactId>
        <version>${version.plugin.antrun}</version>
        <executions>
          <execution>
            <id>copy-license</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <target>
                <copy todir="${project.build.directory}/apidocs/META-INF">
                  <fileset dir="${basedir}">
                    <include name="LICENSE.txt" />
                  </fileset>
                </copy>
              </target>
            </configuration>
          </execution>
          <execution>
            <id>copy-readme</id>
            <phase>pre-site</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <target>
                <concat destfile="${basedir}/src/site/markdown/index.md">
                  <fileset file="${basedir}/src/site/markdown/index.header.md" />
                  <fileset file="${basedir}/README.md" />
                </concat>
                <replaceregexp file="${basedir}/src/site/markdown/index.md" match="${project.url}" replace="" flags="g" />
              </target>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <version>${version.plugin.assembly}</version>
        <configuration>
          <descriptors>
            <descriptor>src/main/assembly/src.xml</descriptor>
            <descriptor>src/main/assembly/bin.xml</descriptor>
          </descriptors>
          <attach>false</attach>
        </configuration>
        <executions>
          <execution>
            <phase>verify</phase>
            <goals>
              <goal>single</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-clean-plugin</artifactId>
        <version>${version.plugin.clean}</version>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${version.plugin.surefire}</version>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-install-plugin</artifactId>
        <version>${version.plugin.install}</version>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <version>${version.plugin.release}</version>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-gpg-plugin</artifactId>
        <version>${version.plugin.gpg}</version>
        <executions>
          <execution>
            <phase>verify</phase>
            <goals>
              <goal>sign</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-deploy-plugin</artifactId>
        <version>${version.plugin.deploy}</version>
        <executions>
          <execution>
            <phase>deploy</phase>
            <goals>
              <goal>deploy</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
        <version>${version.plugin.site}</version>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-project-info-reports-plugin</artifactId>
        <version>${version.plugin.info-reports}</version>
      </plugin>
    </plugins>
  </build>

  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-project-info-reports-plugin</artifactId>
        <version>${version.plugin.info-reports}</version>
        <reportSets>
          <reportSet>
            <reports>
              <report>summary</report>
              <report>dependency-info</report>
              <report>dependencies</report>
              <report>license</report>
              <report>project-team</report>
              <report>scm</report>
              <report>issue-tracking</report>
            </reports>
          </reportSet>
        </reportSets>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>${version.plugin.javadoc}</version>
        <reportSets>
          <reportSet>
            <reports>
              <report>javadoc</report>
            </reports>
          </reportSet>
        </reportSets>
      </plugin>
    </plugins>
  </reporting>
</project>
