<?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-components</artifactId>
  <version>0.4.0</version>
  <packaging>pom</packaging>

  <name>Annot8 Components</name>
  <description>Components for the Annot8 Framework</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>
    <developer>
      <name>Steven Taylor</name>
      <url>https://github.com/stevenmtaylor</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/annot8-components/issues</url>
    <system>GitHub Issues</system>
  </issueManagement>

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

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

    <!-- Annot8 versions -->
    <annot8.version>0.4.0</annot8.version>

    <!-- Testing -->
    <junit.version>5.5.2</junit.version>
    <mockito.version>3.0.0</mockito.version>
    <assertj-core.version>3.13.2</assertj-core.version>
    <assertj-guava.version>3.2.1</assertj-guava.version>

    <!-- Plugins -->
    <maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
    <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
    <junit-platform-surefire-provider.version>1.3.1</junit-platform-surefire-provider.version>
    <spotless.version>1.24.1</spotless.version>
    <nexus-staging-maven-plugin.version>1.6.8</nexus-staging-maven-plugin.version>
    <jacoco-maven-plugin.version>0.8.4</jacoco-maven-plugin.version>
    <maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
    <maven-source-plugin.version>3.1.0</maven-source-plugin.version>
    <maven-javadoc-plugin.version>3.1.1</maven-javadoc-plugin.version>
    <maven-shade-plugin.version>3.2.1</maven-shade-plugin.version>
    <githook-maven-plugin.version>1.0.4</githook-maven-plugin.version>
    <!-- Logging -->
    <slf4j.version>1.7.28</slf4j.version>
  </properties>

  <dependencies>
    <dependency>
      <groupId>io.annot8</groupId>
      <artifactId>annot8-api</artifactId>
    </dependency>

    <!-- Test dependencies for all projects -->
    <dependency>
      <groupId>io.annot8</groupId>
      <artifactId>annot8-test-impl</artifactId>
    </dependency>

    <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>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-simple</artifactId>
    </dependency>
  </dependencies>

  <repositories>
    <!-- Annot8 snapshpts are stored in Sonatype -->
    <repository>
      <id>oss-sonatype</id>
      <name>oss-sonatype</name>
      <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </repository>
  </repositories>

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

          <!-- For components, enable parameters option so that Jackson can map to settings objects -->
          <parameters>true</parameters>
        </configuration>
      </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-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>

      <plugin>
        <groupId>io.github.phillipuniverse</groupId>
        <artifactId>githook-maven-plugin</artifactId>
        <version>${githook-maven-plugin.version}</version>
        <executions>
          <execution>
            <goals>
              <goal>install</goal>
            </goals>
            <configuration>
              <hooks>
<!--                <pre-commit>-->
<!--                  source ~/.bash_profile-->
<!--                  set -e-->

<!--                  REPO_ROOT_DIR="$(git rev-parse &#45;&#45;show-toplevel)"-->
<!--                  cd $REPO_ROOT_DIR-->

<!--                  java_files=$(git diff &#45;&#45;cached &#45;&#45;name-only &#45;&#45;diff-filter=ACMR | grep -Ei "\.java$" | paste -sd "," -)-->
<!--                  if [ ! -z "${java_files}" ]; then-->
<!--                  mvn spotless:apply-->
<!--                  git add "$java_files"-->
<!--                  fi-->
<!--                </pre-commit>-->
              </hooks>
            </configuration>
          </execution>
        </executions>
      </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>
  </build>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>io.annot8</groupId>
        <artifactId>annot8-api</artifactId>
        <version>${annot8.version}</version>
      </dependency>
      <!-- Common -->
      <dependency>
        <groupId>io.annot8</groupId>
        <artifactId>annot8-common-data</artifactId>
        <version>${annot8.version}</version>
      </dependency>
      <dependency>
        <groupId>io.annot8</groupId>
        <artifactId>annot8-common-components</artifactId>
        <version>${annot8.version}</version>
      </dependency>
      <dependency>
        <groupId>io.annot8</groupId>
        <artifactId>annot8-common-utils</artifactId>
        <version>${annot8.version}</version>
      </dependency>

      <!-- Implementation -->
      <dependency>
        <groupId>io.annot8</groupId>
        <artifactId>annot8-implementations-support</artifactId>
        <version>${annot8.version}</version>
      </dependency>
      <dependency>
        <groupId>io.annot8</groupId>
        <artifactId>annot8-pipeline-implementation</artifactId>
        <version>${annot8.version}</version>
      </dependency>
      <dependency>
        <groupId>io.annot8</groupId>
        <artifactId>annot8-reference-implementation</artifactId>
        <version>${annot8.version}</version>
      </dependency>

      <!-- Testing -->
      <dependency>
        <groupId>io.annot8</groupId>
        <artifactId>annot8-impl-tck</artifactId>
        <version>${annot8.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>io.annot8</groupId>
        <artifactId>annot8-test-impl</artifactId>
        <version>${annot8.version}</version>
        <scope>test</scope>
      </dependency>

      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${slf4j.version}</version>
      </dependency>


      <dependency>
        <groupId>io.annot8</groupId>
        <artifactId>annot8-conventions</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>io.annot8</groupId>
        <artifactId>annot8-components-base</artifactId>
        <version>${project.version}</version>
      </dependency>

      <!-- Utils -->
      <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>28.1-jre</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>

      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-simple</artifactId>
        <version>${slf4j.version}</version>
        <scope>test</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

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

  <modules>
    <module>annot8-conventions</module>

    <module>annot8-components-base</module>
    <module>annot8-components-cyber</module>
    <module>annot8-components-db</module>
    <module>annot8-components-files</module>
    <module>annot8-components-financial</module>
    <module>annot8-components-geo</module>
    <module>annot8-components-grouping</module>
    <module>annot8-components-image</module>
    <module>annot8-components-mongo</module>
    <module>annot8-components-opennlp</module>
    <module>annot8-components-print</module>
    <module>annot8-components-properties</module>
    <module>annot8-components-quantities</module>
    <module>annot8-components-social</module>
    <module>annot8-components-tesseract</module>
    <module>annot8-components-text</module>
<!--    <module>annot8-components-tika</module>-->
    <module>annot8-components-translation</module>
    <module>annot8-components-types</module>
  </modules>


</project>