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

   <parent>
      <groupId>com.rubensgomes.pom</groupId>
      <artifactId>root-pom</artifactId>
      <!-- 3.0-SNAPSHOT defined at .mvn/maven.config. -->
      <version>3.0-SNAPSHOT</version>
      <relativePath>../pom.xml</relativePath>
   </parent>

   <groupId>com.rubensgomes.pom.springboot</groupId>
   <artifactId>springboot-base-pom</artifactId>
   <packaging>pom</packaging>

   <name>springboot-base-pom</name>
   <description>Base Spring Boot Parent POM</description>

   <properties>
      <parent_pom_build.timestamp>Sat Jun 27 17:19:06 CDT 2026</parent_pom_build.timestamp>
   </properties>

   <!-- Spring Cloud Train BOM (Bill of Material) .......................... -->
   <dependencyManagement>
      <dependencies>
         <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-dependencies</artifactId>
            <version>${spring-cloud.version}</version>
            <type>pom</type>
            <scope>import</scope>
         </dependency>
      </dependencies>
   </dependencyManagement>

   <dependencies>
      <!-- =============== scope: optional =============================== -->
      <dependency>
         <groupId>org.springframework.boot</groupId>
         <artifactId>spring-boot-devtools</artifactId>
         <optional>true</optional>
      </dependency>
      <dependency>
         <groupId>org.springframework.boot</groupId>
         <artifactId>spring-boot-configuration-processor</artifactId>
         <optional>true</optional>
      </dependency>

      <!-- =============== scope: compile ================================== -->
      <!-- Log4J2 "Version 2" is the standard.-->
      <dependency>
         <groupId>org.springframework.boot</groupId>
         <artifactId>spring-boot-starter</artifactId>
         <exclusions>
            <exclusion>
               <groupId>org.springframework.boot</groupId>
               <artifactId>spring-boot-starter-logging</artifactId>
            </exclusion>
         </exclusions>
      </dependency>
      <dependency>
         <groupId>org.springframework.boot</groupId>
         <artifactId>spring-boot-starter-log4j2</artifactId>
      </dependency>

      <!-- =============== scope: test  ==================================== -->
      <dependency>
         <groupId>org.springframework.boot</groupId>
         <artifactId>spring-boot-starter-test</artifactId>
         <scope>test</scope>
      </dependency>

      <!-- =============== scope: runtime ================================== -->
   </dependencies>

   <build>
      <pluginManagement>
         <plugins>
            <plugin>
               <!--
                spring-boot-maven-plugin

                Repackage the built jar/war into a Spring Boot application 
                (jar or war). This plugin also provides the "build-info" goal 
                that is used to generate a "build-info.properties" file 
                (similar to "git.properties").
               -->
               <groupId>org.springframework.boot</groupId>
               <artifactId>spring-boot-maven-plugin</artifactId>
               <version>${spring-boot.version}</version>
               <configuration>
                  <mainClass>${mainClass}</mainClass>
                  <!-- build-info properties -->
                  <additionalProperties>
                     <name>${project.name}</name>
                     <description>${project.description}</description>
                     <java.source>${maven.compiler.source}</java.source>
                     <java.target>${maven.compiler.target}</java.target>
                  </additionalProperties>
                  <outputFile>${project.build.outputDirectory}/build-info.properties</outputFile>
                  <!--
                    The following configuration suspend the running Spring boot 
                    run process, and forks a new debug run to enable remote 
                    debugging.  This process happens automatically when a 
                    debugger has joined on port 8000
                  -->
                  <jvmArguments>
                     -Xdebug
                     -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
                  </jvmArguments>
                  <!--
                    The maven-failsafe-plugin (used during slow integration 
                    tests) requires the original packaged jar file to be able 
                    to test the IT test classes.  Because of that we cannot 
                    repackage the Spring Boot jar under the same name.  
                    Therefore, we must add the classifier for the Spring Boot 
                    Jar repackaged file.
                  -->
                  <classifier>exec</classifier>
               </configuration>
            </plugin>
         </plugins>
      </pluginManagement>
   </build>

   <profiles>
      <!-- "dev" profile (default profile) -->
      <profile>
         <id>dev</id>
         <activation>
            <activeByDefault>true</activeByDefault>
         </activation>
         <build>
            <plugins>
               <plugin>
                  <!-- Generate build-info.properties  -->
                  <groupId>org.springframework.boot</groupId>
                  <artifactId>spring-boot-maven-plugin</artifactId>
                  <executions>
                     <execution>
                        <id>rg-generating-springboot-build-info</id>
                        <phase>process-resources</phase>
                        <goals>
                           <goal>build-info</goal>
                        </goals>
                     </execution>
                  </executions>
               </plugin>
            </plugins>
         </build>
      </profile>

      <!-- "snap" profile -->
      <profile>
         <id>snap</id>
         <build>
            <plugins>
               <plugin>
                  <!-- Generate build-info.properties  -->
                  <groupId>org.springframework.boot</groupId>
                  <artifactId>spring-boot-maven-plugin</artifactId>
                  <executions>
                     <execution>
                        <id>rg-generating-springboot-build-info</id>
                        <phase>process-resources</phase>
                        <goals>
                           <goal>build-info</goal>
                        </goals>
                     </execution>
                  </executions>
               </plugin>
            </plugins>
         </build>
      </profile>

      <!-- "rel" profile -->
      <profile>
         <id>rel</id>
         <build>
            <plugins>
               <plugin>
                  <!-- Generate build-info.properties  -->
                  <groupId>org.springframework.boot</groupId>
                  <artifactId>spring-boot-maven-plugin</artifactId>
                  <executions>
                     <execution>
                        <id>rg-generating-springboot-build-info</id>
                        <phase>process-resources</phase>
                        <goals>
                           <goal>build-info</goal>
                        </goals>
                     </execution>
                  </executions>
               </plugin>
            </plugins>
         </build>
      </profile>
   </profiles>

</project>
