<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<modelVersion>4.0.0</modelVersion>

<name>libcryostat</name>
<description>Library containing interfaces and basic structures for Cryostat</description>
<url>https://github.com/cryostatio/cryostat-core</url>
<inceptionYear>2024</inceptionYear>

<groupId>io.cryostat</groupId>
<artifactId>libcryostat</artifactId>

<version>4.1.0</version>
<packaging>jar</packaging>

<parent>
  <groupId>io.cryostat</groupId>
  <artifactId>cryostat-core-parent</artifactId>
  <version>4.1.0</version>
</parent>

<licenses>
  <license>
    <name>The Apache License, Version 2.0</name>
    <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
    <distribution>repo</distribution>
  </license>
</licenses>

<developers>
  <developer>
    <name>Andrew Azores</name>
    <email>aazores@redhat.com</email>
    <organization>Red Hat</organization>
    <organizationUrl>https://www.redhat.com</organizationUrl>
  </developer>
  <developer>
    <name>Elliott Baron</name>
    <email>ebaron@redhat.com</email>
    <organization>Red Hat</organization>
    <organizationUrl>https://www.redhat.com</organizationUrl>
  </developer>
</developers>

<properties>
  <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  <java.version>11</java.version>
</properties>

<dependencies>
  <dependency>
    <groupId>org.apache.commons</groupId>
    <artifactId>commons-lang3</artifactId>
  </dependency>
  <dependency>
    <groupId>commons-codec</groupId>
    <artifactId>commons-codec</artifactId>
  </dependency>
  <dependency>
    <groupId>com.github.spotbugs</groupId>
    <artifactId>spotbugs-annotations</artifactId>
    <scope>provided</scope>
  </dependency>

  <!-- test deps -->
  <dependency>
    <groupId>org.junit.jupiter</groupId>
    <artifactId>junit-jupiter-api</artifactId>
    <scope>test</scope>
  </dependency>
  <dependency>
    <groupId>org.junit.jupiter</groupId>
    <artifactId>junit-jupiter-params</artifactId>
    <scope>test</scope>
  </dependency>
  <dependency>
    <groupId>org.hamcrest</groupId>
    <artifactId>hamcrest</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>
  <dependency>
    <groupId>org.apache.commons</groupId>
    <artifactId>commons-text</artifactId>
    <scope>test</scope>
  </dependency>
</dependencies>

<build>
  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-compiler-plugin</artifactId>
    </plugin>
    <plugin>
      <groupId>io.smallrye</groupId>
      <artifactId>jandex-maven-plugin</artifactId>
      <executions>
        <execution>
          <id>make-index</id>
          <goals>
            <goal>jandex</goal>
          </goals>
        </execution>
      </executions>
    </plugin>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-surefire-plugin</artifactId>
      <configuration>
        <properties>
          <configurationParameters>
            junit.jupiter.execution.parallel.enabled=true
            junit.jupiter.execution.parallel.mode.default=same_thread
            junit.jupiter.execution.parallel.mode.classes.default=concurrent
          </configurationParameters>
        </properties>
      </configuration>
    </plugin>
    <plugin>
      <groupId>com.github.spotbugs</groupId>
      <artifactId>spotbugs-maven-plugin</artifactId>
      <configuration>
        <onlyAnalyze>io.cryostat.-</onlyAnalyze>
      </configuration>
      <executions>
        <execution>
          <id>spotbugs</id>
          <phase>verify</phase>
          <goals>
            <goal>check</goal>
          </goals>
        </execution>
      </executions>
    </plugin>
    <plugin>
      <groupId>org.jacoco</groupId>
      <artifactId>jacoco-maven-plugin</artifactId>
      <executions>
        <execution>
          <goals>
            <goal>prepare-agent</goal>
          </goals>
        </execution>
        <execution>
          <id>report</id>
          <phase>verify</phase>
          <goals>
            <goal>report</goal>
          </goals>
        </execution>
      </executions>
    </plugin>
    <plugin>
      <groupId>com.diffplug.spotless</groupId>
      <artifactId>spotless-maven-plugin</artifactId>
      <executions>
        <execution>
          <id>spotless</id>
          <phase>verify</phase>
          <goals>
            <goal>check</goal>
          </goals>
        </execution>
      </executions>
      <configuration>
        <java>
          <googleJavaFormat>
            <version>1.17.0</version>
            <style>AOSP</style>
            <reflowLongStrings>true</reflowLongStrings>
          </googleJavaFormat>
          <trimTrailingWhitespace/>
          <endWithNewline/>
          <importOrder>
            <order>java,javax,io.cryostat,</order>
          </importOrder>
          <removeUnusedImports/>
        </java>
      </configuration>
    </plugin>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-site-plugin</artifactId>
    </plugin>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-project-info-reports-plugin</artifactId>
    </plugin>
    <plugin>
      <groupId>com.mycila</groupId>
      <artifactId>license-maven-plugin</artifactId>
      <configuration>
        <licenseSets>
          <licenseSet>
            <header>LICENSE</header>
            <includes>
              <include>src/main/java/io/cryostat/**/*.java</include>
              <include>src/test/java/io/cryostat/**/*.java</include>
            </includes>
          </licenseSet>
        </licenseSets>
      </configuration>
      <executions>
        <execution>
          <id>update-license</id>
          <goals>
            <goal>check</goal>
          </goals>
          <phase>process-sources</phase>
        </execution>
      </executions>
    </plugin>
  </plugins>
</build>

<profiles>
  <profile>
    <id>release</id>
    <build>
      <plugins>
        <plugin>
          <groupId>org.jreleaser</groupId>
          <artifactId>jreleaser-maven-plugin</artifactId>
          <inherited>false</inherited>
          <configuration>
            <jreleaser>
              <signing>
                <active>ALWAYS</active>
                <armored>true</armored>
              </signing>
              <deploy>
                <maven>
                  <mavenCentral>
                    <release-deploy>
                      <active>RELEASE</active>
                      <url>https://central.sonatype.com/api/v1/publisher</url>
                      <stagingRepositories>target/staging-deploy</stagingRepositories>
                    </release-deploy>
                  </mavenCentral>
                  <nexus2>
                    <snapshot-deploy>
                      <active>SNAPSHOT</active>
                      <snapshotUrl>https://central.sonatype.com/repository/maven-snapshots/</snapshotUrl>
                      <applyMavenCentralRules>true</applyMavenCentralRules>
                      <snapshotSupported>true</snapshotSupported>
                      <closeRepository>true</closeRepository>
                      <releaseRepository>true</releaseRepository>
                      <stagingRepositories>target/staging-deploy</stagingRepositories>
                    </snapshot-deploy>
                  </nexus2>
                </maven>
              </deploy>
            </jreleaser>
          </configuration>
        </plugin>
      </plugins>
    </build>
  </profile>

  <profile>
    <id>publication</id>
    <properties>
      <altDeploymentRepository>local::file:./target/staging-deploy</altDeploymentRepository>
    </properties>
    <build>
      <defaultGoal>deploy</defaultGoal>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <executions>
            <execution>
              <id>attach-javadocs</id>
              <goals>
                <goal>jar</goal>
              </goals>
              <configuration>
                <attach>true</attach>
                <failOnError>false</failOnError>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <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>
              <configuration>
                <attach>true</attach>
              </configuration>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </build>
  </profile>
</profiles>

<reporting>
  <plugins>
    <plugin>
      <groupId>com.github.spotbugs</groupId>
      <artifactId>spotbugs-maven-plugin</artifactId>
    </plugin>
    <plugin>
      <groupId>org.jacoco</groupId>
      <artifactId>jacoco-maven-plugin</artifactId>
      <reportSets>
        <reportSet>
          <reports>
            <report>report</report>
          </reports>
        </reportSet>
      </reportSets>
    </plugin>
  </plugins>
</reporting>

</project>
