<?xml version="1.0" encoding="UTF-8"?>
<!--
  SPDX-FileCopyrightText: 2025 Stefano Chizzolini and contributors

  SPDX-License-Identifier: LGPL-3.0-only
-->
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>org.pdfclown</groupId>
    <artifactId>pdfclown-common-super</artifactId>
    <version>0.2.2</version>
    <relativePath>../pdfclown-common-super/pom.xml</relativePath>
  </parent>

  <artifactId>pdfclown-common-base</artifactId>
  <packaging>pom</packaging>

  <name>${project.artifactId}</name>
  <description>Common build configuration for pdfClown.org projects</description>

  <properties>
    <!--
      OVERRIDDEN PROPERTIES
    -->

    <!--
      VERSIONS
    -->
    <!--
      NOTE: Self-version to provide inheriting projects a handle to import corresponding
      dependencies. -->
    <pdfclown-common.version>0.2.2</pdfclown-common.version>
  </properties>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>com.diffplug.spotless</groupId>
          <artifactId>spotless-maven-plugin</artifactId>
          <dependencies>
            <!-- Common resources (configuration files) -->
            <dependency>
              <groupId>org.pdfclown</groupId>
              <artifactId>pdfclown-common-build</artifactId>
              <version>0.2.2</version>
            </dependency>
          </dependencies>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-checkstyle-plugin</artifactId>
          <dependencies>
            <!-- Common resources (configuration files) -->
            <dependency>
              <groupId>org.pdfclown</groupId>
              <artifactId>pdfclown-common-build</artifactId>
              <version>0.2.2</version>
            </dependency>
          </dependencies>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <configuration>
            <docletArtifacts
                combine.children="append">
              <!-- Common resources (stylesheets, etc) -->
              <docletArtifact>
                <groupId>org.pdfclown</groupId>
                <artifactId>pdfclown-common-build</artifactId>
                <version>0.2.2</version>
              </docletArtifact>
            </docletArtifacts>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

  <profiles>
    <!-- AUTOMATED PROFILES  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
    <profile>
      <id>unselfish</id>
      <!--
        UNSELFISH PROFILE

        Switches from self-build POM to base POM.
      -->
      <activation>
        <file>
          <missing>../pdfclown-common-base</missing>
        </file>
      </activation>
      <properties>
        <!-- Common resources from classpath -->
        <buildResourcesRootPath
            combine.self="override"/>
        <!-- Root POM context, by default -->
        <rootdir>${project.basedir}</rootdir>
      </properties>
    </profile>
  </profiles>
</project>
