<?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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.github.ngeor</groupId>
  <artifactId>java</artifactId>
  <version>4.9.6</version>
  <packaging>pom</packaging>
  <name>java</name>
  <description>Parent pom for Java repository</description>
  <url>https://github.com/ngeor/java</url>
  <licenses>
    <license>
      <name>MIT</name>
      <url>https://opensource.org/licenses/MIT</url>
    </license>
  </licenses>
  <developers>
    <developer>
      <name>Nikolaos Georgiou</name>
      <email>nikolaos.georgiou@gmail.com</email>
    </developer>
  </developers>
  <scm>
    <connection>scm:git:https://github.com/ngeor/java.git</connection>
    <developerConnection>scm:git:git@github.com:ngeor/java.git</developerConnection>
    <tag>v4.9.6</tag>
    <url>https://github.com/ngeor/java</url>
  </scm>
  <properties>
    <assertj-bom.version>3.27.3</assertj-bom.version>
    <central-publishing-maven-plugin.version>0.8.0</central-publishing-maven-plugin.version>
    <checkstyle-rules.version>7.0.0</checkstyle-rules.version>
    <checkstyle.version>10.13.0</checkstyle.version>
    <commons-io.version>2.15.1</commons-io.version>
    <commons-lang3.version>3.14.0</commons-lang3.version>
    <immutables.version>2.10.1</immutables.version>
    <jacoco-maven-plugin.version>0.8.12</jacoco-maven-plugin.version>
    <jacoco.unit-tests.limit.instruction-ratio>25%</jacoco.unit-tests.limit.instruction-ratio>
    <java.version>21</java.version>
    <jsr305.version>3.0.2</jsr305.version>
    <junit.version>5.11.4</junit.version>
    <maven-checkstyle-plugin.version>3.3.1</maven-checkstyle-plugin.version>
    <maven-compiler-plugin.version>3.12.1</maven-compiler-plugin.version>
    <maven-deploy-plugin.version>3.1.3</maven-deploy-plugin.version>
    <maven-enforcer-plugin.version>3.4.1</maven-enforcer-plugin.version>
    <maven-failsafe-plugin.version>3.2.5</maven-failsafe-plugin.version>
    <maven-gpg-plugin.version>3.2.7</maven-gpg-plugin.version>
    <maven-javadoc-plugin.version>3.11.2</maven-javadoc-plugin.version>
    <maven-shade-plugin.version>3.5.2</maven-shade-plugin.version>
    <maven-source-plugin.version>3.3.1</maven-source-plugin.version>
    <maven-surefire-plugin.version>3.5.2</maven-surefire-plugin.version>
    <maven.compiler.source>${java.version}</maven.compiler.source>
    <maven.compiler.target>${java.version}</maven.compiler.target>
    <mockito.version>5.10.0</mockito.version>
    <native-maven-plugin.version>0.10.1</native-maven-plugin.version>
    <palantir.version>2.39.0</palantir.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <rewrite-maven-plugin.version>5.23.1</rewrite-maven-plugin.version>
    <rewrite-static-analysis.version>1.3.1</rewrite-static-analysis.version>
    <sortpom-maven-plugin.version>4.0.0</sortpom-maven-plugin.version>
    <spotless-maven-plugin.version>2.44.2</spotless-maven-plugin.version>
  </properties>
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.assertj</groupId>
        <artifactId>assertj-bom</artifactId>
        <version>${assertj-bom.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>org.junit</groupId>
        <artifactId>junit-bom</artifactId>
        <version>${junit.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>commons-io</groupId>
        <artifactId>commons-io</artifactId>
        <version>${commons-io.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
        <version>${commons-lang3.version}</version>
      </dependency>
      <dependency>
        <groupId>org.immutables</groupId>
        <artifactId>value</artifactId>
        <version>${immutables.version}</version>
        <scope>provided</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>
  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>com.github.ekryd.sortpom</groupId>
          <artifactId>sortpom-maven-plugin</artifactId>
          <version>${sortpom-maven-plugin.version}</version>
          <configuration>
            <createBackupFile>false</createBackupFile>
            <expandEmptyElements>false</expandEmptyElements>
            <keepBlankLines>false</keepBlankLines>
            <sortProperties>true</sortProperties>
            <sortDependencies>scope</sortDependencies>
            <verifyFail>stop</verifyFail>
            <verifyFailOn>strict</verifyFailOn>
          </configuration>
        </plugin>
        <plugin>
          <groupId>com.diffplug.spotless</groupId>
          <artifactId>spotless-maven-plugin</artifactId>
          <version>${spotless-maven-plugin.version}</version>
          <configuration>
            <ratchetFrom>origin/master</ratchetFrom>
            <java>
              <palantirJavaFormat>
                <version>${palantir.version}</version>
                <style>PALANTIR</style>
              </palantirJavaFormat>
              <removeUnusedImports/>
            </java>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-gpg-plugin</artifactId>
          <version>${maven-gpg-plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.sonatype.central</groupId>
          <artifactId>central-publishing-maven-plugin</artifactId>
          <version>${central-publishing-maven-plugin.version}</version>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${maven-surefire-plugin.version}</version>
      </plugin>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>${jacoco-maven-plugin.version}</version>
        <executions>
          <execution>
            <id>prepare-agent</id>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
          </execution>
          <execution>
            <id>report</id>
            <goals>
              <goal>report</goal>
            </goals>
            <phase>test</phase>
          </execution>
          <execution>
            <id>check</id>
            <goals>
              <goal>check</goal>
            </goals>
            <phase>test</phase>
            <configuration>
              <rules>
                <rule>
                  <element>BUNDLE</element>
                  <limits>
                    <limit>
                      <counter>INSTRUCTION</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>${jacoco.unit-tests.limit.instruction-ratio}</minimum>
                    </limit>
                  </limits>
                </rule>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>${maven-source-plugin.version}</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>${maven-javadoc-plugin.version}</version>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-deploy-plugin</artifactId>
        <version>${maven-deploy-plugin.version}</version>
      </plugin>
    </plugins>
  </build>
  <reporting>
    <plugins>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>${jacoco-maven-plugin.version}</version>
        <reportSets>
          <reportSet>
            <reports>
              <report>report</report>
            </reports>
          </reportSet>
        </reportSets>
      </plugin>
    </plugins>
  </reporting>
  <profiles>
    <profile>
      <id>gpg</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <goals>
                  <goal>sign</goal>
                </goals>
                <phase>verify</phase>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.sonatype.central</groupId>
            <artifactId>central-publishing-maven-plugin</artifactId>
            <extensions>true</extensions>
            <configuration>
              <autoPublish>true</autoPublish>
              <publishingServerId>central</publishingServerId>
              <waitUntil>published</waitUntil>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>local</id>
      <activation>
        <property>
          <name>!env.CI</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>com.github.ekryd.sortpom</groupId>
            <artifactId>sortpom-maven-plugin</artifactId>
            <executions>
              <execution>
                <goals>
                  <goal>sort</goal>
                </goals>
                <phase>validate</phase>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>com.diffplug.spotless</groupId>
            <artifactId>spotless-maven-plugin</artifactId>
            <executions>
              <execution>
                <goals>
                  <goal>apply</goal>
                </goals>
                <phase>validate</phase>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>ci</id>
      <activation>
        <property>
          <name>env.GITHUB_REF_TYPE</name>
          <value>branch</value>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>com.github.ekryd.sortpom</groupId>
            <artifactId>sortpom-maven-plugin</artifactId>
            <executions>
              <execution>
                <goals>
                  <goal>verify</goal>
                </goals>
                <phase>validate</phase>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>com.diffplug.spotless</groupId>
            <artifactId>spotless-maven-plugin</artifactId>
            <executions>
              <execution>
                <goals>
                  <goal>check</goal>
                </goals>
                <phase>validate</phase>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
