<?xml version="1.0" encoding="UTF-8"?>

<!--
   Licensed to the Apache Software Foundation (ASF) under one
   or more contributor license agreements.  See the NOTICE file
   distributed with this work for additional information
   regarding copyright ownership.  The ASF licenses this file
   to you under the Apache License, Version 2.0 (the
   "License"); you may not use this file except in compliance
   with the License.  You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing,
   software distributed under the License is distributed on an
   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
   KIND, either express or implied.  See the License for the
   specific language governing permissions and limitations
   under the License.
-->

<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-model-resolver</artifactId>
  <packaging>jar</packaging>
  <name>Apache OpenNLP :: Core :: Model Resolver</name>

  <dependencies>
    <!-- Internal dependencies -->
    <dependency>
      <artifactId>opennlp-api</artifactId>
      <groupId>${project.groupId}</groupId>
    </dependency>
    <dependency>
      <groupId>org.apache.opennlp</groupId>
      <artifactId>opennlp-runtime</artifactId>
      <scope>provided</scope>
    </dependency>

    <!-- External dependencies -->
    <dependency>
      <groupId>io.github.classgraph</groupId>
      <artifactId>classgraph</artifactId>
      <version>${classgraph.version}</version>
      <optional>true</optional>
    </dependency>

    <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.slf4j</groupId>
      <artifactId>slf4j-simple</artifactId>
      <scope>test</scope>
    </dependency>

    <!-- TEST Models -->
    <dependency>
      <groupId>org.apache.opennlp</groupId>
      <artifactId>opennlp-models-sentdetect-en</artifactId>
      <version>${opennlp.models.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.opennlp</groupId>
      <artifactId>opennlp-models-tokenizer-en</artifactId>
      <version>${opennlp.models.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.opennlp</groupId>
      <artifactId>opennlp-models-pos-en</artifactId>
      <version>${opennlp.models.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.opennlp</groupId>
      <artifactId>opennlp-models-langdetect</artifactId>
      <version>${opennlp.models.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <forkCount>${opennlp.forkCount}</forkCount>
          <useSystemClassLoader>false</useSystemClassLoader>
          <failIfNoSpecifiedTests>false</failIfNoSpecifiedTests>
        </configuration>
        <executions>
          <execution>
            <id>with-reflection</id>
            <goals>
              <goal>test</goal>
            </goals>
            <configuration>
              <argLine>-Xmx2048m -Dorg.slf4j.simpleLogger.defaultLogLevel=off --add-opens java.base/jdk.internal.loader=ALL-UNNAMED</argLine>
            </configuration>
          </execution>
          <!-- This phase is here to trigger a fallback to the classpath from the system properties, which cannot be hit, if add-opens is present. -->
          <execution>
            <id>no-reflection</id>
            <goals>
              <goal>test</goal>
            </goals>
            <configuration>
              <argLine>-Xmx2048m -Dorg.slf4j.simpleLogger.defaultLogLevel=off</argLine>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>