<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns="http://maven.apache.org/POM/4.0.0"
  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>io.annot8</groupId>
  <artifactId>annot8-parent</artifactId>
  <version>0.2.0</version>
  <packaging>pom</packaging>

  <name>Annot8 Parent</name>
  <description>Parent POM that contains common properties for all Annot8 projects</description>
  <inceptionYear>2017</inceptionYear>
  <url>http://annot8.io</url>

  <developers>
    <developer>
      <name>James Baker</name>
      <url>https://github.com/jamesdbaker</url>
    </developer>
    <developer>
      <name>Chris Flatley</name>
      <url>https://github.com/chrisflatley</url>
    </developer>
    <developer>
      <name>Stuart Hendren</name>
      <url>https://github.com/stuarthendren</url>
    </developer>
  </developers>

  <licenses>
    <license>
      <name>Apache Software License 2.0</name>
      <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
    </license>
  </licenses>

  <issueManagement>
    <url>https://github.com/annot8/parent/issues</url>
    <system>GitHub Issues</system>
  </issueManagement>

  <scm>
    <url>https://github.com/annot8/parent/</url>
    <connection>scm:git:git://github.com/annot8/parent.git</connection>
    <developerConnection>scm:git:git@github.com/annot8/parent.git</developerConnection>
  </scm>

  <properties>
    <!-- Reset to we deploy each module by default -->
    <maven.deploy.skip>false</maven.deploy.skip>
    <ossrh.serverId>ossrh-annot8</ossrh.serverId>

    <!-- Project settings -->
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <java.version>9</java.version>
    <maven.compiler.source>${java.version}</maven.compiler.source>
    <maven.compiler.target>${java.version}</maven.compiler.target>

    <!-- Annot8 versions -->
    <!-- Though we separate this into properties, they are versioned in sync at the moment -->
    <annot8.version>${project.version}</annot8.version>
    <annot8-core.version>${annot8.version}</annot8-core.version>
    <annot8-common.version>${annot8.version}</annot8-common.version>
    <annot8-components.version>${annot8.version}</annot8-components.version>
    <annot8-conventions.version>${annot8.version}</annot8-conventions.version>
    <annot8-default-impl.version>${annot8.version}</annot8-default-impl.version>
    <annot8-testing.version>${annot8.version}</annot8-testing.version>

    <!-- Core utitities and helpers -->
    <lombok.version>1.18.4</lombok.version>
    <guava.version>27.0.1-jre</guava.version>
    <slf4j.version>1.7.25</slf4j.version>
    <micrometer.version>1.1.1</micrometer.version>
    <jackson-core.version>2.9.8</jackson-core.version>
    <jackson-databind.version>2.9.8</jackson-databind.version>
    <jackson-annotations.version>2.9.8</jackson-annotations.version>
    <classgraph.version>4.6.8</classgraph.version>

    <!-- Testing -->
    <junit.version>5.3.2</junit.version>
    <mockito.version>2.23.4</mockito.version>
    <assertj-core.version>3.11.1</assertj-core.version>
    <assertj-guava.version>3.2.1</assertj-guava.version>

    <!-- Plugins -->
    <maven-surefire-plugin.version>2.22.1</maven-surefire-plugin.version>
    <maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
    <junit-platform-surefire-provider.version>1.3.1</junit-platform-surefire-provider.version>
    <spotless.version>1.17.0</spotless.version>
    <nexus-staging-maven-plugin.version>1.6.8</nexus-staging-maven-plugin.version>
    <jacoco-maven-plugin.version>0.8.2</jacoco-maven-plugin.version>
    <maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
    <maven-source-plugin.version>3.0.1</maven-source-plugin.version>
    <maven-javadoc-plugin.version>3.0.1</maven-javadoc-plugin.version>

    <!-- External versions -->
    <mongo-java-driver.version>3.9.1</mongo-java-driver.version>
  </properties>

  <dependencies>
    <!-- Test dependencies for all projects -->
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-params</artifactId>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-engine</artifactId>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-junit-jupiter</artifactId>
    </dependency>
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
    </dependency>
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-guava</artifactId>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>${maven-compiler-plugin.version}</version>
        <configuration>
          <source>${maven.compiler.source}</source>
          <target>${maven.compiler.target}</target>
          <showWarnings>true</showWarnings>
          <showDeprecation>true</showDeprecation>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${maven-surefire-plugin.version}</version>
      </plugin>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>${jacoco-maven-plugin.version}</version>
        <executions>
          <execution>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
          </execution>
          <execution>
            <id>report</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>report</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>com.diffplug.spotless</groupId>
        <artifactId>spotless-maven-plugin</artifactId>
        <version>${spotless.version}</version>

        <configuration>
          <java>
            <licenseHeader>
              <content>/* Annot8 (annot8.io) - Licensed under Apache-2.0. */</content>
            </licenseHeader>
            <googleJavaFormat />
            <removeUnusedImports />
            <importOrder>
              <order>java,javax,org,com,io.annot8,</order>
            </importOrder>
          </java>
        </configuration>

      </plugin>
    </plugins>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>${maven-source-plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>${maven-javadoc-plugin.version}</version>
          <configuration>
            <additionalJOptions>-html5</additionalJOptions>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>

    <!-- Requires for PackageCloud in the travis profile only-->
    <extensions>
      <extension>
        <groupId>io.packagecloud.maven.wagon</groupId>
        <artifactId>maven-packagecloud-wagon</artifactId>
        <version>0.0.6</version>
      </extension>
    </extensions>
  </build>

  <dependencyManagement>
    <dependencies>
      <!-- Annot8 -->
      <dependency>
        <groupId>io.annot8</groupId>
        <artifactId>annot8-core</artifactId>
        <version>${annot8-core.version}</version>
      </dependency>
      <dependency>
        <groupId>io.annot8</groupId>
        <artifactId>annot8-common-data</artifactId>
        <version>${annot8-common.version}</version>
      </dependency>
      <dependency>
        <groupId>io.annot8</groupId>
        <artifactId>annot8-common-utils</artifactId>
        <version>${annot8-common.version}</version>
      </dependency>
      <dependency>
        <groupId>io.annot8</groupId>
        <artifactId>annot8-common-jackson-serialisation</artifactId>
        <version>${annot8-common.version}</version>
      </dependency>
      <dependency>
        <groupId>io.annot8</groupId>
        <artifactId>annot8-common-pipelines</artifactId>
        <version>${annot8-common.version}</version>
      </dependency>
      <dependency>
        <groupId>io.annot8</groupId>
        <artifactId>annot8-common-implementations</artifactId>
        <version>${annot8-common.version}</version>
      </dependency>
      <dependency>
        <groupId>io.annot8</groupId>
        <artifactId>annot8-conventions</artifactId>
        <version>${annot8-conventions.version}</version>
      </dependency>
      <dependency>
        <groupId>io.annot8</groupId>
        <artifactId>annot8-components-base</artifactId>
        <version>${annot8-components.version}</version>
      </dependency>
      <dependency>
        <groupId>io.annot8</groupId>
        <artifactId>annot8-components-basic</artifactId>
        <version>${annot8-components.version}</version>
      </dependency>
      <dependency>
        <groupId>io.annot8</groupId>
        <artifactId>annot8-components-files</artifactId>
        <version>${annot8-components.version}</version>
      </dependency>
      <dependency>
        <groupId>io.annot8</groupId>
        <artifactId>annot8-components-monitor</artifactId>
        <version>${annot8-components.version}</version>
      </dependency>
      <dependency>
        <groupId>io.annot8</groupId>
        <artifactId>annot8-components-cyber</artifactId>
        <version>${annot8-components.version}</version>
      </dependency>
      <dependency>
        <groupId>io.annot8</groupId>
        <artifactId>annot8-components-grouping</artifactId>
        <version>${annot8-components.version}</version>
      </dependency>
      <dependency>
        <groupId>io.annot8</groupId>
        <artifactId>annot8-components-print</artifactId>
        <version>${annot8-components.version}</version>
      </dependency>
      <dependency>
        <groupId>io.annot8</groupId>
        <artifactId>annot8-components-social</artifactId>
        <version>${annot8-components.version}</version>
      </dependency>
      <dependency>
        <groupId>io.annot8</groupId>
        <artifactId>annot8-components-text</artifactId>
        <version>${annot8-components.version}</version>
      </dependency>
      <dependency>
        <groupId>io.annot8</groupId>
        <artifactId>annot8-default-impl</artifactId>
        <version>${annot8-default-impl.version}</version>
      </dependency>
      <dependency>
        <groupId>io.annot8</groupId>
        <artifactId>annot8-test-impl</artifactId>
        <version>${annot8-testing.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>io.annot8</groupId>
        <artifactId>annot8-impl-tck</artifactId>
        <version>${annot8-testing.version}</version>
        <scope>test</scope>
      </dependency>

      <!-- Third party -->
      <dependency>
        <groupId>org.mongodb</groupId>
        <artifactId>mongo-java-driver</artifactId>
        <version>${mongo-java-driver.version}</version>
      </dependency>

      <!-- Utilities -->
      <dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok</artifactId>
        <version>${lombok.version}</version>
      </dependency>
      <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>${guava.version}</version>
        <!-- This causes many issues with Java 9, use javax.annotations instead -->
        <exclusions>
          <exclusion>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>jsr305</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${slf4j.version}</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-simple</artifactId>
        <version>${slf4j.version}</version>
      </dependency>
      <dependency>
        <groupId>io.micrometer</groupId>
        <artifactId>micrometer-core</artifactId>
        <version>${micrometer.version}</version>
      </dependency>
      <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-core</artifactId>
        <version>${jackson-core.version}</version>
      </dependency>
      <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-databind</artifactId>
        <version>${jackson-databind.version}</version>
      </dependency>
      <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-annotations</artifactId>
        <version>${jackson-annotations.version}</version>
      </dependency>
      <dependency>
        <groupId>io.github.classgraph</groupId>
        <artifactId>classgraph</artifactId>
        <version>${classgraph.version}</version>
      </dependency>

      <!-- Testing -->
      <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter-api</artifactId>
        <version>${junit.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter-params</artifactId>
        <version>${junit.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter-engine</artifactId>
        <version>${junit.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-core</artifactId>
        <version>${mockito.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-junit-jupiter</artifactId>
        <version>${mockito.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.assertj</groupId>
        <artifactId>assertj-core</artifactId>
        <version>${assertj-core.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.assertj</groupId>
        <artifactId>assertj-guava</artifactId>
        <version>${assertj-guava.version}</version>
        <scope>test</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>



  <profiles>
    <profile>
      <id>release</id>

      <distributionManagement>
        <snapshotRepository>
          <id>${ossrh.serverId}</id>
          <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
      </distributionManagement>

      <build>
        <plugins>
          <!-- Required for deployment to Maven Central (via Sonatype OSS) -->
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>${nexus-staging-maven-plugin.version}</version>
            <extensions>true</extensions>
            <configuration>
              <serverId>${ossrh.serverId}</serverId>
              <nexusUrl>https://oss.sonatype.org/</nexusUrl>
              <autoReleaseAfterClose>true</autoReleaseAfterClose>
            </configuration>
          </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.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <additionalJOptions>-html5</additionalJOptions>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>${maven-gpg-plugin.version}</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <!-- Travis CI profile, with Coveralls and PackageCloud -->
    <profile>
      <id>travis</id>
      <repositories>
        <repository>
          <id>packagecloud-annot8</id>
          <url>https://packagecloud.io/committed/annot8/maven2</url>
          <releases>
            <!-- Don't look for releases, use Central -->
            <enabled>false</enabled>
          </releases>
          <snapshots>
            <enabled>true</enabled>
          </snapshots>
        </repository>
      </repositories>
      <distributionManagement>
          <repository>
            <id>packagecloud-annot8-releases</id>
            <url>packagecloud+https://packagecloud.io/committed/annot8-releases</url>
          </repository>
          <snapshotRepository>
            <id>packagecloud-annot8-snapshots</id>
            <url>packagecloud+https://packagecloud.io/committed/annot8</url>
          </snapshotRepository>
      </distributionManagement>
      <build>
        <plugins>
          <plugin>
            <groupId>org.eluder.coveralls</groupId>
            <artifactId>coveralls-maven-plugin</artifactId>
            <version>4.3.0</version>
            <dependencies>
              <dependency>
                <groupId>javax.xml.bind</groupId>
                <artifactId>jaxb-api</artifactId>
                <version>2.2.3</version>
              </dependency>
            </dependencies>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>