<?xml version="1.0" encoding="UTF-8"?>
<!--
  #%L
  wcm.io
  %%
  Copyright (C) 2014 wcm.io
  %%
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
  #L%
  -->

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

  <groupId>io.wcm.maven</groupId>
  <artifactId>io.wcm.maven.global-parent</artifactId>
  <version>52</version>
  <packaging>pom</packaging>

  <name>io.wcm.maven.global-parent</name>
  <description>Global parent for Maven artifact hierarchy. Defines fixed versions of Maven plugins to be used and certain general Maven settings.</description>
  <url>https://wcm.io/</url>

  <scm>
    <connection>scm:git:https://github.com/wcm-io/io.wcm.maven.global-parent.git</connection>
    <developerConnection>scm:git:https://github.com/wcm-io/io.wcm.maven.global-parent.git</developerConnection>
    <url>https://github.com/wcm-io/io.wcm.maven.global-parent</url>
    <tag>HEAD</tag>
  </scm>

  <inceptionYear>2014</inceptionYear>

  <organization>
    <name>wcm.io</name>
    <url>https://wcm.io</url>
  </organization>

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

  <developers>
    <developer>
      <name>wcm.io Community</name>
      <organization>wcm.io</organization>
      <organizationUrl>https://wcm.io</organizationUrl>
    </developer>
  </developers>

  <properties>

    <!-- define default encoding for all source/resource files -->
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

    <!-- Default skip settings for unit tests and integration tests -->
    <maven.test.skip>false</maven.test.skip>
    <unittests.skip>${maven.test.skip}</unittests.skip>
    <integrationtests.skip>${maven.test.skip}</integrationtests.skip>

    <!-- Java Version to build against (can be overridden by inheriting poms) -->
    <!-- Java 11 is the minimum version, Java 8 is no longer supported -->
    <java.version>11</java.version>
    <build.compiler.source>${java.version}</build.compiler.source>
    <build.compiler.target>${java.version}</build.compiler.target>
    <build.compiler.release>${build.compiler.target}</build.compiler.release>

    <!-- pmd needs this as a global property, even in mvn 3 - may be fixed some day -->
    <!-- see https://issues.apache.org/jira/browse/MPMD-86 -->
    <targetJdk>${java.version}</targetJdk>

    <!-- Mininum maven version -->
    <maven.min-version>3.6.0</maven.min-version>

    <!-- distribution settings -->
    <distribution.snapshotRepositoryId>ossrh</distribution.snapshotRepositoryId>
    <distribution.snapshotRepositoryUrl>https://oss.sonatype.org/content/repositories/snapshots</distribution.snapshotRepositoryUrl>
    <distribution.releaseRepositoryId>ossrh</distribution.releaseRepositoryId>
    <distribution.releaseRepositoryUrl>https://oss.sonatype.org/service/local/staging/deploy/maven2/</distribution.releaseRepositoryUrl>

    <!-- Plugin version -->
    <maven-surefire-plugin.version>3.1.2</maven-surefire-plugin.version>
    <maven-release-plugin.version>3.0.1</maven-release-plugin.version>
    <spotbugs-plugin.version>4.7.3.5</spotbugs-plugin.version>
    <spotbugs-findsecbugs-plugin.version>1.12.0</spotbugs-findsecbugs-plugin.version>
    <pmd.version>6.55.0</pmd.version>
    <jacoco-maven-plugin.version>0.8.10</jacoco-maven-plugin.version>
    <versions-maven-plugin.version>2.16.0</versions-maven-plugin.version>

    <!-- Set to 'enabled' to activate org.eclipse.jdt.core.compiler.annotation.nullanalysis feature in eclipse settings -->
    <eclipse.settings.nullanalysis>disabled</eclipse.settings.nullanalysis>

    <!-- gitflow Maven Plugin default settings -->
    <gitflow.skipTestProject>true</gitflow.skipTestProject>
    <gitflow.verbose>true</gitflow.verbose>
    <gitflow.pushRemote>false</gitflow.pushRemote>
    <gitflow.versionsForceUpdate>true</gitflow.versionsForceUpdate>
    <gitflow.postReleaseGoals>clean deploy -Prelease-profile</gitflow.postReleaseGoals>

  </properties>

  <dependencyManagement>
    <dependencies>

      <!-- Recommended global dependency for nullability annotations -->
      <dependency>
        <groupId>org.jetbrains</groupId>
        <artifactId>annotations</artifactId>
        <version>24.0.1</version>
      </dependency>

      <!--
        Global dependency for static code analysis.
        This is no longer included as default dependency because it's LGPL license is not compatible with Apache 2.0 license.
        If this is no problem for your project you can add it as global dependency to your project parent POM.
      -->
      <dependency>
        <groupId>com.github.spotbugs</groupId>
        <artifactId>spotbugs-annotations</artifactId>
        <version>4.7.3</version>
        <exclusions>
          <!-- Do not include JSR-305 annotations - the standard never got accepted, use the nullability annotations from Jetbrains instead -->
          <exclusion>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>jsr305</artifactId>
          </exclusion>
        </exclusions>
      </dependency>

      <!-- Alternative version of spotbugs annotations containing only SuppressFBWarnings with a compatible license -->
      <dependency>
        <groupId>io.wcm.tooling.spotbugs</groupId>
        <artifactId>io.wcm.tooling.spotbugs.annotations</artifactId>
        <version>1.0.0</version>
      </dependency>

    </dependencies>
  </dependencyManagement>

  <build>
    <extensions>

      <!-- extension for build configuration -->
      <extension>
        <groupId>io.wcm.maven</groupId>
        <artifactId>io.wcm.maven.global-build-tools</artifactId>
        <version>28</version>
      </extension>

      <!-- SCP support for deploying sites -->
      <extension>
        <groupId>org.apache.maven.wagon</groupId>
        <artifactId>wagon-ssh</artifactId>
        <version>3.5.3</version>
      </extension>

    </extensions>
    <plugins>

      <!-- Compiler configuration -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>${build.compiler.source}</source>
          <target>${build.compiler.target}</target>
          <encoding>${project.build.sourceEncoding}</encoding>
        </configuration>
      </plugin>

      <!-- Deploy sources to repository -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <executions>
          <!-- Use execution id 'attach-sources-no-fork' to not mix up with disabled execution from super pom -->
          <execution>
            <id>attach-sources-no-fork</id>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

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

      <!-- Unit tests -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <skipTests>${unittests.skip}</skipTests>
          <includes>
            <include>**/*Test.java</include>
          </includes>
          <excludes>
            <exclude>**/*IT.java</exclude>
          </excludes>
        </configuration>
      </plugin>

      <!-- Integration tests -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <executions>
          <execution>
            <id>default-integration-test</id>
            <goals>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <skip>${integrationtests.skip}</skip>
          <includes>
            <include>**/*IT.java</include>
          </includes>
          <excludes>
            <exclude>**/*Test.java</exclude>
          </excludes>
        </configuration>
      </plugin>

      <!-- enforce min. maven version -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <executions>
          <execution>
            <id>enforce-default-java-min</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireJavaVersion>
                  <version>[11,]</version>
                </requireJavaVersion>
              </rules>
            </configuration>
          </execution>
          <execution>
            <id>enforce-default</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireMavenVersion>
                  <version>[${maven.min-version},)</version>
                </requireMavenVersion>
                <requireJavaVersion>
                  <version>[${java.version},]</version>
                </requireJavaVersion>
              </rules>
            </configuration>
          </execution>
          <execution>
            <id>enforce-clean</id>
            <phase>pre-clean</phase>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireMavenVersion>
                  <version>[${maven.min-version},)</version>
                </requireMavenVersion>
                <requireJavaVersion>
                  <version>[${java.version},]</version>
                </requireJavaVersion>
              </rules>
            </configuration>
          </execution>
          <execution>
            <id>enforce-site</id>
            <phase>pre-site</phase>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireMavenVersion>
                  <version>[${maven.min-version},)</version>
                </requireMavenVersion>
                <requireJavaVersion>
                  <version>[${java.version},]</version>
                </requireJavaVersion>
              </rules>
            </configuration>
          </execution>
          <execution>
            <id>warn-maven-eclipse-plugin</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <bannedPlugins>
                  <excludes>
                    <exclude>org.apache.maven.plugins:maven-eclipse-plugin</exclude>
                  </excludes>
                  <message>
*********************************************************************

  PLEASE UPDATE YOUR PROJECT POMS:

  Please replace the Maven plugin

    org.apache.maven.plugins:maven-eclipse-plugin

  with

    io.wcm.devops.maven.plugins:eclipse-maven-plugin

  in all of your POMs - we have to use our own fork of this plugin
  because the original plugin is retired.

  If you do not do this your application will still build, but
  you may not get the correct genrate eclipse and static code
  generation settings in your projects.


*********************************************************************

</message>
                </bannedPlugins>
              </rules>
              <fail>false</fail>
            </configuration>
          </execution>
          <execution>
            <!-- all local dependencies must have an explicit scope set, see https://github.com/apache/sling-maven-enforcer-rules -->
            <id>enforce-explicit-scope</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireExplicitDependencyScope />
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <!-- generate build number and build timestamp -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>buildnumber-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>create-timestamp</id>
            <phase>validate</phase>
            <goals>
              <goal>create</goal>
              <goal>create-timestamp</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <doCheck>false</doCheck>
          <doUpdate>false</doUpdate>
          <getRevisionOnlyOnce>true</getRevisionOnlyOnce>
          <format>{0}</format>
          <shortRevisionLength>8</shortRevisionLength>
          <items>
            <item>scmVersion</item>
          </items>
          <timestampFormat>yyyy-MM-dd'T'HH:mm:ssXXX</timestampFormat>
        </configuration>
      </plugin>

      <!-- Site plugin (only for this POM) -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
        <inherited>false</inherited>
        <configuration>
          <skip>true</skip>
          <skipDeploy>true</skipDeploy>
        </configuration>
      </plugin>

    </plugins>

    <!-- plugin management -->
    <pluginManagement>
      <plugins>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-antrun-plugin</artifactId>
          <version>3.1.0</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-assembly-plugin</artifactId>
          <version>3.6.0</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-changes-plugin</artifactId>
          <version>2.12.1</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-clean-plugin</artifactId>
          <version>3.3.1</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.11.0</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-dependency-plugin</artifactId>
          <version>3.6.0</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>3.1.1</version>
        </plugin>

        <plugin>
          <groupId>io.wcm.devops.maven.plugins</groupId>
          <artifactId>eclipse-maven-plugin</artifactId>
          <version>3.2.0</version>
          <configuration>
            <downloadSources>true</downloadSources>
            <useProjectReferences>false</useProjectReferences>
            <additionalBuildcommands>
              <buildcommand>edu.umd.cs.findbugs.plugin.eclipse.findbugsBuilder</buildcommand>
              <buildcommand>net.sf.eclipsecs.core.CheckstyleBuilder</buildcommand>
              <buildcommand>ch.acanda.eclipse.pmd.builder.PMDBuilder</buildcommand>
            </additionalBuildcommands>
            <additionalProjectnatures>
              <projectnature>edu.umd.cs.findbugs.plugin.eclipse.findbugsNature</projectnature>
              <projectnature>net.sf.eclipsecs.core.CheckstyleNature</projectnature>
              <projectnature>ch.acanda.eclipse.pmd.builder.PMDNature</projectnature>
            </additionalProjectnatures>
            <additionalConfig>
              <file>
                <name>.settings/org.eclipse.core.resources.prefs</name>
                <location>/global-build-tools/eclipse/org.eclipse.core.resources.prefs</location>
              </file>
              <file>
                <name>.settings/org.eclipse.core.runtime.prefs</name>
                <location>/global-build-tools/eclipse/org.eclipse.core.runtime.prefs</location>
              </file>
              <file>
                <name>.settings/org.eclipse.jdt.core.prefs</name>
                <location>/global-build-tools/eclipse/org.eclipse.jdt.core.prefs</location>
                <filtering>true</filtering>
              </file>
              <file>
                <name>.settings/org.eclipse.jdt.ui.prefs</name>
                <location>/global-build-tools/eclipse/org.eclipse.jdt.ui.prefs</location>
              </file>
              <file>
                <name>.settings/edu.umd.cs.findbugs.core.prefs</name>
                <location>/global-build-tools/eclipse/edu.umd.cs.findbugs.core.prefs</location>
              </file>
              <!-- For plugin: https://marketplace.eclipse.org/content/checkstyle-plug -->
              <file>
                <name>.checkstyle</name>
                <content>
                  <![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<fileset-config file-format-version="1.2.0" simple-config="true" sync-formatter="false">
  <local-check-config name="wcm.io" location=".settings/plugins/checkstyle-config.xml" type="project" description="">
    <property name="checkstyle.suppressions.file" value="${basedir}/.settings/plugins/checkstyle-suppressions.xml" />
    <additional-data name="protect-config-file" value="true" />
  </local-check-config>
  <fileset name="all" enabled="true" check-config-name="wcm.io" local="true">
    <file-match-pattern match-pattern="^.*\.java$" include-pattern="true" />
  </fileset>
</fileset-config>]]>
                </content>
              </file>
              <file>
                <name>.settings/plugins/checkstyle-config.xml</name>
                <location>/global-build-tools/checkstyle.xml</location>
              </file>
              <file>
                <name>.settings/plugins/checkstyle-suppressions.xml</name>
                <location>/global-build-tools/checkstyle-suppressions.xml</location>
              </file>
              <file>
                <name>.settings/plugins/spotbugs-exclude.xml</name>
                <location>/global-build-tools/spotbugs-exclude.xml</location>
              </file>
              <!-- For plugin: https://marketplace.eclipse.org/content/eclipse-pmd -->
              <file>
                <name>.eclipse-pmd</name>
                <content>
                  <![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<eclipse-pmd xmlns="http://acanda.ch/eclipse-pmd/0.8" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://acanda.ch/eclipse-pmd/0.8 http://acanda.ch/eclipse-pmd/eclipse-pmd-0.8.xsd">
  <analysis enabled="true" />
  <rulesets>
    <ruleset name="wcm.io" ref=".settings/plugins/pmd-ruleset.xml" refcontext="project" />
  </rulesets>
</eclipse-pmd>]]>
                </content>
              </file>
              <file>
                <name>.settings/plugins/pmd-ruleset.xml</name>
                <location>/global-build-tools/pmd-ruleset.xml</location>
              </file>
            </additionalConfig>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-enforcer-plugin</artifactId>
          <version>3.3.0</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-failsafe-plugin</artifactId>
          <version>${maven-surefire-plugin.version}</version>
          <dependencies>
            <dependency>
              <groupId>xerces</groupId>
              <artifactId>xercesImpl</artifactId>
              <version>2.12.2</version>
            </dependency>
          </dependencies>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-gpg-plugin</artifactId>
          <version>3.1.0</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-install-plugin</artifactId>
          <version>3.1.1</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>3.3.0</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>3.5.0</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jxr-plugin</artifactId>
          <version>3.3.0</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-checkstyle-plugin</artifactId>
          <version>3.3.0</version>
          <configuration>
            <configLocation>global-build-tools/checkstyle.xml</configLocation>
            <suppressionsFileExpression>checkstyle.suppressions.file</suppressionsFileExpression>
            <suppressionsLocation>global-build-tools/checkstyle-suppressions.xml</suppressionsLocation>
            <encoding>${project.build.sourceEncoding}</encoding>
            <enableRulesSummary>false</enableRulesSummary>
            <linkXRef>true</linkXRef>
            <excludes>**/target/**</excludes>
          </configuration>
          <dependencies>
            <dependency>
              <groupId>com.puppycrawl.tools</groupId>
              <artifactId>checkstyle</artifactId>
              <version>10.12.1</version>
            </dependency>
          </dependencies>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-pmd-plugin</artifactId>
          <version>3.21.0</version>
          <configuration>
            <targetJdk>${java.version}</targetJdk>
            <format>xml</format>
            <linkXref>true</linkXref>
            <sourceEncoding>${project.build.sourceEncoding}</sourceEncoding>
            <rulesets>
              <ruleset>global-build-tools/pmd-ruleset.xml</ruleset>
            </rulesets>
          </configuration>
          <dependencies>
            <dependency>
              <groupId>net.sourceforge.pmd</groupId>
              <artifactId>pmd-core</artifactId>
              <version>${pmd.version}</version>
            </dependency>
            <dependency>
              <groupId>net.sourceforge.pmd</groupId>
              <artifactId>pmd-java</artifactId>
              <version>${pmd.version}</version>
            </dependency>
            <dependency>
              <groupId>net.sourceforge.pmd</groupId>
              <artifactId>pmd-javascript</artifactId>
              <version>${pmd.version}</version>
            </dependency>
            <dependency>
              <groupId>net.sourceforge.pmd</groupId>
              <artifactId>pmd-jsp</artifactId>
              <version>${pmd.version}</version>
            </dependency>
          </dependencies>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-project-info-reports-plugin</artifactId>
          <version>3.4.5</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-release-plugin</artifactId>
          <version>${maven-release-plugin.version}</version>
          <configuration>
            <autoVersionSubmodules>true</autoVersionSubmodules>
            <goals>deploy</goals>
            <!-- Do not push automatically on release:prepare, and allow local git checkout on release:perform -->
            <pushChanges>false</pushChanges>
            <localCheckout>true</localCheckout>
            <!-- <releaseProfiles>release-profile</releaseProfiles> should be used but is currently broken MRELEASE-1038/MRELEASE-1042 -->
            <useReleaseProfile>true</useReleaseProfile>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-resources-plugin</artifactId>
          <version>3.3.1</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-scm-plugin</artifactId>
          <version>2.0.1</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-shade-plugin</artifactId>
          <version>3.5.0</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-site-plugin</artifactId>
          <!-- Stick with 3.x version of this plugin for now -->
          <version>3.12.1</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>3.3.0</version>
        </plugin>

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

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

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-war-plugin</artifactId>
          <version>3.4.0</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-toolchains-plugin</artifactId>
          <version>3.1.0</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-scm-publish-plugin</artifactId>
          <version>3.2.1</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-invoker-plugin</artifactId>
          <version>3.6.0</version>
        </plugin>

        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>build-helper-maven-plugin</artifactId>
          <version>3.4.0</version>
        </plugin>

        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>buildnumber-maven-plugin</artifactId>
          <version>3.2.0</version>
        </plugin>

        <plugin>
          <groupId>com.github.spotbugs</groupId>
          <artifactId>spotbugs-maven-plugin</artifactId>
          <version>${spotbugs-plugin.version}</version>
          <configuration>
            <xmlOutput>true</xmlOutput>
            <xmlOutputDirectory>${project.build.directory}/spotbugs</xmlOutputDirectory>
            <excludeFilterFile>global-build-tools/spotbugs-exclude.xml</excludeFilterFile>
            <plugins>
              <plugin>
                <groupId>com.h3xstream.findsecbugs</groupId>
                <artifactId>findsecbugs-plugin</artifactId>
                <version>${spotbugs-findsecbugs-plugin.version}</version>
              </plugin>
            </plugins>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.sonarsource.scanner.maven</groupId>
          <artifactId>sonar-maven-plugin</artifactId>
          <version>3.9.1.2184</version>
        </plugin>

        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>taglist-maven-plugin</artifactId>
          <version>3.0.0</version>
          <configuration>
            <tagListOptions>
              <tagClasses>
                <tagClass>
                  <displayName>Todo Work</displayName>
                  <tags>
                    <tag>
                      <matchString>TODO:</matchString>
                      <matchType>exact</matchType>
                    </tag>
                    <tag>
                      <matchString>FIXME</matchString>
                      <matchType>exact</matchType>
                    </tag>
                    <tag>
                      <matchString>XXX</matchString>
                      <matchType>exact</matchType>
                    </tag>
                  </tags>
                </tagClass>
              </tagClasses>
            </tagListOptions>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>xml-maven-plugin</artifactId>
          <version>1.1.0</version>
          <!-- use saxon as XSLT 2.0 processor -->
          <dependencies>
            <dependency>
              <groupId>net.sf.saxon</groupId>
              <artifactId>saxon</artifactId>
              <version>8.7</version>
            </dependency>
          </dependencies>
        </plugin>

        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>versions-maven-plugin</artifactId>
          <version>${versions-maven-plugin.version}</version>
          <configuration>
            <outputLineWidth>110</outputLineWidth>
            <!-- Expected behavior when using gitflow-release-plugin is to only affect current folder and sub modules, not parent or sibling folders -->
            <processFromLocalAggregationRoot>false</processFromLocalAggregationRoot>
            <!-- Do not report dependency updates for transitive dependencies imported from "BOM" dependencies. -->
            <processDependencyManagementTransitive>false</processDependencyManagementTransitive>
          </configuration>
        </plugin>

        <plugin>
          <groupId>com.github.eirslett</groupId>
          <artifactId>frontend-maven-plugin</artifactId>
          <version>1.13.4</version>
        </plugin>

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

        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>license-maven-plugin</artifactId>
          <version>2.1.0</version>
        </plugin>

        <plugin>
          <groupId>org.sonatype.plugins</groupId>
          <artifactId>nexus-staging-maven-plugin</artifactId>
          <!-- Stick with version 1.6.8 until https://issues.sonatype.org/browse/NEXUS-31214, https://issues.sonatype.org/browse/NEXUS-31301, https://issues.sonatype.org/browse/NEXUS-26993 is solved -->
          <version>1.6.8</version>
        </plugin>

        <plugin>
          <groupId>com.amashchenko.maven.plugin</groupId>
          <artifactId>gitflow-maven-plugin</artifactId>
          <version>1.20.0</version>
          <configuration>
            <versionsMavenPluginVersion>${versions-maven-plugin.version}</versionsMavenPluginVersion>
            <skipTestProject>${gitflow.skipTestProject}</skipTestProject>
            <verbose>${gitflow.verbose}</verbose>
            <pushRemote>${gitflow.pushRemote}</pushRemote>
            <versionsForceUpdate>${gitflow.versionsForceUpdate}</versionsForceUpdate>
            <postReleaseGoals>${gitflow.postReleaseGoals}</postReleaseGoals>
            <commitMessagePrefix xml:space="preserve">[gitflow-maven-plugin] </commitMessagePrefix>
            <commitMessages>
              <!-- Add version number to commit messages -->
              <hotfixStartMessage>Update versions for hotfix @{version}</hotfixStartMessage>
              <hotfixFinishMessage>Update for next development version @{version}</hotfixFinishMessage>
              <hotfixVersionUpdateMessage>Update to hotfix version @{version}</hotfixVersionUpdateMessage>
              <releaseStartMessage>Update versions for release @{version}</releaseStartMessage>
              <releaseFinishMessage>Update for next development version @{version}</releaseFinishMessage>
              <releaseVersionUpdateMessage>Update for next development version @{version}</releaseVersionUpdateMessage>
            </commitMessages>
          </configuration>
        </plugin>

        <plugin>
          <groupId>external.atlassian.jgitflow</groupId>
          <artifactId>jgitflow-maven-plugin</artifactId>
          <version>1.0-m5.1</version>
          <configuration>
            <scmCommentPrefix xml:space="preserve">[jgitflow-maven-plugin] </scmCommentPrefix>
            <autoVersionSubmodules>true</autoVersionSubmodules>
            <eol>lf</eol>
          </configuration>
          <dependencies>
            <dependency>
              <groupId>com.jcraft</groupId>
              <artifactId>jsch</artifactId>
              <version>0.1.55</version>
            </dependency>
          </dependencies>
        </plugin>

      </plugins>

    </pluginManagement>

  </build>

  <reporting>
    <plugins>

      <!-- project info -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-project-info-reports-plugin</artifactId>
        <configuration>
          <!-- following will remove the location fetching, will speed up the build process
            but Dependency Repository Locations will not be created in report. -->
          <dependencyLocationsEnabled>false</dependencyLocationsEnabled>
        </configuration>
      </plugin>

      <!-- changes -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-changes-plugin</artifactId>
        <configuration>
          <xmlPath>${basedir}/changes.xml</xmlPath>
        </configuration>
        <reportSets>
          <reportSet>
            <reports>
              <report>changes-report</report>
            </reports>
          </reportSet>
        </reportSets>
      </plugin>

      <!-- javadocs -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <reportSets>
          <reportSet>
            <reports>
              <report>javadoc</report>
            </reports>
          </reportSet>
        </reportSets>
      </plugin>

      <!-- jxr -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jxr-plugin</artifactId>
        <reportSets>
          <reportSet>
            <reports>
              <report>jxr</report>
            </reports>
          </reportSet>
        </reportSets>
      </plugin>

      <!-- check style -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <configuration>
          <configLocation>global-build-tools/checkstyle.xml</configLocation>
          <suppressionsFileExpression>checkstyle.suppressions.file</suppressionsFileExpression>
          <suppressionsLocation>global-build-tools/checkstyle-suppressions.xml</suppressionsLocation>
          <encoding>${project.build.sourceEncoding}</encoding>
          <enableRulesSummary>false</enableRulesSummary>
          <linkXRef>true</linkXRef>
          <excludes>**/target/**</excludes>
        </configuration>
        <reportSets>
          <reportSet>
            <reports>
              <report>checkstyle</report>
            </reports>
          </reportSet>
        </reportSets>
      </plugin>

      <!-- pmd -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-pmd-plugin</artifactId>
        <configuration>
          <targetJdk>${java.version}</targetJdk>
          <format>xml</format>
          <linkXref>true</linkXref>
          <sourceEncoding>${project.build.sourceEncoding}</sourceEncoding>
          <rulesets>
            <ruleset>global-build-tools/pmd-ruleset.xml</ruleset>
          </rulesets>
        </configuration>
      </plugin>

      <!-- taglist -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>taglist-maven-plugin</artifactId>
        <configuration>
          <tagListOptions>
            <tagClasses>
              <tagClass>
                <displayName>Todo Work</displayName>
                <tags>
                  <tag>
                    <matchString>TODO:</matchString>
                    <matchType>exact</matchType>
                  </tag>
                  <tag>
                    <matchString>FIXME</matchString>
                    <matchType>exact</matchType>
                  </tag>
                  <tag>
                    <matchString>XXX</matchString>
                    <matchType>exact</matchType>
                  </tag>
                </tags>
              </tagClass>
            </tagClasses>
          </tagListOptions>
        </configuration>
      </plugin>

      <!-- spotbugs -->
      <plugin>
        <groupId>com.github.spotbugs</groupId>
        <artifactId>spotbugs-maven-plugin</artifactId>
        <configuration>
          <xmlOutput>true</xmlOutput>
          <xmlOutputDirectory>${project.build.directory}/spotbugs</xmlOutputDirectory>
          <excludeFilterFile>global-build-tools/spotbugs-exclude.xml</excludeFilterFile>
          <plugins>
            <plugin>
              <groupId>com.h3xstream.findsecbugs</groupId>
              <artifactId>findsecbugs-plugin</artifactId>
              <version>${spotbugs-findsecbugs-plugin.version}</version>
            </plugin>
          </plugins>
        </configuration>
      </plugin>

      <!-- Code coverage -->
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
      </plugin>

    </plugins>

  </reporting>

  <!-- Profiles -->
  <profiles>

    <!-- "Fast" profile for quick compile of the project without any unit tests etc. -->
    <profile>
      <id>fast</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <properties>
        <unittests.skip>true</unittests.skip>
        <integrationtests.skip>true</integrationtests.skip>
        <invoker.skip>true</invoker.skip>
        <maven.javadoc.skip>true</maven.javadoc.skip>
      </properties>
    </profile>

    <!-- Profile for running unit test and site analysis in CI -->
    <profile>
      <id>continuous-integration</id>

      <activation>
        <property>
          <name>continuous-integration</name>
          <value>true</value>
        </property>
      </activation>

      <build>
        <plugins>

          <!-- run unit tests in continuous integration mode -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <skip>false</skip>
            </configuration>
          </plugin>

          <!-- Code coverage report -->
          <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>prepare-agent</id>
                <goals>
                  <goal>prepare-agent</goal>
                </goals>
                <configuration>
                  <destFile>${project.build.directory}/jacoco-unit.exec</destFile>
                </configuration>
              </execution>
              <execution>
                <id>prepare-agent-integration</id>
                <goals>
                  <goal>prepare-agent-integration</goal>
                </goals>
                <configuration>
                  <destFile>${project.build.directory}/jacoco-it.exec</destFile>
                </configuration>
              </execution>
              <execution>
                <id>report</id>
                <goals>
                  <goal>report</goal>
                </goals>
                <configuration>
                  <dataFile>${project.build.directory}/jacoco-unit.exec</dataFile>
                  <outputDirectory>${project.reporting.outputDirectory}/jacoco-unit</outputDirectory>
                </configuration>
              </execution>
              <execution>
                <id>report-integration</id>
                <goals>
                  <goal>report-integration</goal>
                </goals>
                <configuration>
                  <dataFile>${project.build.directory}/jacoco-it.exec</dataFile>
                  <outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory>
                </configuration>
              </execution>
              <execution>
                <id>merge-unit-and-it</id>
                <phase>post-integration-test</phase>
                <goals>
                  <goal>merge</goal>
                </goals>
                <configuration>
                  <destFile>${project.build.directory}/jacoco.exec</destFile>
                  <fileSets>
                    <fileSet>
                      <directory>${project.build.directory}</directory>
                      <includes>
                        <include>jacoco-unit.exec</include>
                        <include>jacoco-it.exec</include>
                      </includes>
                    </fileSet>
                  </fileSets>
                </configuration>
              </execution>
              <execution>
                <id>report-merged</id>
                <phase>verify</phase>
                <goals>
                  <goal>report</goal>
                </goals>
                <configuration>
                  <dataFile>${project.build.directory}/jacoco.exec</dataFile>
                  <outputDirectory>${project.reporting.outputDirectory}/jacoco</outputDirectory>
                </configuration>
              </execution>
            </executions>
          </plugin>

        </plugins>
      </build>

    </profile>

    <!-- Profile for running integration tests in CI -->
    <profile>
      <id>continuous-integration-verify</id>

      <activation>
        <property>
          <name>continuous-integration-verify</name>
          <value>true</value>
        </property>
      </activation>

      <build>
        <plugins>

          <!-- run unit tests in continuous integration mode -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
            <configuration>
              <skip>false</skip>
            </configuration>
          </plugin>

        </plugins>
      </build>

    </profile>

    <!-- release-profile -->
    <profile>
      <id>release-profile</id>
      <activation>
        <property>
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-deploy-plugin</artifactId>
            <configuration>
              <updateReleaseInfo>true</updateReleaseInfo>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <executions>
              <!-- disable "jar" goal inherited from maven super-pom -->
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar</goal>
                </goals>
                <configuration>
                  <skipSource>true</skipSource>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <!-- sign the build (only for this pom, not inherited)  -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <inherited>false</inherited>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <!-- configure staging process at sonatype (only for this pom, not inherited) -->
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <inherited>false</inherited>
            <extensions>true</extensions>
            <configuration>
              <serverId>ossrh</serverId>
              <nexusUrl>https://oss.sonatype.org/</nexusUrl>
              <!-- Deployed artifacts should go to staging to be reviewed before publish -->
              <autoReleaseAfterClose>false</autoReleaseAfterClose>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <!-- This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself. -->
    <profile>
      <id>only-eclipse</id>
      <activation>
        <property>
          <name>m2e.version</name>
        </property>
      </activation>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.eclipse.m2e</groupId>
              <artifactId>lifecycle-mapping</artifactId>
              <version>1.0.0</version>
              <configuration>
                <lifecycleMappingMetadata>
                  <pluginExecutions>
                    <pluginExecution>
                      <pluginExecutionFilter>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-enforcer-plugin</artifactId>
                        <versionRange>[1.3.1,)</versionRange>
                        <goals>
                          <goal>enforce</goal>
                        </goals>
                      </pluginExecutionFilter>
                      <action>
                        <ignore />
                      </action>
                    </pluginExecution>
                    <pluginExecution>
                      <pluginExecutionFilter>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>buildnumber-maven-plugin</artifactId>
                        <versionRange>[1.3,)</versionRange>
                        <goals>
                          <goal>create</goal>
                          <goal>create-timestamp</goal>
                        </goals>
                      </pluginExecutionFilter>
                      <action>
                        <ignore />
                      </action>
                    </pluginExecution>
                    <pluginExecution>
                      <pluginExecutionFilter>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>xml-maven-plugin</artifactId>
                        <versionRange>[1.0,)</versionRange>
                        <goals>
                          <goal>validate</goal>
                        </goals>
                      </pluginExecutionFilter>
                      <action>
                        <ignore />
                      </action>
                    </pluginExecution>
                    <pluginExecution>
                      <pluginExecutionFilter>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>license-maven-plugin</artifactId>
                        <versionRange>[1.7,)</versionRange>
                        <goals>
                          <goal>check-file-header</goal>
                        </goals>
                      </pluginExecutionFilter>
                      <action>
                        <ignore />
                      </action>
                    </pluginExecution>
                  </pluginExecutions>
                </lifecycleMappingMetadata>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </profile>

    <!-- Profile is active when running with Java 9 and up -->
    <profile>
      <id>java9-and-up</id>
      <activation>
        <jdk>[9,]</jdk>
      </activation>
      <build>
        <pluginManagement>
          <plugins>
            <!-- Explicitly set java version with "release" flag available since Java 9 -->
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-compiler-plugin</artifactId>
              <configuration>
                <release>${build.compiler.release}</release>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </profile>

  </profiles>

  <distributionManagement>
    <repository>
      <id>${distribution.releaseRepositoryId}</id>
      <url>${distribution.releaseRepositoryUrl}</url>
    </repository>
    <snapshotRepository>
      <id>${distribution.snapshotRepositoryId}</id>
      <url>${distribution.snapshotRepositoryUrl}</url>
    </snapshotRepository>
  </distributionManagement>

</project>
