<?xml version="1.0"?>
<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>

  <groupId>eu.mulk</groupId>
  <artifactId>aendggner</artifactId>
  <version>${revision}</version>

  <properties>
    <maven.compiler.parameters>true</maven.compiler.parameters>
    <maven.compiler.release>21</maven.compiler.release>

    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

    <enforced.maven-version>3.9.0</enforced.maven-version>

    <compiler-plugin.version>3.15.0</compiler-plugin.version>
    <dependency-plugin.version>3.11.0</dependency-plugin.version>
    <enforcer-plugin.version>3.6.3</enforcer-plugin.version>
    <exec-plugin.version>3.6.3</exec-plugin.version>
    <jar-plugin.version>3.5.0</jar-plugin.version>
    <resources-plugin.version>3.5.0</resources-plugin.version>
    <spotless-plugin.version>3.8.0</spotless-plugin.version>
    <surefire-plugin.version>3.5.6</surefire-plugin.version>

    <google.java.format.version>1.28.0</google.java.format.version>

    <assertj.version>3.27.7</assertj.version>
    <java-diff-utils.version>4.17</java-diff-utils.version>
    <jboss-logging.version>3.6.3.Final</jboss-logging.version>
    <jspecify.version>1.0.0</jspecify.version>
    <junit.version>5.13.4</junit.version>
    <pdfbox.version>3.0.8</pdfbox.version>
    <picocli.version>4.7.7</picocli.version>
    <slf4j.version>2.0.18</slf4j.version>
    <tika.version>3.3.1</tika.version>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.junit</groupId>
        <artifactId>junit-bom</artifactId>
        <version>${junit.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>

    <!-- Annotations -->
    <dependency>
      <groupId>org.jspecify</groupId>
      <artifactId>jspecify</artifactId>
      <version>${jspecify.version}</version>
    </dependency>

    <!-- Command line parsing -->
    <dependency>
      <groupId>info.picocli</groupId>
      <artifactId>picocli</artifactId>
      <version>${picocli.version}</version>
    </dependency>

    <!-- Logging -->
    <dependency>
      <groupId>org.jboss.logging</groupId>
      <artifactId>jboss-logging</artifactId>
      <version>${jboss-logging.version}</version>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-jdk14</artifactId>
      <version>${slf4j.version}</version>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>jcl-over-slf4j</artifactId>
      <version>${slf4j.version}</version>
    </dependency>

    <!-- Document type detection -->
    <dependency>
      <groupId>org.apache.tika</groupId>
      <artifactId>tika-core</artifactId>
      <version>${tika.version}</version>
    </dependency>

    <!-- PDF text extraction -->
    <dependency>
      <groupId>org.apache.pdfbox</groupId>
      <artifactId>pdfbox</artifactId>
      <version>${pdfbox.version}</version>
    </dependency>

    <!-- Text diffing -->
    <dependency>
      <groupId>io.github.java-diff-utils</groupId>
      <artifactId>java-diff-utils</artifactId>
      <version>${java-diff-utils.version}</version>
    </dependency>

    <!-- Testing -->
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <version>${assertj.version}</version>
      <scope>test</scope>
    </dependency>

  </dependencies>

  <build>

    <resources>
      <resource>
        <directory>src/main/resources</directory>
      </resource>
    </resources>

    <pluginManagement>
      <plugins>

        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>versions-maven-plugin</artifactId>
          <configuration>
            <generateBackupPoms>false</generateBackupPoms>
          </configuration>
        </plugin>

      </plugins>
    </pluginManagement>

    <plugins>

      <!-- Compiler -->
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>${compiler-plugin.version}</version>
        <configuration>
          <annotationProcessorPaths>
            <path>
              <groupId>info.picocli</groupId>
              <artifactId>picocli-codegen</artifactId>
              <version>${picocli.version}</version>
            </path>
          </annotationProcessorPaths>
          <compilerArgs>
            <arg>-Aproject=${project.groupId}/${project.artifactId}</arg>
          </compilerArgs>
        </configuration>
      </plugin>

      <!-- Resources -->
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <version>${resources-plugin.version}</version>
      </plugin>

      <!-- Tests -->
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${surefire-plugin.version}</version>
      </plugin>

      <!-- Google Java Code Formatter, for enforcing style conventions -->
      <plugin>
        <groupId>com.diffplug.spotless</groupId>
        <artifactId>spotless-maven-plugin</artifactId>
        <version>${spotless-plugin.version}</version>
        <configuration>
          <java>
            <removeUnusedImports/>
            <importOrder>
              <order>java,javax,org,com,de,io,dagger,eu.mulk,</order>
            </importOrder>
            <googleJavaFormat>
              <version>${google.java.format.version}</version>
              <style>GOOGLE</style>
            </googleJavaFormat>
          </java>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>${enforcer-plugin.version}</version>
        <executions>
          <execution>
            <id>enforce-maven</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireMavenVersion>
                  <version>${enforced.maven-version}</version>
                </requireMavenVersion>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>${exec-plugin.version}</version>
        <configuration>
          <mainClass>eu.mulk.aendggner.AendGgner</mainClass>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>${dependency-plugin.version}</version>
        <executions>
          <execution>
            <id>copy-dependencies</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>copy-dependencies</goal>
            </goals>
            <configuration>
              <outputDirectory>
                ${project.build.directory}/libs
              </outputDirectory>
              <includeScope>runtime</includeScope>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>${jar-plugin.version}</version>
        <configuration>
          <archive>
            <manifest>
              <addClasspath>true</addClasspath>
              <classpathPrefix>libs/</classpathPrefix>
              <mainClass>
                eu.mulk.aendggner.AendGgner
              </mainClass>
            </manifest>
          </archive>
        </configuration>
      </plugin>

    </plugins>

  </build>

</project>
