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

   <!--  
     This POM follows the Maven POM Model as defined at:
     https://maven.apache.org/ref/3.8.1/maven-model/maven.html

     Author: Rubens Gomes
    -->

   <modelVersion>4.0.0</modelVersion>

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

   <name>root-pom</name>
   <description>Maven Root POM: The Parent of All POMs</description>
   <url>https://github.com/rubensgomes/maven-parent-pom</url>
   <inceptionYear>2022</inceptionYear>
   <organization>
      <name>Rubens Gomes</name>
      <url>https://rubensgomes.com</url>
   </organization>

   <developers>
      <developer>
         <name>Rubens Gomes</name>
         <email>rubens.s.gomes@gmail.com</email>
         <organization>Rubens Gomes</organization>
         <roles>
            <role>architect</role>
            <role>developer</role>
         </roles>
         <timezone>America/Chicago</timezone>
      </developer>
   </developers>

   <modules>
      <module>library</module>
      <module>springboot</module>
      <module>springboot/app</module>
      <module>springboot/library</module>
      <module>springboot/webapp</module>
   </modules>

   <scm>
      <connection>scm:git:https://github.com/rubensgomes/maven-parent-pom</connection>
      <url>https://github.com/rubensgomes/maven-parent-pom</url>
   </scm>

   <!--  distributionManagement tells Maven where to *upload* to -->
   <distributionManagement>
      <!--  I created these repos to store the built maven parent pom jars -->
      <repository>
         <id>myMavenRepo.release.repo</id>
         <url>https://mymavenrepo.com/repo/7FlqHiEzj6RRvMdznYj0/</url>
      </repository>
      <snapshotRepository>
         <id>myMavenRepo.snapshot.repo</id>
         <url>https://mymavenrepo.com/repo/7FlqHiEzj6RRvMdznYj0/</url>
      </snapshotRepository>
   </distributionManagement>

   <properties>
      <mainClass>TO_BE_DEFINED_IN_APPLICATION_POM</mainClass>

      <!-- ATTENTION: revision property value is overriden during the build -->
      <revision>2.x-SNAPSHOT</revision>
      <parent_pom_build.timestamp>Sat Jun 27 18:06:56 CDT 2026</parent_pom_build.timestamp>

      <java.version>25</java.version>
      <maven.compiler.source>${java.version}</maven.compiler.source>
      <maven.compiler.target>${java.version}</maven.compiler.target>

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

      <!-- Set initial size of 1GBytes of heap memory to run tests          -->
      <argLine>-Xmx1024m</argLine>

      <build-tools-core.version>2.0</build-tools-core.version>

      <!-- ...................... BOMs (begin) ............................. -->

      <!-- 
           NOTE: Spring Cloud Train must be compatible with Spring Boot release.
           See Table 1. Release train Spring Boot compatibility at:
           https://spring.io/projects/spring-cloud
      -->

      <!-- Spring Boot BOM + Spring Cloud Train  -->
      <spring-boot.version>3.5.16</spring-boot.version>
      <spring-cloud.version>2025.0.3</spring-cloud.version>

      <!-- Spring Cloud Function BOM  -->
      <spring-cloud-function.version>4.3.9</spring-cloud-function.version>

      <!-- Guava BOM -->
      <guava-bom.version>33.6.0-jre</guava-bom.version>

      <!-- HttpComponents Client Parent BOM -->
      <httpclient5-parent.version>5.6.1</httpclient5-parent.version>
      <!-- httpclient5.version is a Managed Dependency Coordinates -->
      <httpclient5.version>${httpclient5-parent.version}</httpclient5.version>

      <!-- Jackson BOM -->
      <!-- jackson-bom.version is a Managed Dependency Coordinates -->
      <jackson-bom.version>2.22.0</jackson-bom.version>

      <!-- Jetty BOM -->
      <!-- jetty.version is a Managed Dependency Coordinates -->
      <jetty.version>12.1.10</jetty.version>

      <!-- JUnit5 BOM -->
      <junit-bom.version>5.14.4</junit-bom.version>

      <!-- Log4j2 BOM -->
      <log4j-bom.version>2.26.0</log4j-bom.version>
      <!-- log4j2.version is a Managed Dependency Coordinates -->
      <log4j2.version>${log4j-bom.version}</log4j2.version>

      <!-- Struts2 BOM -->
      <struts2-bom.version>7.1.1</struts2-bom.version>
      <!-- ...................... BOMs (end)................................ -->

      <!-- .............. Common Library Versions (begin) .................. -->
      <!-- Library versions -->
      <commons-beanutils.version>1.11.0</commons-beanutils.version>
      <commons-cli.version>1.11.0</commons-cli.version>
      <commons-configuration.version>1.10</commons-configuration.version>
      <commons-configuration2.version>2.15.1</commons-configuration2.version>
      <commons-csv.version>1.14.1</commons-csv.version>
      <commons-digester3.version>3.2</commons-digester3.version>
      <commons-io.version>2.22.0</commons-io.version>
      <!-- commons-lang3.version is a Managed Dependency Coordinates -->
      <commons-lang3.version>3.20.0</commons-lang3.version>
      <commons-text.version>1.15.0</commons-text.version>
      <commons-validator.version>1.10.1</commons-validator.version>
      <gson.version>2.14.0</gson.version>
      <joda-time.version>2.14.2</joda-time.version>
      <!-- log4j-slf4j-impl.version is a Managed Dependency Coordinates -->
      <log4j-slf4j-impl.version>${log4j-bom.version}</log4j-slf4j-impl.version>
      <!-- slf4j.version is a Managed Dependency Coordinates -->
      <slf4j.version>2.0.18</slf4j.version>
      <!-- jcl-over-slf4j.version is a Managed Dependency Coordinates -->
      <jcl-over-slf4j.version>${slf4j.version}</jcl-over-slf4j.version>
      <!-- jul-to-slf4j.version is a Managed Dependency Coordinates -->
      <jul-to-slf4j.version>${slf4j.version}</jul-to-slf4j.version>
      <springdoc.version>2.8.6</springdoc.version>
      <!-- .............. Common Library Versions (end)  ................... -->

      <!-- .............. Maven Plugin Versions (begin) .................... -->
      <flatten-maven-plugin.version>1.7.3</flatten-maven-plugin.version>
      <formatter-maven-plugin.version>2.29.0</formatter-maven-plugin.version>
      <git-commit-id-maven-plugin.version>10.0.0</git-commit-id-maven-plugin.version>
      <jacoco.version>0.8.15</jacoco.version>
      <maven-clean-plugin.version>3.5.0</maven-clean-plugin.version>
      <maven-compiler-plugin.version>3.15.0</maven-compiler-plugin.version>
      <maven-deploy-plugin.version>3.1.4</maven-deploy-plugin.version>
      <maven-enforcer-plugin.version>3.6.3</maven-enforcer-plugin.version>
      <maven-failsafe-plugin.version>3.5.6</maven-failsafe-plugin.version>
      <maven-help-plugin.version>3.5.1</maven-help-plugin.version>
      <maven-install-plugin.version>3.1.1</maven-install-plugin.version>
      <maven-jar-plugin.version>3.5.0</maven-jar-plugin.version>
      <maven-resources-plugin.version>3.5.0</maven-resources-plugin.version>
      <maven-site-plugin.version>3.22.0</maven-site-plugin.version>
      <maven-source-plugin.version>3.5.6</maven-source-plugin.version>
      <maven-surefire-plugin.version>3.1.2</maven-surefire-plugin.version>
      <maven-war-plugin.version>3.5.1</maven-war-plugin.version>
      <spring-plugin-core.version>4.1.0</spring-plugin-core.version>
      <springdoc-openapi-maven-plugin.version>1.5</springdoc-openapi-maven-plugin.version>
      <!-- .............. Maven Plugin Versions (end) ...................... -->
   </properties>

   <dependencyManagement>
      <dependencies>
         <!-- Guava BOM .................................................... -->
         <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava-bom</artifactId>
            <version>${guava-bom.version}</version>
            <type>pom</type>
            <scope>import</scope>
         </dependency>
         <!-- HTTP Components Client5 BOM .................................. -->
         <dependency>
            <groupId>org.apache.httpcomponents.client5</groupId>
            <artifactId>httpclient5-parent</artifactId>
            <version>${httpclient5-parent.version}</version>
            <type>pom</type>
            <scope>import</scope>
         </dependency>
         <!-- Jackson BOM .................................................. -->
         <dependency>
            <groupId>com.fasterxml.jackson</groupId>
            <artifactId>jackson-bom</artifactId>
            <version>${jackson-bom.version}</version>
            <type>pom</type>
            <scope>import</scope>
         </dependency>
         <!-- Jetty BOM .....................................................-->
         <dependency>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-bom</artifactId>
            <version>${jetty.version}</version>
            <type>pom</type>
            <scope>import</scope>
         </dependency>
         <!-- JUnit5 BOM ....................................................-->
         <dependency>
            <groupId>org.junit</groupId>
            <artifactId>junit-bom</artifactId>
            <version>${junit-bom.version}</version>
            <type>pom</type>
            <scope>import</scope>
         </dependency>
         <!-- Log4j2 BOM ....................................................-->
         <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-bom</artifactId>
            <version>${log4j-bom.version}</version>
            <type>pom</type>
            <scope>import</scope>
         </dependency>
         <!-- Struts2 BOM .................................................. -->
         <dependency>
            <groupId>org.apache.struts</groupId>
            <artifactId>struts2-bom</artifactId>
            <version>${struts2-bom.version}</version>
            <type>pom</type>
            <scope>import</scope>
         </dependency>

         <!-- common libraries ............................................. -->
         <dependency>
            <groupId>commons-beanutils</groupId>
            <artifactId>commons-beanutils</artifactId>
            <version>${commons-beanutils.version}</version>
         </dependency>
         <dependency>
            <groupId>commons-cli</groupId>
            <artifactId>commons-cli</artifactId>
            <version>${commons-cli.version}</version>
         </dependency>
         <dependency>
            <groupId>commons-configuration</groupId>
            <artifactId>commons-configuration</artifactId>
            <version>${commons-configuration.version}</version>
         </dependency>
         <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>${commons-io.version}</version>
         </dependency>
         <dependency>
            <groupId>commons-validator</groupId>
            <artifactId>commons-validator</artifactId>
            <version>${commons-validator.version}</version>
         </dependency>
         <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>${gson.version}</version>
         </dependency>
         <dependency>
            <groupId>joda-time</groupId>
            <artifactId>joda-time</artifactId>
            <version>${joda-time.version}</version>
         </dependency>
         <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-configuration2</artifactId>
            <version>${commons-configuration2.version}</version>
         </dependency>
         <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-csv</artifactId>
            <version>${commons-csv.version}</version>
         </dependency>
         <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-digester3</artifactId>
            <version>${commons-digester3.version}</version>
         </dependency>
         <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>${commons-lang3.version}</version>
         </dependency>
         <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-text</artifactId>
            <version>${commons-text.version}</version>
         </dependency>
         <dependency>
            <!-- OpenAPI Annotations and render Swagger-UI page (Spring Boot 3 / Jakarta) -->
            <groupId>org.springdoc</groupId>
            <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
            <version>${springdoc.version}</version>
         </dependency>
         <dependency>
            <groupId>org.springframework.plugin</groupId>
            <artifactId>spring-plugin-core</artifactId>
            <version>${spring-plugin-core.version}</version>
         </dependency>

         <!-- Spring Boot BOM ..................................................
          ATTENTION: The "spring-boot-dependencies" setup does not let you 
          override individual dependencies by using Spring Boot managed 
          properties. To achieve the same result, you need to add entries in
          the dependencyManagement section of your project before the 
          spring-boot-dependencies entry. For instance, to use a different 
          version of the SLF4J library, you need add the following elements
          prior to "spring-boot-dependencies"
         -->
         <!-- Override SLF4J provided by Spring Boot -->
         <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${slf4j.version}</version>
         </dependency>
         <!-- Override log4j-slf4j-impl provided by Spring Boot -->
         <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-slf4j-impl</artifactId>
            <version>${log4j-bom.version}</version>
         </dependency>
         <!-- Override jcl-over-slf4j provided by Spring Boot -->
         <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jcl-over-slf4j</artifactId>
            <version>${jcl-over-slf4j.version}</version>
         </dependency>
         <!-- Override jul-to-slf4j provided by Spring Boot -->
         <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jul-to-slf4j</artifactId>
            <version>${jul-to-slf4j.version}</version>
         </dependency>
         <!-- Override log4j-core provided by Spring Boot -->
         <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-core</artifactId>
            <version>${log4j-bom.version}</version>
         </dependency>
         <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>

      <!-- =============== scope: compile ================================== -->
      <!-- SLF4J + Log4J2 route SLF4J logging to Log4j2. -->
      <dependency>
         <groupId>org.apache.logging.log4j</groupId>
         <artifactId>log4j-slf4j-impl</artifactId>
      </dependency>

      <!-- =============== scope: provided ================================-->
      <dependency>
         <groupId>org.projectlombok</groupId>
         <artifactId>lombok</artifactId>
         <scope>provided</scope>
      </dependency>

      <!-- =============== scope: test ===================================== -->
      <dependency>
         <!--  must be on the classpath for offline Jacoco to work  -->
         <groupId>org.jacoco</groupId>
         <artifactId>org.jacoco.agent</artifactId>
         <classifier>runtime</classifier>
         <version>${jacoco.version}</version>
         <scope>test</scope>
      </dependency>
      <!--  ...JUnit 5 ..................................................... -->
      <dependency>
         <groupId>org.junit.jupiter</groupId>
         <artifactId>junit-jupiter-api</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.junit.jupiter</groupId>
         <artifactId>junit-jupiter-engine</artifactId>
         <scope>test</scope>
      </dependency>

   </dependencies>

   <!--  repositories tells Maven where to *download* from -->
   <repositories>
      <repository>
         <id>myMavenRepo.release.repo</id>
         <releases>
            <enabled>true</enabled>
            <updatePolicy>always</updatePolicy>
            <checksumPolicy>warn</checksumPolicy>
         </releases>
         <snapshots>
            <enabled>false</enabled>
         </snapshots>
         <url>https://mymavenrepo.com/repo/7FlqHiEzj6RRvMdznYj0/</url>
      </repository>
      <repository>
         <id>myMavenRepo.snapshot.repo</id>
         <releases>
            <enabled>false</enabled>
         </releases>
         <snapshots>
            <enabled>true</enabled>
         </snapshots>
         <url>https://mymavenrepo.com/repo/7FlqHiEzj6RRvMdznYj0/</url>
      </repository>
   </repositories>

   <build>
      <resources>
         <resource>
            <directory>${project.basedir}/src/main/resources</directory>
            <excludes>
               <exclude>**/rebel.xml</exclude>
            </excludes>
            <filtering>true</filtering>
         </resource>
      </resources>
      <testResources>
         <testResource>
            <directory>${project.basedir}/src/test/resources</directory>
            <filtering>true</filtering>
         </testResource>
      </testResources>

      <pluginManagement>
         <plugins>
            <!-- ............ Flattens POM Files ........................... -->
            <plugin>
               <groupId>org.codehaus.mojo</groupId>
               <artifactId>flatten-maven-plugin</artifactId>
               <version>${flatten-maven-plugin.version}</version>
               <configuration>
                  <updatePomFile>true</updatePomFile>
                  <flattenMode>resolveCiFriendliesOnly</flattenMode>
               </configuration>
               <executions>
                  <execution>
                     <id>rg-flattening-POM-file</id>
                     <phase>process-resources</phase>
                     <goals>
                        <goal>flatten</goal>
                     </goals>
                  </execution>
                  <execution>
                     <id>rg-cleaning-flattened-POM-file</id>
                     <phase>clean</phase>
                     <goals>
                        <goal>clean</goal>
                     </goals>
                  </execution>
               </executions>
            </plugin>
            <!-- ............ Display System Environment  .................. -->
            <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-help-plugin</artifactId>
               <version>${maven-help-plugin.version}</version>
               <executions>
                  <execution>
                     <id>rg-displaying-environment</id>
                     <phase>validate</phase>
                     <goals>
                        <goal>system</goal>
                     </goals>
                  </execution>
               </executions>
            </plugin>
            <!-- ............ Enforces Maven/Java Version .................. -->
            <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-enforcer-plugin</artifactId>
               <version>${maven-enforcer-plugin.version}</version>
               <configuration>
                  <rules>
                     <requireMavenVersion>
                        <version>[3.8,)</version>
                        <message>Must use maven version 3.8+</message>
                     </requireMavenVersion>
                     <requireJavaVersion>
                        <version>[25,)</version>
                        <message>Must use Java 25+</message>
                     </requireJavaVersion>
                     <requireProperty>
                        <property>java.vendor</property>
                        <regex>^(?!.*\bOracle\b).*$</regex>
                        <regexMessage>Do *NOT* use Oracle Java</regexMessage>
                        <level>WARN</level>
                     </requireProperty>
                  </rules>
               </configuration>
               <executions>
                  <execution>
                     <id>rg-displaying-platform-info</id>
                     <phase>compile</phase>
                     <goals>
                        <goal>display-info</goal>
                     </goals>
                  </execution>
                  <execution>
                     <id>rg-validating-environment</id>
                     <phase>validate</phase>
                     <goals>
                        <goal>enforce</goal>
                     </goals>
                  </execution>
               </executions>
            </plugin>
            <!-- ............ Formats Code ................................. 
            formatter removed in favor of using default IntelliJIDEA formatter
            <plugin>
               <groupId>net.revelc.code.formatter</groupId>
               <artifactId>formatter-maven-plugin</artifactId>
               <version>${formatter-maven-plugin.version}</version>
               <configuration>
                  <compilerCompliance>${java.version}</compilerCompliance>
                  <compilerSource>${maven.compiler.source}</compilerSource>
                  <configFile>formatter.xml</configFile>
                  <lineEnding>LF</lineEnding>
                  <skipCssFormatting>true</skipCssFormatting>
                  <skipHtmlFormatting>true</skipHtmlFormatting>
                  <skipJsFormatting>true</skipJsFormatting>
                  <skipJsonFormatting>false</skipJsonFormatting>
                  <skipXmlFormatting>true</skipXmlFormatting>
                  <directories>
                     <directory>src/main/java</directory>
                     <directory>src/test/java</directory>
                     <directory>target</directory>
                  </directories>
               </configuration>
               <executions>
                  <execution>
                     <id>rg-formatting-source-code</id>
                     <phase>process-sources</phase>
                     <goals>
                        <goal>format</goal>
                     </goals>
                  </execution>
                  <execution>
                     <id>rg-formatting-generated-code</id>
                     <phase>verify</phase>
                     <goals>
                        <goal>format</goal>
                     </goals>
                  </execution>
               </executions>
            </plugin>
            -->
            <!-- ............ Processing Resource Files .................... -->
            <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-resources-plugin</artifactId>
               <version>${maven-resources-plugin.version}</version>
               <configuration>
                  <propertiesEncoding>ISO-8859-1</propertiesEncoding>
                  <nonFilteredFileExtensions>
                     <nonFilteredFileExtension>class</nonFilteredFileExtension>
                     <nonFilteredFileExtension>jar</nonFilteredFileExtension>
                     <nonFilteredFileExtension>jks</nonFilteredFileExtension>
                     <nonFilteredFileExtension>pdf</nonFilteredFileExtension>
                     <nonFilteredFileExtension>p12</nonFilteredFileExtension>
                  </nonFilteredFileExtensions>
               </configuration>
               <executions>
                  <execution>
                     <id>rg-processing-resources</id>
                     <phase>process-resources</phase>
                     <goals>
                        <goal>resources</goal>
                     </goals>
                  </execution>
                  <execution>
                     <id>default-resources</id>
                     <phase>none</phase>
                     <goals>
                        <goal>resources</goal>
                     </goals>
                  </execution>
                  <execution>
                     <id>rg-processing-test-resources</id>
                     <phase>process-test-resources</phase>
                     <goals>
                        <goal>testResources</goal>
                     </goals>
                  </execution>
                  <execution>
                     <id>default-testResources</id>
                     <phase>none</phase>
                     <goals>
                        <goal>testResources</goal>
                     </goals>
                  </execution>
               </executions>
            </plugin>
            <!-- ............ Generates git.properties ..................... -->
            <plugin>
               <groupId>io.github.git-commit-id</groupId>
               <artifactId>git-commit-id-maven-plugin</artifactId>
               <version>${git-commit-id-maven-plugin.version}</version>
               <configuration>
                  <verbose>false</verbose>
                  <generateGitPropertiesFile>true</generateGitPropertiesFile>
                  <generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>
               </configuration>
               <executions>
                  <execution>
                     <id>rg-generating-git-info</id>
                     <phase>process-resources</phase>
                     <goals>
                        <goal>revision</goal>
                     </goals>
                  </execution>
               </executions>
            </plugin>
            <!-- ............ Generates openapi.json ....................... -->
            <plugin>
               <groupId>org.springdoc</groupId>
               <artifactId>springdoc-openapi-maven-plugin</artifactId>
               <version>${springdoc-openapi-maven-plugin.version}</version>
               <configuration>
                  <outputFileName>${project.artifactId}-openapi.json</outputFileName>
                  <skip>false</skip>
               </configuration>
               <executions>
                  <execution>
                     <id>rg-generating-openapi</id>
                     <goals>
                        <goal>generate</goal>
                     </goals>
                  </execution>
               </executions>
            </plugin>
            <!-- ............ Clean ........................................ -->
            <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-clean-plugin</artifactId>
               <version>${maven-clean-plugin.version}</version>
               <configuration>
                  <filesets>
                     <fileset>
                        <directory>${basedir}</directory>
                        <includes>
                           <include>**/jacoco.exec</include>
                           <include>**/jacoco-it.exec</include>
                           <include>**/.sonar/**</include>
                           <include>**/test-output/**</include>
                           <include>**/generated/**</include>
                        </includes>
                        <followSymlinks>false</followSymlinks>
                     </fileset>
                  </filesets>
               </configuration>
               <executions>
                  <execution>
                     <id>rg-cleaning</id>
                     <phase>clean</phase>
                     <goals>
                        <goal>clean</goal>
                     </goals>
                  </execution>
                  <execution>
                     <id>default-clean</id>
                     <phase>none</phase>
                     <goals>
                        <goal>clean</goal>
                     </goals>
                  </execution>
               </executions>
            </plugin>
            <!-- ............ Compilation .................................. -->
            <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-compiler-plugin</artifactId>
               <version>${maven-compiler-plugin.version}</version>
               <configuration>
                  <compilerArgs>
                     <arg>-Xlint:all</arg>
                  </compilerArgs>
               </configuration>
               <executions>
                  <execution>
                     <id>rg-compiling-source-files</id>
                     <phase>compile</phase>
                     <goals>
                        <goal>compile</goal>
                     </goals>
                  </execution>
                  <execution>
                     <id>default-compile</id>
                     <phase>none</phase>
                     <goals>
                        <goal>compile</goal>
                     </goals>
                  </execution>
                  <execution>
                     <id>rg-compiling-test-files</id>
                     <phase>test-compile</phase>
                     <goals>
                        <goal>testCompile</goal>
                     </goals>
                  </execution>
                  <execution>
                     <id>default-testCompile</id>
                     <phase>none</phase>
                     <goals>
                        <goal>testCompile</goal>
                     </goals>
                  </execution>
               </executions>
            </plugin>
            <!-- ............ Unit Tests ................................... -->
            <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-surefire-plugin</artifactId>
               <version>${maven-surefire-plugin.version}</version>
               <configuration>
                  <systemPropertyVariables>
                     <jacoco-agent.destfile>target/jacoco.exec</jacoco-agent.destfile>
                  </systemPropertyVariables>
               </configuration>
               <executions>
                  <execution>
                     <id>rg-unit-testing</id>
                     <phase>test</phase>
                     <goals>
                        <goal>test</goal>
                     </goals>
                  </execution>
                  <execution>
                     <id>default-test</id>
                     <phase>none</phase>
                     <goals>
                        <goal>test</goal>
                     </goals>
                  </execution>
               </executions>
            </plugin>
            <!-- ............ Integration tests ............................ -->
            <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-failsafe-plugin</artifactId>
               <version>${maven-failsafe-plugin.version}</version>
               <configuration>
                  <systemPropertyVariables>
                     <jacoco-agent.destfile>target/jacoco-it.exec</jacoco-agent.destfile>
                  </systemPropertyVariables>
               </configuration>
               <executions>
                  <execution>
                     <id>rg-integration-testing</id>
                     <phase>integration-test</phase>
                     <goals>
                        <goal>integration-test</goal>
                     </goals>
                  </execution>
               </executions>
            </plugin>
            <!-- ............ Jacoco Test Coverage ......................... -->
            <plugin>
               <groupId>org.jacoco</groupId>
               <artifactId>jacoco-maven-plugin</artifactId>
               <version>${jacoco.version}</version>
               <executions>
                  <execution>
                     <id>rg-jacoco-instrumenting-classes</id>
                     <goals>
                        <goal>instrument</goal>
                     </goals>
                  </execution>
                  <execution>
                     <id>rg-jacoco-restoring-instrumented-classes</id>
                     <phase>post-integration-test</phase>
                     <goals>
                        <goal>restore-instrumented-classes</goal>
                     </goals>
                  </execution>
                  <execution>
                     <id>rg-jacoco-merging-test-coverage-results</id>
                     <phase>post-integration-test</phase>
                     <goals>
                        <goal>merge</goal>
                     </goals>
                     <configuration>
                        <fileSets>
                           <fileSet>
                              <directory>${project.build.directory}</directory>
                              <includes>
                                 <include>*.exec</include>
                              </includes>
                              <excludes>
                                 <exclude>aggregate.exec</exclude>
                              </excludes>
                           </fileSet>
                        </fileSets>
                        <destFile>${project.build.directory}/aggregate.exec</destFile>
                     </configuration>
                  </execution>
                  <execution>
                     <id>rg-jacoco-generating-merged-XML-report</id>
                     <phase>post-integration-test</phase>
                     <goals>
                        <goal>report</goal>
                     </goals>
                     <configuration>
                        <dataFile>${project.build.directory}/aggregate.exec</dataFile>
                        <outputDirectory>${project.reporting.outputDirectory}/jacoco-aggregate</outputDirectory>
                     </configuration>
                  </execution>
               </executions>
            </plugin>
            <!-- ............ Packaging Source in Jar ...................... -->
            <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-source-plugin</artifactId>
               <version>${maven-source-plugin.version}</version>
               <configuration>
                  <archive>
                     <index>false</index>
                     <manifest>
                        <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                        <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                     </manifest>
                  </archive>
               </configuration>
               <executions>
                  <execution>
                     <id>rg-packaging-source-files-to-jar</id>
                     <phase>package</phase>
                     <goals>
                        <goal>jar</goal>
                     </goals>
                  </execution>
               </executions>
            </plugin>
            <!-- ............ Jar .......................................... -->
            <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-jar-plugin</artifactId>
               <version>${maven-jar-plugin.version}</version>
               <configuration>
                  <archive>
                     <index>false</index>
                     <manifest>
                        <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                        <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                     </manifest>
                     <manifestSections>
                        <manifestSection>
                           <name>Build Section</name>
                           <manifestEntries>
                              <Build-Time>${maven.build.timestamp}</Build-Time>
                              <Build-Host-Linux>${env.HOSTNAME}</Build-Host-Linux>
                              <Build-Host-Windows>${env.COMPUTERNAME}.${env.USERDNSDOMAIN}</Build-Host-Windows>
                              <Build-User>${user.name}</Build-User>
                              <Build-Java-Compiler-Target>${maven.compiler.target}</Build-Java-Compiler-Target>
                              <Build-OS>${os.name}</Build-OS>
                              <Build-Version>${project.version}</Build-Version>
                              <Build-Path>${basedir}</Build-Path>
                           </manifestEntries>
                        </manifestSection>
                     </manifestSections>
                  </archive>
                  <classesDirectory>${project.build.outputDirectory}</classesDirectory>
                  <outputDirectory>${project.build.directory}</outputDirectory>
               </configuration>
               <executions>
                  <execution>
                     <id>default-jar</id>
                     <phase>none</phase>
                     <goals>
                        <goal>jar</goal>
                     </goals>
                  </execution>
               </executions>
            </plugin>
            <!-- ............ War .......................................... -->
            <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-war-plugin</artifactId>
               <version>${maven-war-plugin.version}</version>
               <configuration>
                  <archive>
                     <index>false</index>
                     <manifest>
                        <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                        <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                     </manifest>
                     <manifestSections>
                        <manifestSection>
                           <name>Build Section</name>
                           <manifestEntries>
                              <Build-Time>${maven.build.timestamp}</Build-Time>
                              <Build-Host-Linux>${env.HOSTNAME}</Build-Host-Linux>
                              <Build-Host-Windows>${env.COMPUTERNAME}.${env.USERDNSDOMAIN}</Build-Host-Windows>
                              <Build-User>${user.name}</Build-User>
                              <Build-Java-Compiler-Target>${maven.compiler.target}</Build-Java-Compiler-Target>
                              <Build-OS>${os.name}</Build-OS>
                              <Build-Version>${project.version}</Build-Version>
                              <Build-Path>${basedir}</Build-Path>
                           </manifestEntries>
                        </manifestSection>
                     </manifestSections>
                  </archive>
               </configuration>
               <executions>
                  <execution>
                     <id>default-war</id>
                     <phase>none</phase>
                     <goals>
                        <goal>war</goal>
                     </goals>
                  </execution>
               </executions>
            </plugin>
            <!-- ............ Install ...................................... -->
            <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-install-plugin</artifactId>
               <version>${maven-install-plugin.version}</version>
               <executions>
                  <execution>
                     <id>rg-installing-build-locally</id>
                     <phase>install</phase>
                     <goals>
                        <goal>install</goal>
                     </goals>
                  </execution>
                  <execution>
                     <id>default-install</id>
                     <phase>none</phase>
                     <goals>
                        <goal>install</goal>
                     </goals>
                  </execution>
               </executions>
            </plugin>
            <!-- ............ Deploy ....................................... -->
            <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-deploy-plugin</artifactId>
               <version>${maven-deploy-plugin.version}</version>
               <executions>
                  <execution>
                     <id>rg-deploying-build</id>
                     <phase>deploy</phase>
                     <goals>
                        <goal>deploy</goal>
                     </goals>
                  </execution>
                  <execution>
                     <id>default-deploy</id>
                     <phase>none</phase>
                     <goals>
                        <goal>deploy</goal>
                     </goals>
                  </execution>
                  <execution>
                     <id>default-cli</id>
                     <phase>none</phase>
                     <goals>
                        <goal>deploy-file</goal>
                     </goals>
                  </execution>
               </executions>
            </plugin>
         </plugins>
      </pluginManagement>
   </build>

   <reporting>
      <plugins>
         <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <reportSets>
               <reportSet>
                  <reports>
                     <!-- select non-aggregate reports -->
                     <report>report</report>
                     <report>report-integration</report>
                  </reports>
               </reportSet>
            </reportSets>
         </plugin>
      </plugins>
   </reporting>

   <profiles>
      <!-- "simple" profile (used by publish.sh) ........................... -->
      <profile>
         <id>simple</id>
         <build>
            <plugins>
               <plugin>
                  <!-- Enforces Maven Release -->
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-enforcer-plugin</artifactId>
               </plugin>
               <plugin>
                  <!--  flatten POM files  -->
                  <groupId>org.codehaus.mojo</groupId>
                  <artifactId>flatten-maven-plugin</artifactId>
               </plugin>
            </plugins>
         </build>
      </profile>

      <!-- "dev" (default) local build profile ............................. -->
      <profile>
         <id>dev</id>
         <activation>
            <activeByDefault>true</activeByDefault>
         </activation>
         <build>
            <plugins>
               <plugin>
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-enforcer-plugin</artifactId>
               </plugin>
               <!-- formatter removed in favor of using IntelliJIDEA formatter
               <plugin>
                  <groupId>net.revelc.code.formatter</groupId>
                  <artifactId>formatter-maven-plugin</artifactId>
               </plugin>
               -->
               <plugin>
                  <groupId>io.github.git-commit-id</groupId>
                  <artifactId>git-commit-id-maven-plugin</artifactId>
               </plugin>
               <plugin>
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-jar-plugin</artifactId>
                  <executions>
                     <execution>
                        <!--  No jacoco instrumenting involved  -->
                        <id>rg-packaging-jar</id>
                        <phase>package</phase>
                        <goals>
                           <goal>jar</goal>
                        </goals>
                     </execution>
                     <execution>
                        <!--  No jacoco instrumenting involved  -->
                        <id>rg-packaging-test-jar</id>
                        <phase>package</phase>
                        <goals>
                           <goal>test-jar</goal>
                        </goals>
                     </execution>
                  </executions>
               </plugin>
            </plugins>
         </build>
      </profile>

      <!-- "snap" (SNAPSHOT) build profile ................................. -->
      <profile>
         <id>snap</id>
         <build>
            <plugins>
               <plugin>
                  <!-- display system environment information                -->
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-help-plugin</artifactId>
               </plugin>
               <plugin>
                  <!-- enforce artifact is SNAPSHOT version.                 -->
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-enforcer-plugin</artifactId>
                  <configuration>
                     <rules>
                        <requireSnapshotVersion>
                           <message>Release artifact CANNOT be built in SNAPSHOT</message>
                           <failWhenParentIsRelease>false</failWhenParentIsRelease>
                        </requireSnapshotVersion>
                        <requireReleaseDeps>
                           <message>SNAPSHOT dependencies found.</message>
                           <level>WARN</level>
                        </requireReleaseDeps>
                     </rules>
                     <fail>true</fail>
                  </configuration>
               </plugin>
               <!-- formatter removed in favor of using IntelliJIDEA formatter
               <plugin>
                  <groupId>net.revelc.code.formatter</groupId>
                  <artifactId>formatter-maven-plugin</artifactId>
                  <executions>
                     <execution>
                        <id>rg-validating-formatted-code</id>
                        <phase>process-resources</phase>
                        <goals>
                           <goal>validate</goal>
                        </goals>
                     </execution>
                  </executions>
               </plugin>
               -->
               <plugin>
                  <groupId>io.github.git-commit-id</groupId>
                  <artifactId>git-commit-id-maven-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>org.apache.maven.plugins</groupId>
                  <artifactId>maven-jar-plugin</artifactId>
                  <executions>
                     <execution>
                        <id>rg-packaging-jar-after-jacoco-restored-classes</id>
                        <!-- package after jacoco restored classes -->
                        <phase>post-integration-test</phase>
                        <goals>
                           <goal>jar</goal>
                        </goals>
                     </execution>
                     <execution>
                        <id>rg-packaging-test-jar-after-jacoco-restored-classes</id>
                        <!-- package after jacoco restored classes -->
                        <phase>post-integration-test</phase>
                        <goals>
                           <goal>test-jar</goal>
                        </goals>
                     </execution>
                  </executions>
               </plugin>
            </plugins>
         </build>
      </profile>

      <!-- "rel" (RELEASE) build profile -->
      <profile>
         <id>rel</id>
         <build>
            <plugins>
               <plugin>
                  <!-- display system environment information                -->
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-help-plugin</artifactId>
               </plugin>
               <plugin>
                  <!-- enforce no SNAPSHOT version in rel artifact           -->
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-enforcer-plugin</artifactId>
                  <configuration>
                     <rules>
                        <requireReleaseVersion>
                           <message>SNAPSHOT artifact cannot be built in Release build</message>
                        </requireReleaseVersion>
                        <requireReleaseDeps>
                           <message>SNAPSHOT dependencies NOT allowed in Release build</message>
                        </requireReleaseDeps>
                     </rules>
                     <fail>true</fail>
                  </configuration>
               </plugin>
               <!-- formatter removed in favor of using IntelliJIDEA formatter
               <plugin>
                  <groupId>net.revelc.code.formatter</groupId>
                  <artifactId>formatter-maven-plugin</artifactId>
                  <executions>
                     <execution>
                        <id>rg-validating-formatted-code</id>
                        <phase>process-resources</phase>
                        <goals>
                           <goal>validate</goal>
                        </goals>
                     </execution>
                  </executions>
               </plugin>
               -->
               <plugin>
                  <groupId>io.github.git-commit-id</groupId>
                  <artifactId>git-commit-id-maven-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>org.apache.maven.plugins</groupId>
                  <artifactId>maven-source-plugin</artifactId>
               </plugin>
               <plugin>
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-jar-plugin</artifactId>
                  <executions>
                     <execution>
                        <id>rg-packaging-jar-after-jacoco-restored-classes</id>
                        <!-- package after jacoco restored classes -->
                        <phase>post-integration-test</phase>
                        <goals>
                           <goal>jar</goal>
                        </goals>
                     </execution>
                     <execution>
                        <id>rg-packaging-test-jar-after-jacoco-restored-classes</id>
                        <!-- package after jacoco restored classes -->
                        <phase>post-integration-test</phase>
                        <goals>
                           <goal>test-jar</goal>
                        </goals>
                     </execution>
                  </executions>
               </plugin>
            </plugins>
         </build>
      </profile>

   </profiles>

</project>
