<?xml version="1.0" encoding="UTF-8"?>
<!--
  #%L
  Pom
  %%
  Copyright (C) 2017 Ultreia.io
  %%
  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU Lesser General Public License as
  published by the Free Software Foundation, either version 3 of the
  License, or (at your option) any later version.
  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Lesser Public License for more details.
  You should have received a copy of the GNU General Lesser Public
  License along with this program.  If not, see
  <http://www.gnu.org/licenses/lgpl-3.0.html>.
  #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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>io.ultreia.maven</groupId>
  <artifactId>pom</artifactId>
  <version>20</version>
  <packaging>pom</packaging>

  <name>Pom</name>
  <description>A common shared pom for our maven projects</description>
  <url>https://gitlab.com/ultreiaio/pom</url>
  <inceptionYear>2017</inceptionYear>
  <organization>
    <name>Ultreia.io</name>
    <url>http://ultreia.io/</url>
  </organization>
  <licenses>
    <license>
      <name>Lesser General Public License (LGPL) v 3.0</name>
      <url>http://www.gnu.org/licenses/lgpl-3.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <developers>

    <developer>
      <name>Tony Chemit</name>
      <id>tchemit</id>
      <email>dev@tchemit.fr</email>
      <organization>ultreia.io</organization>
      <organizationUrl>http://ultreia.io</organizationUrl>
      <timezone>Europe/Paris</timezone>
      <roles>
        <role>lead</role>
        <role>developer</role>
      </roles>
    </developer>

  </developers>

  <scm>
    <connection>scm:git:git@gitlab.com:ultreiaio/pom.git</connection>
    <developerConnection>scm:ssh://git:git@gitlab.com:ultreiaio/pom.git</developerConnection>
    <url>https://gitlab.com/ultreiaio/pom</url>
  </scm>
  <issueManagement>
    <system>gitlab</system>
    <url>https://gitlab.com/${organizationId}/${projectId}/issues</url>
  </issueManagement>
  <ciManagement>
    <system>gitlab</system>
    <url>https://gitlab.com/${organizationId}/${projectId}/pipelines</url>
  </ciManagement>
  <distributionManagement>
    <snapshotRepository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
    <repository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
    <site>
      <id>gitlab.com</id>
      <url>scm:git:http://git@gitlab.com/${organizationId}/${projectId}.git</url>
    </site>
  </distributionManagement>
  <repositories>
    <repository>
      <id>oss-snapshot</id>
      <name>oss-snapshot</name>
      <releases>
        <enabled>false</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
      <url>https://oss.sonatype.org/service/local/repositories/snapshots/content</url>
    </repository>
  </repositories>
  <pluginRepositories>
    <pluginRepository>
      <id>oss-snapshot</id>
      <name>oss-snapshot</name>
      <releases>
        <enabled>false</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
      <url>https://oss.sonatype.org/service/local/repositories/snapshots/content</url>
    </pluginRepository>
  </pluginRepositories>

  <properties>

    <!-- ////////////////////////////////////////////////////////////////// -->
    <!-- //// Mandatory properties you need to define in your project  //// -->
    <!-- ////////////////////////////////////////////////////////////////// -->

    <organizationId />
    <projectId />

    <javaVersion>1.8</javaVersion>
    <signatureArtifactId>java18</signatureArtifactId>
    <signatureVersion>1.0</signatureVersion>

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

    <!-- ////////////////////////////////////////////////////////////////// -->
    <!-- //// Plugins version                                          //// -->
    <!-- ////////////////////////////////////////////////////////////////// -->

    <!-- apache maven plugins version -->
    <antRunPluginVersion>1.8</antRunPluginVersion>
    <assemblyPluginVersion>3.1.0</assemblyPluginVersion>
    <cleanPluginVersion>3.0.0</cleanPluginVersion>
    <compilerPluginVersion>3.6.2</compilerPluginVersion>
    <dependencyPluginVersion>3.0.1</dependencyPluginVersion>
    <deployPluginVersion>2.8.2</deployPluginVersion>
    <earPluginVersion>2.10.1</earPluginVersion>
    <ejbPluginVersion>3.0.0</ejbPluginVersion>
    <enforcerPluginVersion>1.4.1</enforcerPluginVersion>
    <gpgPluginVersion>1.6</gpgPluginVersion>
    <installPluginVersion>2.5.2</installPluginVersion>
    <invokerPluginVersion>3.0.1</invokerPluginVersion>
    <jarPluginVersion>3.0.2</jarPluginVersion>
    <jarSignerPluginVersion>1.4</jarSignerPluginVersion>
    <javadocPluginVersion>2.10.4</javadocPluginVersion>
    <pluginPluginVersion>3.5</pluginPluginVersion>
    <pmdPluginVersion>3.8</pmdPluginVersion>
    <releasePluginVersion>2.5.3</releasePluginVersion>
    <remoteResourcesPluginVersion>1.5</remoteResourcesPluginVersion>
    <resourcesPluginVersion>3.0.2</resourcesPluginVersion>
    <shadePluginVersion>3.0.0</shadePluginVersion>
    <sitePluginVersion>3.6</sitePluginVersion>
    <sourcePluginVersion>3.0.1</sourcePluginVersion>
    <surefirePluginVersion>2.20</surefirePluginVersion>
    <warPluginVersion>3.1.0</warPluginVersion>

    <!-- codehaus mojo plugins -->
    <buildHelperPluginVersion>3.0.0</buildHelperPluginVersion>
    <buildNumberPluginVersion>1.4</buildNumberPluginVersion>
    <animalSnifferPluginVersion>1.15</animalSnifferPluginVersion>
    <coberturaPluginVersion>2.7</coberturaPluginVersion>
    <execPluginVersion>1.6.0</execPluginVersion>
    <findbugsPluginVersion>3.0.4</findbugsPluginVersion>
    <l10nPluginVersion>1.0-alpha-2</l10nPluginVersion>
    <licensePluginVersion>1.13</licensePluginVersion>
    <sonarPluginVersion>3.3.0.603</sonarPluginVersion>
    <tidyPluginVersion>1.0.0</tidyPluginVersion>
    <versionsPluginVersion>2.4</versionsPluginVersion>
    <wagonPluginVersion>1.0</wagonPluginVersion>

    <!-- codehaus plexus plugins -->
    <plexusPluginVersion>1.3.8</plexusPluginVersion>
    <plexusComponentMetadataPluginVersion>1.7.1</plexusComponentMetadataPluginVersion>

    <!-- nuiton plugins -->
    <helperPluginVersion>2.3.2</helperPluginVersion>

    <!-- others plugins -->
    <jettyPluginVersion>9.4.6.v20170531</jettyPluginVersion>
    <statScmPluginVersion>1.2.0</statScmPluginVersion>
    <tomcatPluginVersion>2.2</tomcatPluginVersion>
    <jgitflowPluginVersion>1.0-m5.1</jgitflowPluginVersion>
    <gitCommitIdPluginVersion>2.2.2</gitCommitIdPluginVersion>
    <nexusStaginPluginVersion>1.6.8</nexusStaginPluginVersion>
    <gmavenplusPluginVersion>1.5</gmavenplusPluginVersion>
    <launch4JPluginVersion>1.7.19</launch4JPluginVersion>
    <gitlabPluginVersion>1.0.11</gitlabPluginVersion>

    <!-- report plugins version -->
    <changesPluginVersion>2.12.1</changesPluginVersion>
    <projectInfoReportsPluginVersion>2.9</projectInfoReportsPluginVersion>
    <changelogPluginVersion>2.3</changelogPluginVersion>
    <jrxPluginVersion>2.5</jrxPluginVersion>
    <sonarReportPluginVersion>0.1</sonarReportPluginVersion>

    <!-- to deploy with scpexe for maven 3 -->
    <wagonSshExternalVersion>1.0</wagonSshExternalVersion>

    <!-- versions of javadoc tagglets -->
    <mavenPluginToolsJavadocVersion>2.8</mavenPluginToolsJavadocVersion>
    <plexusComponentJavadocVersion>1.5.5</plexusComponentJavadocVersion>

    <!-- ////////////////////////////////////////////////////////////////// -->
    <!-- //// Compiler configuration                                   //// -->
    <!-- ////////////////////////////////////////////////////////////////// -->

    <maven.compiler.source>${javaVersion}</maven.compiler.source>
    <maven.compiler.target>${javaVersion}</maven.compiler.target>
    <maven.compiler.showWarnings>true</maven.compiler.showWarnings>
    <maven.compiler.showDeprecation>true</maven.compiler.showDeprecation>
    <!-- for the moment we do not want to use incremental compilation -->
    <maven.compiler.useIncrementalCompilation>false</maven.compiler.useIncrementalCompilation>

    <!-- ////////////////////////////////////////////////////////////////// -->
    <!-- //// Javadoc configuration                                    //// -->
    <!-- ////////////////////////////////////////////////////////////////// -->

    <maven.javadoc.quiet>true</maven.javadoc.quiet>
    <javadocJreApiVersion>8</javadocJreApiVersion>

    <!-- ////////////////////////////////////////////////////////////////// -->
    <!-- //// License configuration                                    //// -->
    <!-- ////////////////////////////////////////////////////////////////// -->

    <license.useMissingFile>true</license.useMissingFile>
    <license.failIfWarning>true</license.failIfWarning>
    <license.licenseName>lgpl_v3</license.licenseName>
    <maven.license.file>${project.basedir}/LICENSE.txt</maven.license.file>
    <license.organizationName>Ultreia.io</license.organizationName>

    <!-- ////////////////////////////////////////////////////////////////// -->
    <!-- //// gitflow configuration                                    //// -->
    <!-- ////////////////////////////////////////////////////////////////// -->

    <jgitflow.masterBranchName>master</jgitflow.masterBranchName>
    <jgitflow.developBranchName>develop</jgitflow.developBranchName>
    <scmCommentPrefix> [skip ci]</scmCommentPrefix>

    <!--always deploy-->
    <maven.deploy.skip>false</maven.deploy.skip>
    <!--never build javadoc-->
    <maven.javadoc.skip>true</maven.javadoc.skip>
    <!--never build sources-->
    <maven.source.skip>true</maven.source.skip>

  </properties>

  <build>

    <resources>
      <resource>
        <directory>src/main/filtered-resources</directory>
        <filtering>true</filtering>
        <includes>
          <include>**/*</include>
        </includes>
        <excludes>
          <exclude>**/*~</exclude>
        </excludes>
      </resource>
      <resource>
        <directory>src/main/resources</directory>
        <includes>
          <include>**/*</include>
        </includes>
        <excludes>
          <exclude>**/*~</exclude>
        </excludes>
      </resource>
    </resources>
    
    <pluginManagement>

      <plugins>

        <!-- Plugins from apache -->

        <plugin>
          <artifactId>maven-antrun-plugin</artifactId>
          <version>${antRunPluginVersion}</version>
        </plugin>

        <plugin>
          <artifactId>maven-assembly-plugin</artifactId>
          <version>${assemblyPluginVersion}</version>
        </plugin>

        <plugin>
          <artifactId>maven-clean-plugin</artifactId>
          <version>${cleanPluginVersion}</version>
        </plugin>

        <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>${compilerPluginVersion}</version>
        </plugin>


        <plugin>
          <artifactId>maven-dependency-plugin</artifactId>
          <version>${dependencyPluginVersion}</version>
        </plugin>

        <plugin>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>${deployPluginVersion}</version>
        </plugin>

        <plugin>
          <artifactId>maven-ear-plugin</artifactId>
          <version>${earPluginVersion}</version>
        </plugin>

        <plugin>
          <artifactId>maven-ejb-plugin</artifactId>
          <version>${ejbPluginVersion}</version>
        </plugin>

        <plugin>
          <artifactId>maven-enforcer-plugin</artifactId>
          <version>${enforcerPluginVersion}</version>
        </plugin>

        <plugin>
          <artifactId>maven-gpg-plugin</artifactId>
          <version>${gpgPluginVersion}</version>
        </plugin>

        <plugin>
          <artifactId>maven-install-plugin</artifactId>
          <version>${installPluginVersion}</version>
        </plugin>

        <plugin>
          <artifactId>maven-invoker-plugin</artifactId>
          <version>${invokerPluginVersion}</version>
        </plugin>

        <plugin>
          <artifactId>maven-jar-plugin</artifactId>
          <version>${jarPluginVersion}</version>
          <inherited>true</inherited>
          <configuration>
            <archive>
              <manifest>
                <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
              </manifest>
              <manifestEntries>
                <url>${project.url}</url>
              </manifestEntries>
            </archive>
          </configuration>
        </plugin>

        <plugin>
          <artifactId>maven-jarsigner-plugin</artifactId>
          <version>${jarSignerPluginVersion}</version>
        </plugin>

        <plugin>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>${javadocPluginVersion}</version>
          <configuration>
            <quiet>${maven.javadoc.quiet}</quiet>
            <charset>${project.reporting.outputEncoding}</charset>
            <links>
              <link>http://docs.oracle.com/javase/${javadocJreApiVersion}/docs/api</link>
            </links>
            <tagletArtifacts>
              <tagletArtifact>
                <groupId>org.apache.maven.plugin-tools</groupId>
                <artifactId>maven-plugin-tools-javadoc</artifactId>
                <version>${mavenPluginToolsJavadocVersion}</version>
              </tagletArtifact>
              <tagletArtifact>
                <groupId>org.codehaus.plexus</groupId>
                <artifactId>plexus-component-javadoc</artifactId>
                <version>${plexusComponentJavadocVersion}</version>
              </tagletArtifact>
            </tagletArtifacts>
          </configuration>
        </plugin>

        <plugin>
          <artifactId>maven-plugin-plugin</artifactId>
          <version>${pluginPluginVersion}</version>
        </plugin>

        <plugin>
          <artifactId>maven-pmd-plugin</artifactId>
          <version>${pmdPluginVersion}</version>
        </plugin>

        <plugin>
          <artifactId>maven-release-plugin</artifactId>
          <version>${releasePluginVersion}</version>
        </plugin>

        <plugin>
          <artifactId>maven-remote-resources-plugin</artifactId>
          <version>${remoteResourcesPluginVersion}</version>
        </plugin>

        <plugin>
          <artifactId>maven-resources-plugin</artifactId>
          <version>${resourcesPluginVersion}</version>
        </plugin>

        <plugin>
          <artifactId>maven-shade-plugin</artifactId>
          <version>${shadePluginVersion}</version>
        </plugin>

        <plugin>
          <artifactId>maven-site-plugin</artifactId>
          <version>${sitePluginVersion}</version>
          <configuration>
            <skipDeploy>true</skipDeploy><!-- don't deploy site with maven-site-plugin -->
          </configuration>
        </plugin>

        <plugin>
          <artifactId>maven-source-plugin</artifactId>
          <version>${sourcePluginVersion}</version>
        </plugin>

        <plugin>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>${surefirePluginVersion}</version>
          <configuration>
            <systemPropertyVariables>
              <java.io.tmpdir>
                ${project.build.directory}/surefire-workdir
              </java.io.tmpdir>
            </systemPropertyVariables>
          </configuration>
        </plugin>

        <plugin>
          <artifactId>maven-war-plugin</artifactId>
          <version>${warPluginVersion}</version>
        </plugin>

        <!-- Plugins from codehaus mojo -->

        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>animal-sniffer-maven-plugin</artifactId>
          <version>${animalSnifferPluginVersion}</version>
        </plugin>

        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>cobertura-maven-plugin</artifactId>
          <version>${coberturaPluginVersion}</version>
        </plugin>

        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>exec-maven-plugin</artifactId>
          <version>${execPluginVersion}</version>
        </plugin>

        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>build-helper-maven-plugin</artifactId>
          <version>${buildHelperPluginVersion}</version>
        </plugin>

        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>buildnumber-maven-plugin</artifactId>
          <version>${buildNumberPluginVersion}</version>
        </plugin>

        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>findbugs-maven-plugin</artifactId>
          <version>${findbugsPluginVersion}</version>
        </plugin>

        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>l10n-maven-plugin</artifactId>
          <version>${l10nPluginVersion}</version>
        </plugin>

        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>license-maven-plugin</artifactId>
          <version>${licensePluginVersion}</version>
        </plugin>

        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>sonar-maven-plugin</artifactId>
          <version>${sonarPluginVersion}</version>
        </plugin>

        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>tidy-maven-plugin</artifactId>
          <version>${tidyPluginVersion}</version>
        </plugin>

        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>versions-maven-plugin</artifactId>
          <version>${versionsPluginVersion}</version>
          <configuration>
            <generateBackupPoms>false</generateBackupPoms>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>wagon-maven-plugin</artifactId>
          <version>${wagonPluginVersion}</version>
        </plugin>

        <!-- Plugins from codehaus plexus -->

        <plugin>
          <groupId>org.codehaus.plexus</groupId>
          <artifactId>plexus-component-metadata</artifactId>
          <version>${plexusComponentMetadataPluginVersion}</version>
        </plugin>

        <plugin>
          <groupId>org.codehaus.plexus</groupId>
          <artifactId>plexus-maven-plugin</artifactId>
          <version>${plexusPluginVersion}</version>
        </plugin>


        <!-- Plugins from nuiton -->
        <plugin>
          <groupId>org.nuiton</groupId>
          <artifactId>helper-maven-plugin</artifactId>
          <version>${helperPluginVersion}</version>
        </plugin>

        <!-- Plugins from others -->

        <plugin>
          <groupId>org.eclipse.jetty</groupId>
          <artifactId>jetty-maven-plugin</artifactId>
          <version>${jettyPluginVersion}</version>
        </plugin>

        <plugin>
          <groupId>org.eclipse.jetty</groupId>
          <artifactId>jetty-jspc-maven-plugin</artifactId>
          <version>${jettyPluginVersion}</version>
        </plugin>

        <plugin>
          <groupId>org.apache.tomcat.maven</groupId>
          <artifactId>tomcat6-maven-plugin</artifactId>
          <version>${tomcatPluginVersion}</version>
        </plugin>

        <plugin>
          <groupId>org.apache.tomcat.maven</groupId>
          <artifactId>tomcat7-maven-plugin</artifactId>
          <version>${tomcatPluginVersion}</version>
        </plugin>

        <plugin>
          <groupId>external.atlassian.jgitflow</groupId>
          <artifactId>jgitflow-maven-plugin</artifactId>
          <version>${jgitflowPluginVersion}</version>
          <configuration>
            <flowInitContext>
              <versionTagPrefix>v</versionTagPrefix>
              <masterBranchName>${jgitflow.masterBranchName}</masterBranchName>
              <developBranchName>${jgitflow.developBranchName}</developBranchName>
            </flowInitContext>
            <scmCommentPrefix>[jgitflow-maven-plugin]</scmCommentPrefix>
            <scmCommentSuffix> [skip ci]</scmCommentSuffix>
            <autoVersionSubmodules>true</autoVersionSubmodules>
          </configuration>
          <executions>
            <execution>
              <id>default-cli</id>
              <goals>
                <goal>release-finish</goal>
              </goals>
              <configuration>
                <pushReleases>true</pushReleases>
                <enableSshAgent>true</enableSshAgent>
              </configuration>
            </execution>
          </executions>
        </plugin>

        <plugin>
          <groupId>net.sf</groupId>
          <artifactId>stat-scm</artifactId>
          <version>${statScmPluginVersion}</version>
        </plugin>

        <plugin>
          <groupId>pl.project13.maven</groupId>
          <artifactId>git-commit-id-plugin</artifactId>
          <version>${gitCommitIdPluginVersion}</version>
        </plugin>

        <plugin>
          <groupId>org.sonatype.plugins</groupId>
          <artifactId>nexus-staging-maven-plugin</artifactId>
          <version>${nexusStaginPluginVersion}</version>
          <extensions>true</extensions>
          <configuration>
            <serverId>ossrh</serverId>
            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
            <autoReleaseAfterClose>true</autoReleaseAfterClose>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.codehaus.gmavenplus</groupId>
          <artifactId>gmavenplus-plugin</artifactId>
          <version>${gmavenplusPluginVersion}</version>
          <dependencies>
            <dependency>
              <groupId>org.codehaus.groovy</groupId>
              <artifactId>groovy-all</artifactId>
              <version>2.5.0-beta-1</version>
              <scope>runtime</scope>
            </dependency>
          </dependencies>
        </plugin>

        <plugin>
          <groupId>com.akathist.maven.plugins.launch4j</groupId>
          <artifactId>launch4j-maven-plugin</artifactId>
          <version>${launch4JPluginVersion}</version>
        </plugin>

        <plugin>
          <groupId>io.ultreia.maven</groupId>
          <artifactId>gitlab-maven-plugin</artifactId>
          <version>${gitlabPluginVersion}</version>
          <configuration>
            <host>https://gitlab.com</host>
            <serverId>gitlab.com</serverId>
            <organizationId>${organizationId}</organizationId>
            <projectId>${projectId}</projectId>
            <changesFile>${project.build.directory}/generated-site/changes.xml</changesFile>
          </configuration>
        </plugin>

      </plugins>
    </pluginManagement>
    <plugins>

      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <id>generate-surefire-workdir</id>
            <phase>generate-test-sources</phase>
            <configuration>
              <!-- do not generate if tests are skipped -->
              <!--suppress MavenModelInspection -->
              <skip>${maven.test.skip}</skip>
              <target>
                <mkdir dir="${basedir}/target/surefire-workdir" />
              </target>
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <artifactId>maven-enforcer-plugin</artifactId>
        <executions>
          <execution>
            <id>enforce-project-files</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <phase>validate</phase>
            <configuration>
              <rules>
                <requireFilesExist>
                  <files>
                    <file>LICENSE.txt</file>
                    <file>README.md</file>
                  </files>
                </requireFilesExist>
              </rules>
              <ignoreCache>true</ignoreCache>
              <failFast>true</failFast>
              <fail>true</fail>

            </configuration>
          </execution>

          <execution>
            <id>enforce-organizationId</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <phase>validate</phase>
            <configuration>
              <rules>
                <requireProperty>
                  <property>organizationId</property>
                  <message>"organizationId property must be specified."</message>
                  <regex>.+$</regex>
                  <regexMessage>"organizationId property can not be empty."</regexMessage>
                </requireProperty>
              </rules>
              <ignoreCache>true</ignoreCache>
              <failFast>true</failFast>
              <fail>true</fail>
            </configuration>
          </execution>

          <execution>
            <id>enforce-projectId</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <phase>validate</phase>
            <configuration>
              <rules>
                <requireProperty>
                  <property>projectId</property>
                  <message>"projectId property must be specified."</message>
                  <regex>.+$</regex>
                  <regexMessage>"projectId property can not be empty."</regexMessage>
                </requireProperty>
              </rules>
              <ignoreCache>true</ignoreCache>
              <failFast>true</failFast>
              <fail>true</fail>
            </configuration>
          </execution>

        </executions>
      </plugin>

    </plugins>
  </build>

  <reporting>
    <excludeDefaults>true</excludeDefaults>
  </reporting>

  <profiles>

    <!-- perform only on a release stage when using the maven-release-plugin -->
    <profile>
      <id>license-profile</id>
      <activation>
        <property>
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>

      <build>

        <defaultGoal>generate-resources</defaultGoal>

        <plugins>

          <!-- add license and third-party files to build -->
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>license-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-licenses</id>
                <goals>
                  <goal>update-project-license</goal>
                  <goal>add-third-party</goal>
                </goals>
                <configuration>
                  <licenseMerges>
                    <licenseMerge>
                      The Apache Software License, Version 2.0|Apache License, Version 2.0|Apache License V2.0|Apache
                      2|ASF 2.0|apache-2.0|Apache Public License 2.0
                    </licenseMerge>
                    <licenseMerge>BSD License|BSD license|BSD</licenseMerge>
                    <licenseMerge>MIT License|MIT license|MIT</licenseMerge>
                    <licenseMerge>
                      Lesser General Public License (LPGL) v 2.1|GNU Lesser General Public License, 2.1|LGPL 2.1
                    </licenseMerge>
                    <licenseMerge>
                      Lesser General Public License (LPGL)|GNU Lesser General Public License|GNU LESSER GENERAL PUBLIC
                      LICENSE|LGPL|lgpl
                    </licenseMerge>
                    <licenseMerge>
                      COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0|Common Development and Distribution
                      License (CDDL) v1.0
                    </licenseMerge>
                    <licenseMerge>Indiana University Extreme! Lab Software License, version 1.1.1|Indiana University
                      Extreme! Lab Software License
                    </licenseMerge>
                  </licenseMerges>
                </configuration>
              </execution>
            </executions>
          </plugin>

        </plugins>

      </build>
    </profile>

    <!-- perform only on a release to do quality checks on release -->
    <profile>
      <id>release-quality-profile</id>
      <activation>
        <property>
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>

      <build>
        <plugins>

          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>animal-sniffer-maven-plugin</artifactId>
            <executions>
              <execution>
                <goals>
                  <goal>check</goal>
                </goals>
                <configuration>
                  <signature>
                    <groupId>org.codehaus.mojo.signature</groupId>
                    <artifactId>${signatureArtifactId}</artifactId>
                    <version>${signatureVersion}</version>
                  </signature>
                </configuration>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <artifactId>maven-enforcer-plugin</artifactId>
            <executions>
              <execution>
                <goals>
                  <goal>enforce</goal>
                </goals>
                <id>ensure-no-container-api</id>
                <configuration>
                  <rules>
                    <bannedDependencies>
                      <excludes>
                        <exclude>
                          org.codehaus.plexus:plexus-component-api
                        </exclude>
                      </excludes>
                      <message>
                        The new containers are not supported. You
                        probably added a dependency that is missing the
                        exclusions.
                      </message>
                    </bannedDependencies>
                  </rules>
                  <fail>true</fail>
                </configuration>
              </execution>
              <execution>
                <id>enforce-bytecode-version</id>
                <goals>
                  <goal>enforce</goal>
                </goals>
                <configuration>
                  <rules>
                    <enforceBytecodeVersion>
                      <maxJdkVersion>${javaVersion}</maxJdkVersion>
                    </enforceBytecodeVersion>
                  </rules>
                  <fail>true</fail>
                </configuration>
              </execution>
            </executions>
            <dependencies>
              <dependency>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>extra-enforcer-rules</artifactId>
                <version>1.0-beta-4</version>
              </dependency>
            </dependencies>
          </plugin>

        </plugins>
      </build>
    </profile>

    <profile>
      <id>release-sign-artifacts</id>
      <activation>
        <property>
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.nuiton</groupId>
            <artifactId>helper-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>get-pgp-passphrase</id>
                <goals>
                  <goal>share-server-secret</goal>
                </goals>
                <phase>verify</phase>
                <configuration>
                  <serverId>ultreia-gpg-signer</serverId>
                  <usernameOut>gpg.keyname</usernameOut>
                  <passwordOut>gpg.passphrase</passwordOut>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-gpg-plugin</artifactId>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <!-- This profile update license stuff with new goal update-file-header -->
    <profile>
      <id>update-file-header</id>
      <activation>
        <property>
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>

      <properties>
        <license.descriptor>src/license/project.xml</license.descriptor>
        <license.excludes>**/i18n/*.properties,**/THIRD-PARTY.properties,**/*.sh</license.excludes>
      </properties>
      <build>
        <defaultGoal>process-resources</defaultGoal>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>license-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>update-file-header</id>
                <goals>
                  <goal>update-file-header</goal>
                </goals>
                <phase>process-resources</phase>
              </execution>
              <execution>
                <id>update-pom-header</id>
                <goals>
                  <goal>update-file-header</goal>
                </goals>
                <configuration>
                  <roots>
                    <root>${project.basedir}</root>
                  </roots>
                  <includes>
                    <include>pom.xml</include>
                  </includes>
                </configuration>
                <phase>process-resources</phase>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>analyze-dependencies</id>
      <activation>
        <property>
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>
      <build>
        <defaultGoal>verify</defaultGoal>
        <plugins>
          <plugin>
            <artifactId>maven-dependency-plugin</artifactId>
            <inherited>true</inherited>
            <executions>
              <execution>
                <id>analyze</id>
                <goals>
                  <goal>analyze-only</goal>
                </goals>
                <configuration>
                  <verbose>true</verbose>
                  <failOnWarning>true</failOnWarning>
                  <ignoreNonCompile>true</ignoreNonCompile>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <!-- do not generate site if no src/site is found for module -->
    <profile>
      <id>no-site</id>
      <activation>
        <file>
          <missing>src/site</missing>
        </file>
      </activation>

      <properties>
        <!-- no site generation -->
        <maven.site.skip>true</maven.site.skip>
        <maven.site.deploy.skip>true</maven.site.deploy.skip>
      </properties>

    </profile>

    <profile>
      <id>maven-3</id>
      <activation>
        <file>
          <!--  This employs that the basedir expression is only recognized by Maven 3.x (see MNG-2363) -->
          <exists>${basedir}</exists>
        </file>
      </activation>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-site-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-descriptor</id>
                <goals>
                  <goal>attach-descriptor</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <!-- change version adding commit hash as classifier -->
    <profile>

      <id>add-git-commit-id-to-project-version</id>
      <build>

        <defaultGoal>initialize</defaultGoal>

        <plugins>
          <plugin>
            <groupId>pl.project13.maven</groupId>
            <artifactId>git-commit-id-plugin</artifactId>
            <executions>
              <execution>
                <goals>
                  <goal>revision</goal>
                </goals>
                <phase>initialize</phase>
              </execution>
            </executions>
            <configuration>
              <runOnlyOnce>true</runOnlyOnce>
              <skipPoms>false</skipPoms>
              <includeOnlyProperties>
                <includeOnlyProperty>git\.commit\.id\.abbrev</includeOnlyProperty>
              </includeOnlyProperties>
            </configuration>
          </plugin>

          <plugin>
            <groupId>org.nuiton</groupId>
            <artifactId>helper-maven-plugin</artifactId>
            <executions>
              <execution>
                <goals>
                  <goal>transform-project-version</goal>
                </goals>
                <phase>initialize</phase>
              </execution>
            </executions>
            <configuration>
              <runOnce>true</runOnce>
              <newVersionPattern>#V-rev#R</newVersionPattern>
              <revision>#git.commit.id.abbrev</revision>
              <versionKey>newVersion</versionKey>
            </configuration>
          </plugin>

          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>versions-maven-plugin</artifactId>
            <executions>
              <execution>
                <goals>
                  <goal>set</goal>
                </goals>
                <phase>initialize</phase>
              </execution>
            </executions>
          </plugin>

        </plugins>

      </build>
    </profile>

    <profile>
      <id>update-changelog</id>
      <build>
        <defaultGoal>generate-resources</defaultGoal>
        <plugins>
          <plugin>
            <groupId>io.ultreia.maven</groupId>
            <artifactId>gitlab-maven-plugin</artifactId>
            <executions>
              <execution>
                <goals>
                  <goal>generate-changelog</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>update-staging-changelog</id>
      <build>
        <defaultGoal>generate-resources</defaultGoal>
        <plugins>
          <plugin>
            <groupId>io.ultreia.maven</groupId>
            <artifactId>gitlab-maven-plugin</artifactId>
            <executions>
              <execution>
                <goals>
                  <!--suppress MavenModelInspection -->
                  <goal>generate-staging-changelog</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <!-- Profile to build the pom project -->
    <profile>
      <id>internal</id>
      <activation>
        <file>
          <exists>${basedir}/.pom-project-do-not-delete.txt</exists>
        </file>
      </activation>
      <properties>
        <organizationId>ultreiaio</organizationId>
        <projectId>pom</projectId>
        <maven.deploy.skip>false</maven.deploy.skip>
        <maven.site.skip>true</maven.site.skip>
        <maven.site.deploy.skip>true</maven.site.deploy.skip>
      </properties>
    </profile>

  </profiles>
</project>
