<?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>com.redhat.insights</groupId>
    <artifactId>runtimes-java</artifactId>
    <version>2.0.3</version>
  </parent>

  <artifactId>runtimes-java-api</artifactId>

  <properties>
    <maven.compiler.release>8</maven.compiler.release>
    <maven.compiler.source>8</maven.compiler.source>
    <maven.compiler.target>8</maven.compiler.target>
  </properties>

  <dependencies>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-core</artifactId>
    </dependency>

    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
    </dependency>

    <dependency>
      <groupId>com.fasterxml.jackson.datatype</groupId>
      <artifactId>jackson-datatype-jsr310</artifactId>
    </dependency>

    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-annotations</artifactId>
    </dependency>

    <dependency>
      <groupId>org.wildfly.security</groupId>
      <artifactId>wildfly-elytron-x500-cert</artifactId>
    </dependency>

    <!-- Test dependencies -->

    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>javax.servlet-api</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>javax.servlet.jsp</groupId>
      <artifactId>javax.servlet.jsp-api</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.awaitility</groupId>
      <artifactId>awaitility</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>uk.org.webcompere</groupId>
      <artifactId>system-stubs-jupiter</artifactId>
      <scope>test</scope>
    </dependency>

  </dependencies>
  <build>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${maven-surefire-plugin.version}</version>
      </plugin>

      <plugin>
        <groupId>com.diffplug.spotless</groupId>
        <artifactId>spotless-maven-plugin</artifactId>
        <version>${spotless-maven-plugin.version}</version>
        <configuration>
          <skip>${skip.spotless}</skip>
          <!-- optional: limit format enforcement to just the files changed by this feature branch -->
          <ratchetFrom>origin/main</ratchetFrom>
          <formats>
            <!-- you can define as many formats as you want, each is independent -->
            <format>
              <!-- define the files to apply to -->
              <includes>
                <include>*.md</include>
                <include>.gitignore</include>
              </includes>
              <!-- define the steps to apply to those files -->
              <trimTrailingWhitespace></trimTrailingWhitespace>
              <endWithNewline></endWithNewline>
              <indent>
                <tabs>true</tabs>
                <spacesPerTab>4</spacesPerTab>
              </indent>
            </format>
          </formats>
          <!-- define a language-specific format -->
          <java>
            <!-- no need to specify files, inferred automatically, but you can if you want -->

            <!-- apply a specific flavor of google-java-format and reflow long strings -->
            <googleJavaFormat>
              <version>${google-java-format.version}</version>
              <style>GOOGLE</style>
              <reflowLongStrings>true</reflowLongStrings>
              <groupArtifact>com.google.googlejavaformat:google-java-format</groupArtifact>
            </googleJavaFormat>

            <!-- make sure every file has the following copyright header.
			           optionally, Spotless can set copyright years by digging
			           through git history (see "license" section below) -->
            <licenseHeader>
              <content>/* Copyright (C) Red Hat $YEAR */</content>
              <!-- or <file>${project.basedir}/license-header</file> -->
            </licenseHeader>
          </java>
          <pom>
            <includes>
              <include>pom.xml</include>
            </includes>
            <sortPom></sortPom>
          </pom>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>check</goal>
            </goals>
            <phase>compile</phase>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>test-jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

    </plugins>

  </build>
</project>
