<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2019 The RoboZonky Project
  ~
  ~ Licensed 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">
  <parent>
    <artifactId>robozonky</artifactId>
    <groupId>com.github.robozonky</groupId>
    <version>5.2.1</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>

  <artifactId>robozonky-api</artifactId>
  <name>RoboZonky: Public, stable APIs</name>

  <dependencies>
    <dependency> <!-- APIs for RESTEasy -->
      <groupId>jakarta.ws.rs</groupId>
      <artifactId>jakarta.ws.rs-api</artifactId>
    </dependency>
    <dependency>
      <groupId>jakarta.xml.bind</groupId>
      <artifactId>jakarta.xml.bind-api</artifactId>
      <exclusions>
        <!--
          replace with com.sun.activation:jakarta-activation, which includes the API
          otherwise there are nasty clashes between this and com.sun.mail later
          -->
        <exclusion>
          <groupId>jakarta.activation</groupId>
          <artifactId>jakarta.activation-api</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>com.sun.activation</groupId>
      <artifactId>jakarta.activation</artifactId>
    </dependency>
    <dependency> <!-- Annotations for Jackson -->
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-annotations</artifactId>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-core</artifactId>
    </dependency>
    <dependency>
      <groupId>io.vavr</groupId>
      <artifactId>vavr</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-core</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-api</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-junit-jupiter</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <executions>
          <execution>
            <id>generate-version</id>
            <goals>
              <goal>resources</goal>
            </goals>
            <phase>compile</phase>
            <configuration>
              <resources>
                <resource>
                  <directory>src/main/filtered-resources</directory>
                  <filtering>true</filtering>
                </resource>
              </resources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.revapi</groupId>
        <artifactId>revapi-maven-plugin</artifactId>
        <version>0.11.0</version>
        <dependencies>
          <dependency>
            <groupId>org.revapi</groupId>
            <artifactId>revapi-java</artifactId>
            <version>0.19.0</version>
          </dependency>
        </dependencies>
        <configuration> <!-- A.B.C or A.B.C-cr-D are considered stable versions -->
          <versionFormat>[1-9]+\.[0-9]+\.[0-9]+(\-cr\-[0-9]+)?</versionFormat>
          <analysisConfigurationFiles>
            <file>${project.basedir}/revapi.json</file>
          </analysisConfigurationFiles>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.pitest</groupId>
        <artifactId>pitest-maven</artifactId>
        <configuration>
          <targetClasses> <!-- this is a hack to be able to exclude entities, but include its sanitized subpackage -->
            <param>com.github.robozonky.api.confirmations.*</param>
            <param>com.github.robozonky.api.notifications.*</param>
            <param>com.github.robozonky.api.remote.enums.*</param>
            <param>com.github.robozonky.api.remote.entities.sanitized.*</param>
            <param>com.github.robozonky.api.strategies.*</param>
            <param>com.github.robozonky.internal.*</param>
          </targetClasses>
        </configuration>
      </plugin>
    </plugins>
  </build>

</project>
