<?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>1.2.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>

  <distributionManagement>
    <snapshotRepository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
    <repository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
  </distributionManagement>

  <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-api.version>1.1</annot8-api.version>
    <annot8-implementation.version>1.1.0</annot8-implementation.version>

    <!-- Utils -->
    <guava.version>30.1.1-jre</guava.version>

    <!-- Testing -->
    <junit.version>5.7.2</junit.version>
    <mockito.version>3.10.0</mockito.version>
    <assertj-core.version>3.19.0</assertj-core.version>
    <assertj-guava.version>3.4.0</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.2</junit-platform-surefire-provider.version>
    <speedy-spotless-maven-plugin.version>0.1.3</speedy-spotless-maven-plugin.version>
    <nexus-staging-maven-plugin.version>1.6.8</nexus-staging-maven-plugin.version>
    <jacoco-maven-plugin.version>0.8.7</jacoco-maven-plugin.version>
    <maven-gpg-plugin.version>3.0.1</maven-gpg-plugin.version>
    <maven-source-plugin.version>3.2.1</maven-source-plugin.version>
    <maven-javadoc-plugin.version>3.3.0</maven-javadoc-plugin.version>
    <maven-shade-plugin.version>3.2.4</maven-shade-plugin.version>
    <githook-maven-plugin.version>1.0.5</githook-maven-plugin.version>
    <!-- Logging -->
    <slf4j.version>1.7.30</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>${nexus-staging-maven-plugin.version}</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>io.committed</groupId>
        <artifactId>speedy-spotless-maven-plugin</artifactId>
        <version>${speedy-spotless-maven-plugin.version}</version>
        <executions>
          <execution>
            <id>install-formatter-hook</id>
            <goals>
              <goal>install-hooks</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <java>
            <licenseHeader>
              <content>/* Annot8 (annot8.io) - Licensed under Apache-2.0. */</content>
            </licenseHeader>
            <googleJavaFormat />
            <removeUnusedImports />
          </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>
  </build>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>io.annot8</groupId>
        <artifactId>annot8-api</artifactId>
        <version>${annot8-api.version}</version>
      </dependency>

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

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

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

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

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

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

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

  <profiles>
    <profile>
      <!-- This profile is used to deploy to Maven central -->
      <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>
                <!-- Javadoc and Java Modules seem not to play well together -->
                <!-- Allow errors which is not ideal, but seems necessary -->
                <configuration>
                  <failOnError>false</failOnError>
                </configuration>
              </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>
    <profile>
      <id>plugins</id>
      <!-- This profile is used to build JAR which contain all dependencies -->
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-shade-plugin</artifactId>
            <version>${maven-shade-plugin.version}</version>
            <executions>
              <execution>
                <phase>package</phase>
                <goals>
                  <goal>shade</goal>
                </goals>
                <configuration>
                  <shadedClassifierName>plugin</shadedClassifierName>
                  <artifactSet>
                    <excludes>
                      <exclude>io.annot8:annot8-api</exclude>
                      <exclude>io.annot8:annot8-implementations</exclude>
                      <exclude>io.annot8:annot8-implementations-support</exclude>
                      <exclude>io.annot8:annot8-pipeline-implementation</exclude>
                      <exclude>io.annot8:annot8-reference-implementation</exclude>
                    </excludes>
                  </artifactSet>
                  <shadedArtifactAttached>true</shadedArtifactAttached>
                  <outputDirectory>${maven.multiModuleProjectDirectory}/target</outputDirectory>
                  <filters>
                    <filter>
                      <!-- filter out signature files from signed dependencies, else repackaging fails with security ex -->
                      <artifact>*:*</artifact>
                      <excludes>
                        <exclude>META-INF/*.SF</exclude>
                        <exclude>META-INF/*.DSA</exclude>
                        <exclude>META-INF/*.RSA</exclude>
                      </excludes>
                    </filter>
                  </filters>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>

      </build>
    </profile>
  </profiles>

  <modules>
    <module>annot8-conventions</module>
    <module>annot8-components-annotations</module>
    <module>annot8-components-audio</module>
    <module>annot8-components-base</module>
    <module>annot8-components-base-text</module>
    <module>annot8-components-comms</module>
    <module>annot8-components-cyber</module>
    <module>annot8-components-db</module>
    <module>annot8-components-documents</module>
    <module>annot8-components-elasticsearch</module>
    <module>annot8-components-files</module>
    <module>annot8-components-financial</module>
    <module>annot8-components-gazetteers</module>
    <module>annot8-components-geo</module>
    <module>annot8-components-grouping</module>
    <module>annot8-components-groups</module>
    <module>annot8-components-image</module>
    <module>annot8-components-items</module>
    <module>annot8-components-kafka</module>
    <module>annot8-components-mongo</module>
    <module>annot8-components-opencv</module>
    <module>annot8-components-opennlp</module>
    <module>annot8-components-print</module>
    <module>annot8-components-people</module>
    <module>annot8-components-properties</module>
    <module>annot8-components-quantities</module>
    <module>annot8-components-social</module>
    <module>annot8-components-spacy</module>
    <module>annot8-components-stopwords</module>
    <module>annot8-components-temporal</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>
    <module>annot8-components-vehicles</module>
    <module>annot8-components-wordnet</module>
    <module>annot8-utils-text</module>
  </modules>
</project>
