<?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>

  <!-- Coordinates -->
  <groupId>se.kth.castor</groupId>
  <artifactId>depclean-parent-pom</artifactId>
  <version>2.2.0</version>
  <packaging>pom</packaging>

  <!-- Name of the parent module -->
  <name>depclean-parent-pom</name>

  <!-- Project description-->
  <description>DepClean is a tool that automatically debloats dependencies in Java projects</description>

  <!-- List of modules -->
  <modules>
    <module>depclean-core</module>
    <module>depclean-maven-plugin</module>
  </modules>

  <!-- Global properties -->
  <properties>
    <!-- Dependencies -->
    <assertj.version>3.27.7</assertj.version>
    <checkstyle.version>14.1.0</checkstyle.version>
    <commons-io.version>2.22.0</commons-io.version>
    <error_prone_core.version>2.50.0</error_prone_core.version>
    <jspecify.version>1.0.1</jspecify.version>
    <junit-jupiter.version>6.1.3</junit-jupiter.version>
    <maven-core.version>3.9.16</maven-core.version>
    <nullaway.version>0.14.1</nullaway.version>
    <slf4j-reload4j.version>2.0.18</slf4j-reload4j.version>
    <spotbugs-annotations.version>4.10.4</spotbugs-annotations.version>

    <!-- Plugins -->
    <central-publishing-maven-plugin.version>0.11.0</central-publishing-maven-plugin.version>
    <jacoco-maven-plugin.version>0.8.15</jacoco-maven-plugin.version>
    <maven-checkstyle-plugin.version>3.6.0</maven-checkstyle-plugin.version>
    <maven-compiler-plugin.version>3.16.0</maven-compiler-plugin.version>
    <maven-enforcer-plugin.version>3.6.3</maven-enforcer-plugin.version>
    <extra-enforcer-rules.version>1.12.0</extra-enforcer-rules.version>
    <maven-gpg-plugin.version>3.2.8</maven-gpg-plugin.version>
    <maven-javadoc-plugin.version>3.12.0</maven-javadoc-plugin.version>
    <maven-project-info-reports-plugin.version>3.9.0</maven-project-info-reports-plugin.version>
    <maven-release-plugin.version>3.3.1</maven-release-plugin.version>
    <maven-site-plugin.version>3.22.0</maven-site-plugin.version>
    <maven-source-plugin.version>3.4.0</maven-source-plugin.version>
    <maven-surefire-plugin.version>3.6.0</maven-surefire-plugin.version>
    <sonar-maven-plugin.version>5.7.0.6970</sonar-maven-plugin.version>
    <spotless-maven-plugin.version>3.10.1</spotless-maven-plugin.version>

    <!-- Build settings -->
    <!-- Main sources target Java 8 bytecode so the plugin runs on Maven with JDK 8+;
         tests compile and run on the modern build JDK. -->
    <java.version>8</java.version>
    <java.test.version>17</java.test.version>
    <linkXRef>false</linkXRef>
    <project.build.outputTimestamp>2026-09-04T13:25:46Z</project.build.outputTimestamp>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
  </properties>

  <!-- List of global dependencies -->
  <dependencies>
    <!-- Utils -->
    <dependency>
      <groupId>com.github.spotbugs</groupId>
      <artifactId>spotbugs-annotations</artifactId>
      <version>${spotbugs-annotations.version}</version>
      <scope>provided</scope>
    </dependency>

    <!-- Logging -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-reload4j</artifactId>
      <version>${slf4j-reload4j.version}</version>
    </dependency>

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

  <!-- Build options -->
  <build>
    <pluginManagement>
      <plugins>
        <!-- SonarCloud plugin -->
        <plugin>
          <groupId>org.sonarsource.scanner.maven</groupId>
          <artifactId>sonar-maven-plugin</artifactId>
          <version>${sonar-maven-plugin.version}</version>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>
      <!-- Maven enforcer plugin -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>${maven-enforcer-plugin.version}</version>
        <executions>
          <execution>
            <id>enforce-build-environment</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireMavenVersion>
                  <version>[3.9,)</version>
                </requireMavenVersion>
                <requireJavaVersion>
                  <version>[17,)</version>
                </requireJavaVersion>
                <enforceBytecodeVersion>
                  <maxJdkVersion>1.8</maxJdkVersion>
                  <ignoredScopes>
                    <ignoredScope>test</ignoredScope>
                    <ignoredScope>provided</ignoredScope>
                  </ignoredScopes>
                </enforceBytecodeVersion>
                <banDuplicatePomDependencyVersions></banDuplicatePomDependencyVersions>
                <reactorModuleConvergence></reactorModuleConvergence>
              </rules>
            </configuration>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>extra-enforcer-rules</artifactId>
            <version>${extra-enforcer-rules.version}</version>
          </dependency>
        </dependencies>
      </plugin>

      <!-- Maven compiler plugin -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>${maven-compiler-plugin.version}</version>
        <configuration>
          <release>${java.version}</release>
          <testRelease>${java.test.version}</testRelease>
          <fork>true</fork>
          <executable>${JAVA_HOME}/bin/javac</executable>
          <compilerArgs>
            <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg>
            <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</arg>
            <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED</arg>
            <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED</arg>
            <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED</arg>
            <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED</arg>
            <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED</arg>
            <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED</arg>
            <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg>
            <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED</arg>
            <arg>-parameters</arg>
            <!-- Targeting Java 8 is obsolete on modern JDKs; silence the warning -->
            <arg>-Xlint:-options</arg>
            <arg>--should-stop=ifError=FLOW</arg>
            <arg>-XDcompilePolicy=simple</arg>
            <!-- Required by Error Prone 2.50+ on JDK 21 -->
            <arg>-XDaddTypeAnnotationsToSymbol=true</arg>
            <arg>-Xplugin:ErrorProne -XepOpt:NullAway:AnnotatedPackages=se.kth.depclean</arg>
          </compilerArgs>
          <annotationProcessorPaths>
            <path>
              <groupId>com.google.errorprone</groupId>
              <artifactId>error_prone_core</artifactId>
              <version>${error_prone_core.version}</version>
            </path>
            <path>
              <groupId>com.uber.nullaway</groupId>
              <artifactId>nullaway</artifactId>
              <version>${nullaway.version}</version>
            </path>
          </annotationProcessorPaths>
        </configuration>
      </plugin>

      <!-- Javadoc plugin -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>${maven-javadoc-plugin.version}</version>
        <configuration>
          <source>${java.version}</source>
          <doclint>none</doclint>
        </configuration>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

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

      <!-- Maven project info -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-project-info-reports-plugin</artifactId>
        <version>${maven-project-info-reports-plugin.version}</version>
      </plugin>

      <!-- Surefire plugin -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${maven-surefire-plugin.version}</version>
        <configuration>
          <excludes>
            <exclude>**/resources/**/*.java</exclude>
          </excludes>
        </configuration>
      </plugin>

      <!-- Spotless plugin for code formatting -->
      <plugin>
        <groupId>com.diffplug.spotless</groupId>
        <artifactId>spotless-maven-plugin</artifactId>
        <version>${spotless-maven-plugin.version}</version>
        <configuration>
          <java>
            <googleJavaFormat></googleJavaFormat>
          </java>
        </configuration>
        <!-- check for latest -->
        <executions>
          <execution>
            <goals>
              <goal>apply</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <!--JaCoCo
      plugin-->
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>${jacoco-maven-plugin.version}</version>
        <executions>
          <execution>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
          </execution>
          <execution>
            <id>report</id>
            <goals>
              <goal>report</goal>
            </goals>
            <phase>prepare-package</phase>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <url>https://github.com/castor-software/depclean</url>

  <!-- License statement -->
  <licenses>
    <license>
      <name>MIT License</name>
      <url>http://www.opensource.org/licenses/mit-license.php</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <!-- List of developers -->
  <developers>
    <developer>
      <id>cesarsotovalero</id>
      <name>César Soto Valero</name>
      <email>cesarsotovlaero@gmail.com</email>
      <organization>Castor Software Research Centre</organization>
      <organizationUrl>https://www.castor.kth.se/</organizationUrl>
    </developer>
  </developers>

  <!-- SCM -->
  <scm>
    <connection>scm:git:git:github.com/castor-software/depclean.git</connection>
    <developerConnection>scm:git:git@github.com:castor-software/depclean.git</developerConnection>
    <url>https://github.com/castor-software/depclean/</url>
  </scm>

  <!-- Issues are managed on GitHub -->
  <issueManagement>
    <system>GitHub Issues</system>
    <url>https://github.com/castor-software/depclean/issues</url>
  </issueManagement>

  <!-- Releases are published to Maven Central through the Central Publisher Portal, which the
       central-publishing-maven-plugin below drives via its API rather than a deploy repository. -->
  <distributionManagement>
    <snapshotRepository>
      <id>central</id>
      <url>https://central.sonatype.com/repository/maven-snapshots/</url>
    </snapshotRepository>
  </distributionManagement>

  <profiles>
    <!-- To deploy via command line use: `mvn deploy -P deploy` -->
    <profile>
      <id>deploy</id>
      <build>
        <plugins>

          <!-- Maven source 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>

          <!-- Maven GPG plugin to sign the components -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>${maven-gpg-plugin.version}</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <goals>
                  <goal>sign</goal>
                </goals>
                <phase>verify</phase>
              </execution>
            </executions>
          </plugin>

          <!-- Central Publishing Maven plugin to publish to Maven Central via the Portal -->
          <plugin>
            <groupId>org.sonatype.central</groupId>
            <artifactId>central-publishing-maven-plugin</artifactId>
            <version>${central-publishing-maven-plugin.version}</version>
            <extensions>true</extensions>
            <configuration>
              <publishingServerId>central</publishingServerId>
              <autoPublish>true</autoPublish>
              <waitUntil>published</waitUntil>
              <deploymentName>depclean ${project.version}</deploymentName>
            </configuration>
          </plugin>

          <!-- Performing a release deployment with the Maven Release Plugin -->
          <!-- see https://central.sonatype.org/publish/publish-portal-maven/ -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-release-plugin</artifactId>
            <version>${maven-release-plugin.version}</version>
            <configuration>
              <autoVersionSubmodules>true</autoVersionSubmodules>
              <useReleaseProfile>false</useReleaseProfile>
              <releaseProfiles>release</releaseProfiles>
              <goals>deploy</goals>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>