<?xml version="1.0" encoding="UTF-8"?>
<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>
  <parent>
    <groupId>org.apache.opennlp</groupId>
    <artifactId>opennlp-core</artifactId>
    <version>3.0.0-M4</version>
  </parent>

  <artifactId>opennlp-runtime</artifactId>
  <packaging>jar</packaging>
  <name>Apache OpenNLP :: Core :: Runtime</name>

  <dependencies>
    <!-- Internal dependencies -->
    <dependency>
      <groupId>org.apache.opennlp</groupId>
      <artifactId>opennlp-api</artifactId>
    </dependency>

    <dependency>
      <groupId>org.apache.opennlp</groupId>
      <artifactId>opennlp-ml-commons</artifactId>
    </dependency>

    <!-- this is added here as the default ML algorithm is maxent -->
    <dependency>
      <groupId>org.apache.opennlp</groupId>
      <artifactId>opennlp-ml-maxent</artifactId>
    </dependency>

    <dependency>
      <groupId>org.apache.opennlp</groupId>
      <artifactId>opennlp-ml-perceptron</artifactId>
      <optional>true</optional>
    </dependency>

    <dependency>
      <groupId>org.apache.opennlp</groupId>
      <artifactId>opennlp-ml-bayes</artifactId>
      <optional>true</optional>
    </dependency>

    <!-- External dependencies -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
    </dependency>

    <!-- TEST scoped -->
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-api</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-engine</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-params</artifactId>
      <scope>test</scope>
    </dependency>

    <!-- JUnit5 extension used in CLITest to prevent System.exit(..) calls terminating test runs -->
    <dependency>
      <groupId>com.ginsberg</groupId>
      <artifactId>junit5-system-exit</artifactId>
      <version>${junit5-system-exit.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>io.github.hakky54</groupId>
      <artifactId>logcaptor</artifactId>
      <version>${logcaptor.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
      </resource>
    </resources>
    <plugins>
      <plugin>
        <artifactId>maven-javadoc-plugin</artifactId>
        <configuration>
          <excludePackageNames>opennlp.tools.cmdline</excludePackageNames>
        </configuration>
        <executions>
          <execution>
            <id>create-javadoc-jar</id>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <argLine>-Xmx2048m -DOPENNLP_DOWNLOAD_HOME=${opennlp.download.home} -javaagent:${settings.localRepository}/com/ginsberg/junit5-system-exit/${junit5-system-exit.version}/junit5-system-exit-${junit5-system-exit.version}.jar</argLine>
          <forkCount>${opennlp.forkCount}</forkCount>
          <failIfNoSpecifiedTests>false</failIfNoSpecifiedTests>
          <excludes>
            <exclude>**/stemmer/*</exclude>
            <exclude>**/stemmer/snowball/*</exclude>
            <exclude>**/*IT.java</exclude>
          </excludes>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
      </plugin>

    </plugins>
  </build>

  <profiles>
    <profile>
      <id>jmh</id>
      <dependencies>
        <dependency>
          <groupId>org.openjdk.jmh</groupId>
          <artifactId>jmh-core</artifactId>
          <version>${jmh.version}</version>
          <scope>test</scope>
        </dependency>

        <dependency>
          <groupId>org.openjdk.jmh</groupId>
          <artifactId>jmh-generator-annprocess</artifactId>
          <version>${jmh.version}</version>
          <scope>test</scope>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
            <version>3.6.1</version>
            <executions>
              <execution>
                <id>add-test-source</id>
                <phase>generate-test-sources</phase>
                <goals>
                  <goal>add-test-source</goal>
                </goals>
                <configuration>
                  <sources>
                    <source>src/jmh/java</source>
                  </sources>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <executions>
              <execution>
                <id>jmh-compile</id>
                <phase>test-compile</phase>
                <goals>
                  <goal>testCompile</goal>
                </goals>
                <configuration>
                  <annotationProcessorPaths>
                    <path>
                      <groupId>org.openjdk.jmh</groupId>
                      <artifactId>jmh-generator-annprocess</artifactId>
                      <version>${jmh.version}</version>
                    </path>
                  </annotationProcessorPaths>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>