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

  <!-- This POM is largely inspired by the one from https://github.com/vorburger/MariaDB4j -->

  <groupId>ch.vorburger</groupId>
  <artifactId>fswatch</artifactId>
  <version>1.0.0</version>
  <packaging>bundle</packaging>

  <name>ch.vorburger:fswatch</name>
  <description>Java lib for monitoring directories or individual files based on the `java.nio.file.WatchService`.</description>
  <url>https://github.com/vorburger/MariaDB4j</url>
  <inceptionYear>2015</inceptionYear>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>1.7.25</version>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-simple</artifactId>
      <version>1.7.25</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.12</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.awaitility</groupId>
      <artifactId>awaitility</artifactId>
      <version>3.0.0</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>23.6-jre</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <scm>
    <connection>https://github.com/vorburger/ch.vorburger.fswatch.git</connection>
    <developerConnection>scm:git:git@github.com:vorburger/ch.vorburger.fswatch.git</developerConnection>
    <url>https://github.com/vorburger/ch.vorburger.fswatch</url>
    <tag>HEAD</tag>
  </scm>

  <licenses>
    <license>
      <name>Apache 2</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <organization>
    <name>Michael Vorburger.ch</name>
    <url>http://www.vorburger.ch</url>
  </organization>

  <developers>
    <developer>
      <id>vorburger</id>
      <name>Michael Vorburger</name>
      <email>mike@vorburger.ch</email>
      <url>http://www.vorburger.ch</url>
    </developer>
  </developers>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <version>3.5.0</version>
        <extensions>true</extensions>
      </plugin>

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

      <plugin>
        <artifactId>maven-source-plugin</artifactId>
        <version>3.0.1</version>
        <configuration>
          <!-- This is super important (to avoid the binaries in the *-sources.jar) -->
          <excludeResources>true</excludeResources>
          <includePom>true</includePom>
        </configuration>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>3.0.0</version>
        <configuration>
          <quiet>true</quiet>
        </configuration>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <version>1.14</version>
        <configuration>
          <licenseName>apache_v2</licenseName>
          <addJavaLicenseAfterPackage>false</addJavaLicenseAfterPackage>
          <failOnMissingHeader>true</failOnMissingHeader>
          <failOnNotUptodateHeader>true</failOnNotUptodateHeader>
          <roots>
            <root>src/main/java</root>
            <root>src/test/java</root>
          </roots>
        </configuration>
        <executions>
          <execution>
            <phase>validate</phase>
            <goals>
              <goal>check-file-header</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>

    <pluginManagement>
      <plugins>
        <plugin>
          <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
          <groupId>org.eclipse.m2e</groupId>
          <artifactId>lifecycle-mapping</artifactId>
          <version>1.0.0</version>
          <configuration>
            <lifecycleMappingMetadata>
              <pluginExecutions>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>
                      org.codehaus.mojo
                    </groupId>
                    <artifactId>
                      license-maven-plugin
                    </artifactId>
                    <versionRange>
                      [1.7,)
                    </versionRange>
                    <goals>
                      <goal>
                        check-file-header
                      </goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore />
                  </action>
                </pluginExecution>
              </pluginExecutions>
            </lifecycleMappingMetadata>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

  <profiles>
    <profile>
      <id>gpg</id>
      <build>
        <plugins>
          <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>
  </profiles>

  <distributionManagement>
        <!-- http://central.sonatype.org/pages/apache-maven.html -->
    <snapshotRepository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
        <!-- <repository> isn't needed with nexus-staging-maven-plugin, it somehow
             has this hard-coded or automatically find sit somehow, IFF <version> is non-SNAPSHOT -->
  </distributionManagement>

</project>
