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

  <groupId>com.naharoo.commons</groupId>
  <artifactId>mapstruct-facade-spring-boot-starter</artifactId>
  <version>2.0.0</version>

  <name>MapStruct Mapping Facade</name>
  <description>Mapping Facade for popular MapStruct library mappers in Spring Boot environment</description>
  <url>https://naharoo.com/oss/mapstruct-facade-spring-boot-starter</url>

  <scm>
    <connection>scm:git:ssh://git@github.com/naharoo/mapstruct-facade-spring-boot-starter.git</connection>
    <developerConnection>scm:git:ssh://git@github.com/naharoo/mapstruct-facade-spring-boot-starter.git
    </developerConnection>
    <url>https://github.com/naharoo/mapstruct-facade-spring-boot-starter</url>
    <tag>2.0.0</tag>
  </scm>

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

  <developers>
    <developer>
      <id>naharoo</id>
      <email>codenarek@gmail.com</email>
    </developer>
  </developers>

  <properties>
    <java.version>17</java.version>
    <maven.compiler.release>${java.version}</maven.compiler.release>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

    <!--
      Tests generate CGLIB/Hibernate proxies of java.lang types (e.g. Runnable) via reflective
      ClassLoader.defineClass, which JDK 17+ strong encapsulation blocks without this opens.
      JaCoCo's prepare-agent prepends its agent to this value, preserving it.
    -->
    <argLine>--add-opens=java.base/java.lang=ALL-UNNAMED</argLine>

    <!-- Spring Boot / Framework baseline -->
    <spring.boot.version>4.1.0</spring.boot.version>

    <!-- Externally managed (not in the Spring Boot BOM) -->
    <mapstruct.version>1.6.3</mapstruct.version>
    <javassist.version>3.30.2-GA</javassist.version>

    <!-- Test-only, frozen upstream artifact -->
    <testing-toolkit.version>0.2.0</testing-toolkit.version>

    <!-- Build plugins -->
    <compiler.plugin.version>3.15.0</compiler.plugin.version>
    <surefire.plugin.version>3.5.6</surefire.plugin.version>
    <failsafe.plugin.version>3.5.6</failsafe.plugin.version>
    <jacoco.plugin.version>0.8.15</jacoco.plugin.version>
    <maven-source-plugin.version>3.4.0</maven-source-plugin.version>
    <maven-javadoc-plugin.version>3.12.0</maven-javadoc-plugin.version>
    <maven-gpg-plugin.version>3.2.8</maven-gpg-plugin.version>
    <maven-deploy-plugin.version>3.1.4</maven-deploy-plugin.version>
    <maven-release-plugin.version>3.3.1</maven-release-plugin.version>
    <maven-scm-provider-gitexe.version>2.2.1</maven-scm-provider-gitexe.version>
    <central-publishing-maven-plugin.version>0.11.0</central-publishing-maven-plugin.version>
    <spotless-maven-plugin.version>3.7.0</spotless-maven-plugin.version>
    <skip.spotless.scan>false</skip.spotless.scan>

    <!-- Static analysis -->
    <spotbugs-maven-plugin.version>4.10.2.0</spotbugs-maven-plugin.version>
    <spotbugs-annotations.version>4.10.2</spotbugs-annotations.version>
    <fb-contrib.version>7.7.4</fb-contrib.version>
    <findsecbugs-plugin.version>1.14.0</findsecbugs-plugin.version>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-dependencies</artifactId>
        <version>${spring.boot.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <dependency>
      <groupId>org.mapstruct</groupId>
      <artifactId>mapstruct</artifactId>
      <version>${mapstruct.version}</version>
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jspecify</groupId>
      <artifactId>jspecify</artifactId>
    </dependency>
    <dependency>
      <!-- @SuppressFBWarnings only; CLASS retention, not needed at runtime by consumers -->
      <groupId>com.github.spotbugs</groupId>
      <artifactId>spotbugs-annotations</artifactId>
      <version>${spotbugs-annotations.version}</version>
      <scope>provided</scope>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>org.javassist</groupId>
      <artifactId>javassist</artifactId>
      <version>${javassist.version}</version>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>org.hibernate.orm</groupId>
      <artifactId>hibernate-core</artifactId>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-test</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.naharoo.commons</groupId>
      <artifactId>testing-toolkit</artifactId>
      <version>${testing-toolkit.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <finalName>${project.artifactId}</finalName>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>com.github.spotbugs</groupId>
        <artifactId>spotbugs-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-gpg-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-deploy-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>com.diffplug.spotless</groupId>
        <artifactId>spotless-maven-plugin</artifactId>
      </plugin>
    </plugins>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>${compiler.plugin.version}</version>
          <configuration>
            <release>${java.version}</release>
            <annotationProcessorPaths>
              <path>
                <groupId>org.mapstruct</groupId>
                <artifactId>mapstruct-processor</artifactId>
                <version>${mapstruct.version}</version>
              </path>
            </annotationProcessorPaths>
          </configuration>
        </plugin>
        <plugin>
          <groupId>com.github.spotbugs</groupId>
          <artifactId>spotbugs-maven-plugin</artifactId>
          <version>${spotbugs-maven-plugin.version}</version>
          <configuration>
            <effort>Max</effort>
            <threshold>Low</threshold>
            <failOnError>true</failOnError>
            <includeTests>false</includeTests>
            <excludeFilterFile>${maven.multiModuleProjectDirectory}/spotbugs-exclude.xml</excludeFilterFile>
            <plugins>
              <plugin>
                <groupId>com.mebigfatguy.fb-contrib</groupId>
                <artifactId>fb-contrib</artifactId>
                <version>${fb-contrib.version}</version>
              </plugin>
              <plugin>
                <groupId>com.h3xstream.findsecbugs</groupId>
                <artifactId>findsecbugs-plugin</artifactId>
                <version>${findsecbugs-plugin.version}</version>
              </plugin>
            </plugins>
          </configuration>
          <executions>
            <execution>
              <id>spotbugs-check</id>
              <phase>verify</phase>
              <goals>
                <goal>check</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>com.diffplug.spotless</groupId>
          <artifactId>spotless-maven-plugin</artifactId>
          <version>${spotless-maven-plugin.version}</version>
          <configuration>
            <java>
              <eclipse>
                <!--suppress MavenModelInspection -->
                <file>${maven.multiModuleProjectDirectory}/clean-java-format.xml</file>
              </eclipse>
            </java>
            <skip>${skip.spotless.scan}</skip>
          </configuration>
          <executions>
            <execution>
              <goals>
                <goal>check</goal>
              </goals>
              <phase>test</phase>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

  <profiles>
    <profile>
      <id>development-local</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>

      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-deploy-plugin</artifactId>
              <version>${maven-deploy-plugin.version}</version>
              <configuration>
                <skip>true</skip>
              </configuration>
            </plugin>

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

            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-failsafe-plugin</artifactId>
              <version>${failsafe.plugin.version}</version>
              <configuration>
                <skip>true</skip>
              </configuration>
            </plugin>

            <plugin>
              <groupId>org.jacoco</groupId>
              <artifactId>jacoco-maven-plugin</artifactId>
              <version>${jacoco.plugin.version}</version>
              <configuration>
                <skip>true</skip>
              </configuration>
            </plugin>

            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-source-plugin</artifactId>
              <version>${maven-source-plugin.version}</version>
              <configuration>
                <skipSource>true</skipSource>
              </configuration>
            </plugin>

            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-javadoc-plugin</artifactId>
              <version>${maven-javadoc-plugin.version}</version>
              <configuration>
                <skip>true</skip>
              </configuration>
            </plugin>

            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-gpg-plugin</artifactId>
              <version>${maven-gpg-plugin.version}</version>
              <configuration>
                <skip>true</skip>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </profile>

    <profile>
      <id>ci</id>

      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-deploy-plugin</artifactId>
              <version>${maven-deploy-plugin.version}</version>
              <configuration>
                <skip>true</skip>
              </configuration>
            </plugin>

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

            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-failsafe-plugin</artifactId>
              <version>${failsafe.plugin.version}</version>
              <configuration>
                <skip>true</skip>
              </configuration>
            </plugin>

            <plugin>
              <groupId>org.jacoco</groupId>
              <artifactId>jacoco-maven-plugin</artifactId>
              <version>${jacoco.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>
                </execution>
              </executions>
            </plugin>

            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-source-plugin</artifactId>
              <version>${maven-source-plugin.version}</version>
              <configuration>
                <skipSource>true</skipSource>
              </configuration>
            </plugin>

            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-javadoc-plugin</artifactId>
              <version>${maven-javadoc-plugin.version}</version>
              <configuration>
                <skip>true</skip>
              </configuration>
            </plugin>

            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-gpg-plugin</artifactId>
              <version>${maven-gpg-plugin.version}</version>
              <configuration>
                <skip>true</skip>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </profile>

    <profile>
      <id>artifact-push</id>

      <build>
        <!--
          Active plugins for publishing. central-publishing must be declared here (not only in
          pluginManagement) so its extension takes over the deploy phase and uploads to Central.
        -->
        <plugins>
          <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>
            </configuration>
          </plugin>
        </plugins>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-deploy-plugin</artifactId>
              <version>${maven-deploy-plugin.version}</version>
              <configuration>
                <!-- Publishing is handled by the Central Portal plugin below. -->
                <skip>true</skip>
              </configuration>
            </plugin>

            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-release-plugin</artifactId>
              <version>${maven-release-plugin.version}</version>
              <configuration>
                <localCheckout>true</localCheckout>
                <pushChanges>false</pushChanges>
                <mavenExecutorId>forked-path</mavenExecutorId>
                <releaseProfiles>artifact-push</releaseProfiles>
              </configuration>
              <dependencies>
                <dependency>
                  <groupId>org.apache.maven.scm</groupId>
                  <artifactId>maven-scm-provider-gitexe</artifactId>
                  <version>${maven-scm-provider-gitexe.version}</version>
                </dependency>
              </dependencies>
            </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</goal>
                  </goals>
                </execution>
              </executions>
            </plugin>

            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-javadoc-plugin</artifactId>
              <version>${maven-javadoc-plugin.version}</version>
              <configuration>
                <encoding>UTF-8</encoding>
                <doclint>none</doclint>
              </configuration>
              <executions>
                <execution>
                  <id>attach-javadoc</id>
                  <goals>
                    <goal>jar</goal>
                  </goals>
                </execution>
              </executions>
            </plugin>

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

            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-surefire-plugin</artifactId>
              <version>${surefire.plugin.version}</version>
              <configuration>
                <skip>true</skip>
              </configuration>
            </plugin>

            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-failsafe-plugin</artifactId>
              <version>${failsafe.plugin.version}</version>
              <configuration>
                <skip>true</skip>
              </configuration>
            </plugin>

            <plugin>
              <groupId>org.jacoco</groupId>
              <artifactId>jacoco-maven-plugin</artifactId>
              <version>${jacoco.plugin.version}</version>
              <configuration>
                <skip>true</skip>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </profile>
  </profiles>

</project>
