<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <artifactId>maven-build</artifactId>
    <description>Parent pom for maven based projects</description>
    <groupId>cn.home1</groupId>
    <name>maven-build</name>
    <packaging>pom</packaging>
    <url>https://github.com/ci-and-cd/maven-build</url>
    <version>0.3.7</version>

    <modules>
        <module>build-docker</module>
    </modules>

    <developers>
        <developer>
            <name>Haolun Zhang</name>
            <url>https://github.com/chshawkn</url>
        </developer>
    </developers>

    <!-- For this to work, you must go to: Preferences->Editor->Code Style->Formatter Control and check Enable formatter markers in comments -->
    <!-- @formatter:off -->
    <ciManagement><system>Travis CI</system><url>https://travis-ci.org/ci-and-cd/maven-build</url></ciManagement>
    <issueManagement><system>GitHub Issues</system><url>https://github.com/ci-and-cd/maven-build/issues</url></issueManagement>
    <licenses><license><name>MIT License</name><url>http://www.opensource.org/licenses/mit-license.php</url><distribution>repo</distribution></license></licenses>
    <scm>
        <url>https://github.com/ci-and-cd/maven-build</url>
        <connection>scm:git:https://github.com/ci-and-cd/maven-build.git</connection>
        <developerConnection>scm:git:ssh://git@github.com/ci-and-cd/maven-build.git</developerConnection>
        <tag>HEAD</tag>
    </scm>
    <!-- @formatter:on -->

    <repositories>
        <!-- @formatter:off -->
        <repository>
            <id>central</id><url>http://repo1.maven.org/maven2</url>
            <releases><enabled>true</enabled><updatePolicy>${repositories.releases.updatePolicy}</updatePolicy></releases>
            <snapshots><enabled>false</enabled></snapshots>
        </repository>
        <repository>
            <id>spring-libs-release</id>
            <url>http://repo.spring.io/libs-release</url>
            <releases><enabled>true</enabled><updatePolicy>${repositories.releases.updatePolicy}</updatePolicy></releases>
            <snapshots><enabled>false</enabled></snapshots>
        </repository>
        <repository>
            <id>spring-milestone</id>
            <url>http://repo.spring.io/milestone</url>
            <releases><enabled>true</enabled><updatePolicy>${repositories.releases.updatePolicy}</updatePolicy></releases>
            <snapshots><enabled>false</enabled></snapshots>
        </repository>
        <repository>
            <id>spring-libs-snapshot</id>
            <url>http://repo.spring.io/libs-snapshot</url>
            <releases><enabled>false</enabled></releases>
            <snapshots><enabled>true</enabled><updatePolicy>${repositories.snapshots.updatePolicy}</updatePolicy></snapshots>
        </repository>
        <repository>
            <id>OSSRH-releases</id>
            <name>central releases</name>
            <url>https://oss.sonatype.org/content/repositories/releases/</url>
            <releases><enabled>true</enabled><updatePolicy>${repositories.releases.updatePolicy}</updatePolicy></releases>
            <snapshots><enabled>false</enabled></snapshots>
        </repository>
        <repository>
            <id>OSSRH-snapshots</id>
            <name>central snapshots</name>
            <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
            <releases><enabled>false</enabled></releases>
            <snapshots><enabled>true</enabled><updatePolicy>${repositories.snapshots.updatePolicy}</updatePolicy></snapshots>
        </repository>
        <repository>
            <id>OSSRH-thirdparty</id>
            <name>central thirdparty</name>
            <url>https://oss.sonatype.org/content/repositories/third-party-releases/</url>
            <releases><enabled>true</enabled></releases>
            <snapshots><enabled>false</enabled></snapshots>
        </repository>
        <!-- @formatter:on -->
    </repositories>

    <pluginRepositories>
        <!-- @formatter:off -->
        <pluginRepository>
            <id>central</id>
            <url>http://repo1.maven.org/maven2</url>
            <releases><enabled>true</enabled><updatePolicy>${repositories.releases.updatePolicy}</updatePolicy></releases>
            <snapshots><enabled>false</enabled></snapshots>
        </pluginRepository>
        <pluginRepository>
            <id>spring-libs-release</id>
            <url>http://repo.spring.io/libs-release</url>
            <releases><enabled>true</enabled><updatePolicy>${repositories.releases.updatePolicy}</updatePolicy></releases>
            <snapshots><enabled>false</enabled></snapshots>
        </pluginRepository>
        <pluginRepository>
            <id>spring-milestone</id>
            <url>http://repo.spring.io/milestone</url>
            <releases><enabled>true</enabled><updatePolicy>${repositories.releases.updatePolicy}</updatePolicy></releases>
            <snapshots><enabled>false</enabled></snapshots>
        </pluginRepository>
        <pluginRepository>
            <id>spring-libs-snapshot</id>
            <url>http://repo.spring.io/libs-snapshot</url>
            <releases><enabled>false</enabled></releases>
            <snapshots><enabled>true</enabled><updatePolicy>${repositories.snapshots.updatePolicy}</updatePolicy></snapshots>
        </pluginRepository>
        <pluginRepository>
            <id>OSSRH-releases</id>
            <name>central releases</name>
            <url>https://oss.sonatype.org/content/repositories/releases/</url>
            <releases><enabled>true</enabled><updatePolicy>${repositories.releases.updatePolicy}</updatePolicy></releases>
            <snapshots><enabled>false</enabled></snapshots>
        </pluginRepository>
        <pluginRepository>
            <id>OSSRH-snapshots</id>
            <name>central snapshots</name>
            <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
            <releases><enabled>false</enabled></releases>
            <snapshots><enabled>true</enabled><updatePolicy>${repositories.snapshots.updatePolicy}</updatePolicy></snapshots>
        </pluginRepository>
        <pluginRepository>
            <id>OSSRH-thirdparty</id>
            <name>central thirdparty</name>
            <url>https://oss.sonatype.org/content/repositories/third-party-releases/</url>
            <releases><enabled>true</enabled></releases>
            <snapshots><enabled>false</enabled></snapshots>
        </pluginRepository>
        <pluginRepository>
            <id>github-mvn-repo-github-maven-plugins</id>
            <url>https://raw.github.com/ci-and-cd/maven-plugins/mvn-repo</url>
            <name>Forked github-maven-plugins that upload faster</name>
            <layout>default</layout>
            <snapshots><enabled>true</enabled></snapshots>
            <releases><enabled>true</enabled></releases>
        </pluginRepository>
        <pluginRepository>
            <id>github-mvn-repo-wagon-maven-plugin</id>
            <url>https://raw.github.com/ci-and-cd/wagon-maven-plugin/mvn-repo/</url>
            <name>Fixed issue of merge snapshotVersion</name>
            <layout>default</layout>
            <snapshots><enabled>true</enabled></snapshots>
            <releases><enabled>true</enabled></releases>
        </pluginRepository>
        <!-- @formatter:on -->
    </pluginRepositories>

    <properties>
        <com.google.errorprone_error_prone_core.version>2.3.1</com.google.errorprone_error_prone_core.version>
        <downloadSources>true</downloadSources>

        <surefire.fork.count>1</surefire.fork.count>
        <surefire.fork.reuse>false</surefire.fork.reuse>

        <git-commit-id.skip>false</git-commit-id.skip>

        <groovy.version>2.4.15</groovy.version>
        <!--<groovy-eclipse-compiler.version>2.9.2-02</groovy-eclipse-compiler.version>-->
        <!--<groovy-eclipse-batch.version>2.4.12-03</groovy-eclipse-batch.version>-->
        <groovy-eclipse-compiler.version>2.9.3-01</groovy-eclipse-compiler.version>
        <groovy-eclipse-batch.version>2.4.15-01</groovy-eclipse-batch.version>
        <!--<groovy-eclipse-compiler.version>3.0.0-01</groovy-eclipse-compiler.version>-->
        <!--<groovy-eclipse-batch.version>2.5.1-02</groovy-eclipse-batch.version>-->

        <jacoco.reportPath>${project.build.directory}/jacoco.exec</jacoco.reportPath>
        <jacoco.itReportPath>${project.build.directory}/jacoco-it.exec</jacoco.itReportPath>

        <!--<kotlin.version>1.1.2-2</kotlin.version>-->
        <!--<kotlin.version>1.2.51</kotlin.version>-->
        <kotlin.version>1.2.60</kotlin.version>
        <lombok.version>1.18.2</lombok.version>

        <maven.compiler.encoding>UTF-8</maven.compiler.encoding>

        <org.codehaus.plexus_plexus-compiler-javac-errorprone>2.8.4</org.codehaus.plexus_plexus-compiler-javac-errorprone>
        <org.jacoco_jacoco.version>0.8.1</org.jacoco_jacoco.version>
        <org.sonarsource.java_sonar-jacoco-listeners.version>5.3.0.13828</org.sonarsource.java_sonar-jacoco-listeners.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

        <repositories.releases.updatePolicy>always</repositories.releases.updatePolicy>
        <repositories.snapshots.updatePolicy>always</repositories.snapshots.updatePolicy>

        <scala.version>2.12.6</scala.version>
    </properties>

    <build>
        <pluginManagement>
            <plugins>
                <!-- @formatter:off -->
                <plugin><groupId>com.amashchenko.maven.plugin</groupId><artifactId>gitflow-maven-plugin</artifactId><version>1.9.0</version></plugin>
                <plugin><groupId>com.mysema.maven</groupId><artifactId>apt-maven-plugin</artifactId><version>1.1.3</version></plugin>
                <plugin><groupId>com.soebes.maven.plugins</groupId><artifactId>echo-maven-plugin</artifactId><version>0.3.0</version></plugin>
                <!-- TODO find a newer plugin for groovy scripts to replace gmaven-plugin -->
                <!--<plugin><groupId>org.codehaus.groovy.maven</groupId><artifactId>gmaven-plugin</artifactId><version>1.0</version></plugin>-->
                <plugin>
                    <groupId>org.codehaus.gmaven</groupId><artifactId>groovy-maven-plugin</artifactId><version>2.1</version>
                    <dependencies><dependency><groupId>org.codehaus.groovy</groupId><artifactId>groovy-all</artifactId><version>${groovy.version}</version></dependency></dependencies>
                </plugin>
                <plugin><groupId>org.codehaus.mojo</groupId><artifactId>build-helper-maven-plugin</artifactId><version>3.0.0</version></plugin>
                <plugin><groupId>org.codehaus.mojo</groupId><artifactId>properties-maven-plugin</artifactId><version>1.0.0</version></plugin>
                <plugin>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <version>1.8</version>
                    <dependencies>
                        <dependency><groupId>ant-contrib</groupId><artifactId>ant-contrib</artifactId><version>20020829</version></dependency>
                    </dependencies>
                </plugin>
                <plugin><artifactId>maven-clean-plugin</artifactId><version>3.1.0</version></plugin>
                <plugin><artifactId>maven-compiler-plugin</artifactId><version>3.8.0</version></plugin>
                <plugin><artifactId>maven-dependency-plugin</artifactId><version>3.1.0</version></plugin>
                <plugin><artifactId>maven-deploy-plugin</artifactId><version>2.8.2</version></plugin>
                <plugin><artifactId>maven-enforcer-plugin</artifactId><version>3.0.0-M1</version></plugin>
                <plugin><artifactId>maven-failsafe-plugin</artifactId><version>2.21.0</version></plugin>
                <plugin><artifactId>maven-gpg-plugin</artifactId><version>1.6</version></plugin>
                <plugin><artifactId>maven-install-plugin</artifactId><version>2.5.2</version></plugin>
                <plugin><artifactId>maven-jar-plugin</artifactId><version>3.1.0</version></plugin>
                <plugin><artifactId>maven-javadoc-plugin</artifactId><version>3.0.0</version></plugin>
                <plugin><artifactId>maven-source-plugin</artifactId><version>3.0.1</version></plugin>
                <plugin><artifactId>maven-resources-plugin</artifactId><version>3.0.1</version></plugin>
                <plugin><artifactId>maven-surefire-plugin</artifactId><version>2.21.0</version></plugin>
                <plugin><artifactId>maven-toolchains-plugin</artifactId><version>1.1</version></plugin>

                <plugin><artifactId>maven-project-info-reports-plugin</artifactId><version>3.0.0</version></plugin>
                <!-- @formatter:on -->

                <!-- @formatter:off -->
                <plugin>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>3.7.1</version>
                    <dependencies>
                        <dependency><groupId>org.apache.maven.doxia</groupId><artifactId>doxia-module-markdown</artifactId><version>1.8</version></dependency>
                        <dependency><groupId>org.pegdown</groupId><artifactId>pegdown</artifactId><version>1.6.0</version></dependency>
                        <dependency><groupId>org.apache.maven.wagon</groupId><artifactId>wagon-webdav-jackrabbit</artifactId><version>3.0.0</version></dependency>
                        <!-- org.apache.maven.wagon:wagon-ssh support ssh/scp and password only -->
                        <dependency>
                            <groupId>org.apache.maven.wagon</groupId>
                            <artifactId>wagon-ssh</artifactId>
                            <version>3.0.0</version>
                            <exclusions>
                                <exclusion><groupId>com.jcraft</groupId><artifactId>jsch</artifactId></exclusion>
                            </exclusions>
                        </dependency>
                        <dependency><groupId>com.jcraft</groupId><artifactId>jsch</artifactId><version>0.1.54</version></dependency>
                        <!-- support for sshexe/scpexe and privateKey -->
                        <dependency><groupId>org.apache.maven.wagon</groupId><artifactId>wagon-ssh-external</artifactId><version>3.0.0</version></dependency>
                        <!-- provide org.apache.maven.wagon.providers.ssh.knownhost.NullKnownHostProvider -->
                        <dependency>
                            <groupId>org.apache.maven.wagon</groupId>
                            <artifactId>wagon-ssh-common</artifactId>
                            <version>3.0.0</version>
                            <exclusions>
                                <exclusion><groupId>org.codehaus.plexus</groupId><artifactId>plexus-utils</artifactId></exclusion>
                            </exclusions>
                        </dependency>
                    </dependencies>
                    <!-- see: http://maven.apache.org/plugins/maven-site-plugin/maven-3.html#Site_descriptor_attachment -->
                    <executions>
                        <execution><id>attach-descriptor</id><goals><goal>attach-descriptor</goal></goals></execution>
                    </executions>
                </plugin>
                <!-- @formatter:on -->

                <!-- @formatter:off -->
                <plugin><groupId>org.asciidoctor</groupId><artifactId>asciidoctor-maven-plugin</artifactId><version>1.5.6</version></plugin>
                <plugin><groupId>org.owasp</groupId><artifactId>dependency-check-maven</artifactId><version>3.1.2</version></plugin>
                <plugin><groupId>org.codehaus.mojo</groupId><artifactId>animal-sniffer-maven-plugin</artifactId><version>1.16</version></plugin>
                <plugin><groupId>org.codehaus.mojo</groupId><artifactId>findbugs-maven-plugin</artifactId><version>3.0.5</version></plugin>
                <plugin><groupId>org.codehaus.mojo</groupId><artifactId>jdepend-maven-plugin</artifactId><version>2.0</version></plugin>
                <plugin><groupId>org.codehaus.mojo</groupId><artifactId>taglist-maven-plugin</artifactId><version>2.4</version></plugin>
                <plugin><groupId>org.codehaus.mojo</groupId><artifactId>versions-maven-plugin</artifactId><version>2.5</version></plugin>
                <plugin>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <version>3.0.0</version>
                    <dependencies>
                        <!--<dependency><groupId>com.puppycrawl.tools</groupId><artifactId>checkstyle</artifactId><version>6.19</version></dependency>-->
                        <dependency><groupId>com.puppycrawl.tools</groupId><artifactId>checkstyle</artifactId><version>8.10</version></dependency>
                    </dependencies>
                </plugin>
                <plugin><artifactId>maven-jxr-plugin</artifactId><version>2.5</version></plugin>
                <!-- maven-pmd-plugin:3.6   depends on net.sourceforge.pmd:pmd:5.3.5 -->
                <!-- maven-pmd-plugin:3.7   depends on net.sourceforge.pmd:pmd:5.5.1 -->
                <!-- maven-pmd-plugin:3.9.0 depends on net.sourceforge.pmd:pmd:6.4.0 -->
                <!-- maven-pmd-plugin:3.10.0 depends on net.sourceforge.pmd:pmd:6.4.0 -->
                <plugin><artifactId>maven-pmd-plugin</artifactId><version>3.10.0</version></plugin>
                <plugin><artifactId>maven-surefire-report-plugin</artifactId><version>2.21.0</version></plugin>

                <plugin>
                    <groupId>pl.project13.maven</groupId>
                    <artifactId>git-commit-id-plugin</artifactId>
                    <version>2.2.4</version>
                    <executions>
                        <execution>
                            <id>get-the-git-infos</id>
                            <phase>initialize</phase>
                            <goals><goal>revision</goal></goals>
                        </execution>
                    </executions>
                    <configuration>
                        <commitIdGenerationMode>flat</commitIdGenerationMode>
                        <dotGitDirectory>${maven.multiModuleProjectDirectory}/.git</dotGitDirectory>
                        <failOnNoGitDirectory>false</failOnNoGitDirectory>
                        <failOnUnableToExtractRepoInfo>true</failOnUnableToExtractRepoInfo>
                        <generateGitPropertiesFile>true</generateGitPropertiesFile>
                        <!--generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename-->
                        <generateGitPropertiesFilename>src/main/resources/git.properties</generateGitPropertiesFilename>
                        <injectAllReactorProjects>true</injectAllReactorProjects>
                        <prefix>git</prefix>
                        <skip>${git-commit-id.skip}</skip>
                        <skipPoms>false</skipPoms>
                        <verbose>false</verbose>
                    </configuration>
                </plugin>
                <!-- @formatter:on -->
            </plugins>
        </pluginManagement>
        <plugins>
            <!-- see: https://github.com/KimJejun/gitflow-maven-plugin -->
            <plugin>
                <groupId>com.amashchenko.maven.plugin</groupId>
                <artifactId>gitflow-maven-plugin</artifactId>
                <configuration>
                    <tychoBuild>false</tychoBuild>

                    <installProject>false</installProject>
                    <verbose>false</verbose>

                    <gitFlowConfig>
                        <productionBranch>master</productionBranch>
                        <developmentBranch>develop</developmentBranch>
                        <featureBranchPrefix>feature/</featureBranchPrefix>
                        <releaseBranchPrefix>release/</releaseBranchPrefix>
                        <hotfixBranchPrefix>hotfix/</hotfixBranchPrefix>
                        <supportBranchPrefix>support/</supportBranchPrefix>
                        <versionTagPrefix>v</versionTagPrefix>
                    </gitFlowConfig>

                    <commitMessages>
                        <featureStartMessage>updating versions for feature branch</featureStartMessage>
                        <featureFinishMessage>updating versions for development branch</featureFinishMessage>

                        <hotfixStartMessage>updating versions for hotfix</hotfixStartMessage>
                        <hotfixFinishMessage>updating for next development version</hotfixFinishMessage>

                        <releaseStartMessage>updating versions for release</releaseStartMessage>
                        <releaseFinishMessage>updating for next development version</releaseFinishMessage>

                        <tagHotfixMessage>tagging hotfix</tagHotfixMessage>
                        <tagReleaseMessage>tagging release</tagReleaseMessage>
                    </commitMessages>
                </configuration>
            </plugin>
            <!-- @formatter:off -->
            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <id>auto-clean-git-properties</id>
                        <phase>clean</phase>
                        <goals><goal>run</goal></goals>
                        <configuration>
                            <target>
                                <delete failonerror="false"><fileset dir="${project.basedir}/src/main/resources" includes="git.properties"/></delete>
                            </target>
                        </configuration>
                    </execution>
                    <execution>
                        <id>auto-clean-readme</id>
                        <phase>clean</phase>
                        <goals><goal>run</goal></goals>
                        <configuration>
                            <target>
                                <delete failonerror="false">
                                    <fileset dir="${project.basedir}/src/site/markdown" includes="README.md"/>
                                    <fileset dir="${project.basedir}/src/site/markdown/src/readme" includes="**/*"/>
                                    <fileset dir="${project.basedir}/src/site/resources" includes="**/*"/>
                                </delete>
                            </target>
                        </configuration>
                    </execution>
                    <execution>
                        <id>echo-maven-multiModuleProjectDirectory</id>
                        <phase>initialize</phase>
                        <goals><goal>run</goal></goals>
                        <configuration><tasks><echo>maven.multiModuleProjectDirectory: '${maven.multiModuleProjectDirectory}'</echo></tasks></configuration>
                    </execution>
                    <execution>
                        <id>ensure-dot-gitkeep</id>
                        <phase>initialize</phase>
                        <goals><goal>run</goal></goals>
                        <configuration>
                            <tasks>
                                <taskdef resource="net/sf/antcontrib/antcontrib.properties" classpathref="maven.plugin.classpath"/>
                                <if>
                                    <available file="${project.basedir}/src/readme" type="dir"/>
                                    <then>
                                        <echo>${project.basedir}/src/readme exists</echo>
                                        <if>
                                            <available file="${project.basedir}/src/readme/.gitkeep"/>
                                            <else>
                                                <echo>touch ${project.basedir}/src/readme/.gitkeep</echo>
                                                <touch file="${project.basedir}/src/readme/.gitkeep"/>
                                            </else>
                                        </if>
                                    </then>
                                    <else>
                                        <echo>${project.basedir}/src/readme does not exist</echo>
                                    </else>
                                </if>
                                <if>
                                    <available file="${project.basedir}/src/main/asciidoc" type="dir"/>
                                    <then>
                                        <echo>${project.basedir}/src/main/asciidoc exists</echo>
                                        <if>
                                            <available file="${project.basedir}/src/main/asciidoc/.gitkeep"/>
                                            <else>
                                                <echo>touch ${project.basedir}/src/main/asciidoc/.gitkeep</echo>
                                                <touch file="${project.basedir}/src/main/asciidoc/.gitkeep"/>
                                            </else>
                                        </if>
                                    </then>
                                    <else>
                                        <echo>${project.basedir}/src/main/asciidoc does not exist</echo>
                                    </else>
                                </if>
                            </tasks>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <executions>
                    <execution>
                        <id>auto-copy-readme-to-site-markdown</id>
                        <phase>pre-site</phase>
                        <goals><goal>copy-resources</goal></goals>
                        <configuration>
                            <outputDirectory>${project.basedir}/src/site/markdown</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>${project.basedir}</directory>
                                    <includes><include>README.md</include></includes>
                                    <filtering>false</filtering>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                    <execution>
                        <id>auto-copy-readme-assets-to-site-markdown</id>
                        <phase>pre-site</phase>
                        <goals><goal>copy-resources</goal></goals>
                        <configuration>
                            <outputDirectory>${project.basedir}/src/site/markdown/src/readme</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>${project.basedir}/src/readme</directory>
                                    <filtering>false</filtering>
                                    <excludes><exclude>**/.gitkeep</exclude></excludes>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                    <execution>
                        <id>auto-copy-readme-assets-to-site-resources</id>
                        <phase>pre-site</phase>
                        <goals><goal>copy-resources</goal></goals>
                        <configuration>
                            <outputDirectory>${project.basedir}/src/site/resources/src/readme</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>${project.basedir}/src/readme</directory>
                                    <filtering>false</filtering>
                                    <excludes><exclude>**/.gitkeep</exclude></excludes>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                    <execution>
                        <id>auto-copy-markdown-assets-to-site-resources</id>
                        <phase>pre-site</phase>
                        <goals><goal>copy-resources</goal></goals>
                        <configuration>
                            <outputDirectory>${project.basedir}/src/site/resources/images</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>${project.basedir}/src/site/markdown/images</directory>
                                    <filtering>false</filtering>
                                    <excludes><exclude>**/.gitkeep</exclude></excludes>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <!-- see: https://github.com/google/error-prone -->
            <!-- override plexus-compiler-javac-errorprone's dependency on Error Prone with the latest version -->
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <encoding>${project.build.sourceEncoding}</encoding>
                    <showDeprecation>true</showDeprecation>
                    <showWarnings>true</showWarnings>
                    <!-- javac-with-errorprone not working on Eclipse m2e -->
                    <!--<compilerId>javac-with-errorprone</compilerId>-->
                    <!--<forceJavacCompilerUse>true</forceJavacCompilerUse>-->
                </configuration>
                <dependencies>
                    <dependency><groupId>org.codehaus.plexus</groupId><artifactId>plexus-compiler-javac-errorprone</artifactId><version>${org.codehaus.plexus_plexus-compiler-javac-errorprone}</version></dependency>
                    <dependency><groupId>com.google.errorprone</groupId><artifactId>error_prone_core</artifactId><version>${com.google.errorprone_error_prone_core.version}</version></dependency>
                </dependencies>
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <forkCount>${surefire.fork.count}</forkCount>
                    <reuseForks>${surefire.fork.reuse}</reuseForks>
                    <includes>
                        <include>**/*Test.java</include>
                        <include>**/*Tests.java</include>
                        <include>**/Test*.java</include>
                        <include>**/*TestCase.java</include>
                        <include>**/*Documentation.java</include>
                    </includes>
                    <excludes>
                        <exclude>**/Abstract*.java</exclude>
                        <exclude>**/Base*.java</exclude>
                        <exclude>**/deprecated/*.java</exclude>
                        <exclude>**/Deprecated*.java</exclude>
                        <exclude>**/*IT.java</exclude>
                    </excludes>
                    <useSystemClassLoader>false</useSystemClassLoader>
                </configuration>
                <executions>
                    <execution><id>default-test</id><goals><goal>test</goal></goals><configuration><skip>${maven.test.skip}</skip></configuration></execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-failsafe-plugin</artifactId>
                <configuration>
                    <skip>${maven.integration-test.skip}</skip>
                    <includes>
                        <include>**/*IT.java</include>
                    </includes>
                    <excludes>
                        <exclude>**/Abstract*.java</exclude>
                        <exclude>**/Base*.java</exclude>
                        <exclude>**/deprecated/*.java</exclude>
                        <exclude>**/Deprecated*.java</exclude>
                        <exclude>**/*Test.java</exclude>
                        <exclude>**/*Tests.java</exclude>
                        <exclude>**/Test*.java</exclude>
                        <exclude>**/*TestCase.java</exclude>
                        <exclude>**/*Documentation.java</exclude>
                    </excludes>
                </configuration>
                <executions>
                    <execution><id>failsafe-integration-test</id><phase>integration-test</phase><goals><goal>integration-test</goal></goals></execution>
                    <execution><id>failsafe-verify</id><phase>post-integration-test</phase><goals><goal>verify</goal></goals></execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-enforcer-plugin</artifactId>
                <configuration>
                    <rules>
                        <!-- Note: travis-ci uses old maven version  -->
                        <requireMavenVersion><version>[3.5.3,)</version></requireMavenVersion>
                        <!--requireUpperBoundDeps-->
                        <dependencyConvergence><uniqueVersions>false</uniqueVersions></dependencyConvergence>
                        <banTransitiveDependencies>
                            <excludes><exclude>*</exclude></excludes>
                            <includes>
                                <!--<include>*:commons-logging</include>-->
                            </includes>
                        </banTransitiveDependencies>
                        <bannedDependencies>
                            <includes>
                                <!--<include>*:commons-logging</include>-->
                            </includes>
                        </bannedDependencies>
                    </rules>
                    <fail>true</fail>
                </configuration>
                <executions>
                    <execution><id>enforce-banned-dependencies</id><phase>validate</phase><goals><goal>enforce</goal></goals></execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-javadoc-plugin</artifactId>
                <configuration>
                    <failOnError>false</failOnError><charset>${project.build.sourceEncoding}</charset><encoding>${project.build.sourceEncoding}</encoding>
                </configuration>
                <executions>
                    <execution><id>attach-javadocs</id><goals><goal>jar</goal></goals></execution>
                    <execution><id>attach-test-javadocs</id><goals><goal>test-jar</goal></goals></execution>
                    <execution><id>aggregate</id><goals><goal>aggregate</goal></goals><phase>site</phase></execution>
                    <execution><id>test-aggregate</id><goals><goal>test-aggregate</goal></goals><phase>site</phase></execution>
                </executions>
            </plugin>
            <!-- https://maven.apache.org/plugins/maven-source-plugin/test-jar-no-fork-mojo.html -->
            <!-- Use 'jar-no-fork' not 'jar' to avoid trigger default lifecycle binding of @Execute( phase = LifecyclePhase.GENERATE_SOURCES ) -->
            <plugin>
                <artifactId>maven-source-plugin</artifactId>
                <executions>
                    <execution><id>attach-sources</id><goals><goal>jar-no-fork</goal></goals></execution>
                </executions>
            </plugin>

            <!--<plugin>
                <groupId>org.codehaus.groovy.maven</groupId>
                <artifactId>gmaven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals><goal>execute</goal></goals>
                        <phase>initialize</phase>
                        <configuration><source>System.setProperty("local.deploy.model.path", "${project.groupId}".replace('.', '/')+"/${project.artifactId}")</source></configuration>
                    </execution>
                </executions>
            </plugin>-->
            <plugin>
                <groupId>org.codehaus.gmaven</groupId>
                <artifactId>groovy-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals><goal>execute</goal></goals>
                        <phase>initialize</phase>
                        <configuration><source>System.setProperty("local.deploy.model.path", "${project.groupId}".replace('.', '/')+"/${project.artifactId}")</source></configuration>
                    </execution>
                </executions>
            </plugin>
            <!-- @formatter:on -->

            <!-- use mvn -N io.takari:maven:wrapper instead of mvn wrapper:wrapper -->
            <!-- mvn wrapper:wrapper -->
            <!--<plugin>
                <groupId>com.rimerosolutions.maven.plugins</groupId><artifactId>wrapper-maven-plugin</artifactId><version>0.0.4</version>
                <configuration><mavenVersion>3.5.4</mavenVersion></configuration>
            </plugin>-->
        </plugins>

        <!--extensions>
        </extensions-->
    </build>

    <profiles>
        <!-- @formatter:off -->
        <profile>
            <id>default-private-nexus3.repository</id>
            <activation><property><name>!private-nexus3.repository</name></property></activation>
            <properties><private-nexus3.repository>http://nexus3:28081/nexus/repository</private-nexus3.repository></properties>
        </profile>
        <profile>
            <id>default-opensource-nexus3.repository</id>
            <activation><property><name>!opensource-nexus3.repository</name></property></activation>
            <properties><opensource-nexus3.repository>http://nexus3:28081/nexus/repository</opensource-nexus3.repository></properties>
        </profile>
        <profile>
            <id>default-private-sonarqube-host-url</id>
            <activation><property><name>!private-sonarqube.host.url</name></property></activation>
            <properties><private-sonarqube.host.url>http://sonarqube:9000</private-sonarqube.host.url></properties>
        </profile>
        <profile>
            <id>default-maven-test-failure-ignore</id>
            <activation><property><name>!maven.test.failure.ignore</name></property></activation>
            <properties><maven.test.failure.ignore>false</maven.test.failure.ignore></properties></profile>
        <profile>
            <id>default-maven-test-skip</id>
            <activation><property><name>!maven.test.skip</name></property></activation>
            <properties><maven.test.skip>false</maven.test.skip></properties>
        </profile>
        <profile>
            <id>default-maven-integration-test-skip</id>
            <activation><property><name>!maven.integration-test.skip</name></property></activation>
            <properties><maven.integration-test.skip>false</maven.integration-test.skip></properties>
        </profile>

        <profile>
            <id>git-commit-id</id>
            <!-- works on both git submodule and normal local repository -->
            <activation><file><exists>${maven.multiModuleProjectDirectory}/.git</exists></file><activeByDefault>false</activeByDefault></activation>
            <build>
                <plugins>
                    <plugin><groupId>pl.project13.maven</groupId><artifactId>git-commit-id-plugin</artifactId></plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <!-- see: https://github.com/SonarSource/sonar-scanning-examples -->
            <id>sonar</id>
            <!-- if sonar=true, jacoco should be set to true also -->
            <activation><property><name>sonar</name><value>true</value></property></activation>
            <properties>
                <!-- see: https://docs.sonarqube.org/display/SONAR/Analysis+Parameters -->
                <!--<sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin>-->

                <sonar.groovy.binaries>target/classes</sonar.groovy.binaries>

                <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
                <sonar.jacoco.reportPath>${jacoco.reportPath}</sonar.jacoco.reportPath>
                <sonar.jacoco.itReportPath>${jacoco.itReportPath}</sonar.jacoco.itReportPath>

                <!-- sonar.java.binaries issue when force language java  -->
                <!--<sonar.language>java</sonar.language>-->

                <sonar.sourceEncoding>UTF-8</sonar.sourceEncoding>

                <sonar.sources>.</sonar.sources>
                <sonar.inclusions>pom.xml,src/main/**</sonar.inclusions>
                <sonar.test.inclusions>src/test/**</sonar.test.inclusions>
            </properties>
            <build>
                <pluginManagement>
                    <plugins>
                        <!-- see: https://github.com/SonarSource/sonar-scanner-maven -->
                        <plugin><groupId>org.sonarsource.scanner.maven</groupId><artifactId>sonar-maven-plugin</artifactId><version>3.4.1.1168</version></plugin>
                    </plugins>
                </pluginManagement>
                <plugins>
                    <!-- see: https://dzone.com/articles/integration-jenkins-jacoco-and-sonarqube -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <!-- Specific to generate mapping between tests and covered code -->
                            <properties>
                                <property><name>listener</name><value>org.sonar.java.jacoco.JUnitListener</value></property>
                            </properties>
                        </configuration>
                    </plugin>
                    <plugin>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <configuration>
                            <skip>${maven.integration-test.skip}</skip>
                            <properties>
                                <property><name>listener</name><value>org.sonar.java.jacoco.JUnitListener</value></property>
                            </properties>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
            <dependencies>
                <!-- sonar-jacoco-listeners's version should match version of sonar-java-plugin -->
                <dependency><artifactId>sonar-jacoco-listeners</artifactId><groupId>org.sonarsource.java</groupId><version>${org.sonarsource.java_sonar-jacoco-listeners.version}</version><scope>test</scope></dependency>
            </dependencies>
        </profile>

        <!-- http://www.eclemma.org/jacoco/trunk/doc/maven.html -->
        <!-- see: https://github.com/timp/juice -->
        <!-- see: https://github.com/jacoco/jacoco/issues/409 -->
        <!-- https://www.petrikainulainen.net/programming/maven/creating-code-coverage-reports-for-unit-and-integration-tests-with-the-jacoco-maven-plugin/ -->
        <profile>
            <id>default-argLine</id>
            <activation><property><name>!jacoco</name></property></activation>
            <properties><argLine></argLine></properties>
        </profile>
        <profile>
            <id>jacoco-build</id>
            <activation><property><name>jacoco</name><value>true</value></property></activation>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin><groupId>org.jacoco</groupId><artifactId>jacoco-maven-plugin</artifactId><version>${org.jacoco_jacoco.version}</version></plugin>
                    </plugins>
                </pluginManagement>
                <plugins>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>default-prepare-agent</id>
                                <goals><goal>prepare-agent</goal></goals>
                                <phase>test-compile</phase>
                                <!--<phase>process-test-classes</phase>-->
                                <configuration><propertyName>argLine</propertyName><skip>${maven.test.skip}</skip><!--<destFile>${project.build.directory}/jacoco.exec</destFile>--></configuration>
                            </execution>
                            <execution>
                                <id>default-prepare-agent-integration</id>
                                <goals><goal>prepare-agent-integration</goal></goals>
                                <phase>pre-integration-test</phase>
                                <configuration><append>true</append><propertyName>argLine</propertyName><skip>${maven.integration-test.skip}</skip><!--<destFile>${project.build.directory}/jacoco-it.exec</destFile>--></configuration>
                            </execution>
                            <!--<execution><id>default-report</id><goals><goal>report</goal></goals><phase>test</phase></execution>-->
                            <!--<execution><id>default-report-integration</id><goals><goal>report-integration</goal></goals><phase>post-integration-test</phase></execution>-->
                            <execution>
                                <id>merge</id>
                                <phase>pre-site</phase>
                                <goals><goal>merge</goal></goals>
                                <configuration>
                                    <destFile>${project.build.directory}/jacoco-combined.exec</destFile>
                                    <fileSets>
                                        <fileSet>
                                            <directory>${project.build.directory}</directory>
                                            <includes><include>jacoco.exec</include><include>jacoco-it.exec</include></includes>
                                        </fileSet>
                                    </fileSets>
                                    <skip>${maven.integration-test.skip}</skip>
                                </configuration>
                            </execution>
                            <execution>
                                <id>composite</id>
                                <phase>pre-site</phase>
                                <goals><goal>report</goal></goals>
                                <configuration>
                                    <dataFile>${project.build.directory}/jacoco-combined.exec</dataFile>
                                    <outputDirectory>${project.reporting.outputDirectory}/jacoco-combined</outputDirectory>
                                    <skip>${maven.integration-test.skip}</skip>
                                    <title>Combined</title>
                                </configuration>
                            </execution>
                            <execution>
                                <id>default-check</id>
                                <goals><goal>check</goal></goals>
                                <configuration>
                                    <haltOnFailure>false</haltOnFailure>
                                    <rules>
                                        <rule implementation="org.jacoco.maven.RuleConfiguration">
                                            <element>BUNDLE</element>
                                            <limits>
                                                <limit implementation="org.jacoco.report.check.Limit"><counter>COMPLEXITY</counter><value>COVEREDRATIO</value><minimum>0.60</minimum></limit>
                                            </limits>
                                        </rule>
                                    </rules>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
            <dependencies>
                <dependency><groupId>org.jacoco</groupId><artifactId>org.jacoco.agent</artifactId><classifier>runtime</classifier><scope>test</scope><version>${org.jacoco_jacoco.version}</version></dependency>
            </dependencies>
        </profile>

        <!-- net.sourceforge.cobertura:cobertura is for cobertura-maven-plugin and qualinsight-mojo-cobertura -->
        <!-- force junit:junit version resolve cobertura transitive depends on old version, and SpringJUnit4ClassRunner requires JUnit 4.12 or higher -->
        <!-- cobertura-maven-plugin is deprecated, see: https://github.com/QualInsight/qualinsight-mojo-cobertura -->
        <!-- qualinsight-mojo-cobertura-core conflict with jacoco-maven-plugin
            [WARNING] Classes in bundle 'x' do no match with execution data.
            For report generation the same class files must be used as at runtime -->
        <profile>
            <id>cobertura</id>
            <activation><property><name>jacoco</name><value>false</value></property></activation>
            <properties>
                <net.sourceforge.cobertura_cobertura.version>2.1.1</net.sourceforge.cobertura_cobertura.version>
                <junit_junit.version>4.12</junit_junit.version>
            </properties>
            <dependencyManagement>
                <dependencies>
                    <dependency>
                        <groupId>net.sourceforge.cobertura</groupId><artifactId>cobertura</artifactId><version>${net.sourceforge.cobertura_cobertura.version}</version>
                        <exclusions><exclusion><groupId>ch.qos.logback</groupId><artifactId>logback-classic</artifactId></exclusion></exclusions>
                    </dependency>
                    <dependency>
                        <groupId>junit</groupId><artifactId>junit</artifactId><version>${junit_junit.version}</version>
                    </dependency>
                </dependencies>
            </dependencyManagement>
            <dependencies>
                <dependency><groupId>net.sourceforge.cobertura</groupId><artifactId>cobertura</artifactId><scope>test</scope></dependency>
                <dependency><groupId>junit</groupId><artifactId>junit</artifactId><scope>test</scope></dependency>
            </dependencies>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin><groupId>com.qualinsight.mojo.cobertura</groupId><artifactId>qualinsight-mojo-cobertura-core</artifactId><version>2.0.0</version></plugin>
                        <!--<plugin><groupId>org.codehaus.mojo</groupId><artifactId>cobertura-maven-plugin</artifactId><version>2.7</version></plugin>-->
                    </plugins>
                </pluginManagement>
                <plugins>
                    <plugin>
                        <groupId>com.qualinsight.mojo.cobertura</groupId>
                        <artifactId>qualinsight-mojo-cobertura-core</artifactId>
                        <executions>
                            <execution><id>instrument-ut</id><goals><goal>instrument-ut</goal></goals></execution>
                            <execution><id>instrument-it</id><goals><goal>instrument-it</goal></goals></execution>
                            <execution><id>report-ut-coverage</id><goals><goal>report-ut-coverage</goal></goals></execution>
                            <execution><id>report-it-coverage</id><goals><goal>report-it-coverage</goal></goals></execution>
                            <execution><id>report-overall-coverage</id><goals><goal>report-overall-coverage</goal></goals></execution>
                        </executions>
                    </plugin>
                    <!--<plugin>-->
                        <!--<groupId>org.codehaus.mojo</groupId>-->
                        <!--<artifactId>cobertura-maven-plugin</artifactId>-->
                        <!--<reportSets><reportSet><reports><report>cobertura</report></reports></reportSet></reportSets>-->
                    <!--</plugin>-->
                </plugins>
            </build>
        </profile>
        <!-- @formatter:on -->

        <!-- @formatter:off -->
        <profile>
            <id>gpg2-arguments</id>
            <activation><property><name>gpg.loopback</name><value>true</value></property></activation>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <configuration>
                            <gpgArguments>
                                <gpgArgument>--use-agent</gpgArgument>
                                <gpgArgument>--pinentry-mode</gpgArgument>
                                <gpgArgument>loopback</gpgArgument>
                            </gpgArguments>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>gpg-for-travis-and-maven-central</id>
            <activation><file><exists>${maven.multiModuleProjectDirectory}/codesigning.asc</exists></file><activeByDefault>false</activeByDefault></activation>
            <properties>
                <!-- Do not set gpg.executable here -->
                <!--<gpg.executable>gpg</gpg.executable>-->
                <gpg.keyname>${env.CI_OPT_GPG_KEYNAME}</gpg.keyname>
                <gpg.passphrase>${env.CI_OPT_GPG_PASSPHRASE}</gpg.passphrase>
            </properties>
            <build>
                <plugins>
                    <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>

        <profile>
            <id>default-build-publish-channel</id>
            <activation><property><name>!build.publish.channel</name></property></activation>
            <properties><build.publish.channel>snapshot</build.publish.channel></properties>
        </profile>

        <profile>
            <id>infrastructure_opensource</id>
            <activation><property><name>infrastructure</name><value>opensource</value></property><activeByDefault>false</activeByDefault></activation>
            <properties>
                <sonar.host.url>https://sonarqube.com</sonar.host.url>
                <!--<wagon.merge-maven-repos.target>https://oss.sonatype.org/content/repositories/snapshots</wagon.merge-maven-repos.target>-->
                <wagon.merge-maven-repos.target>https://oss.sonatype.org/service/local/staging/deploy/maven2</wagon.merge-maven-repos.target>
                <wagon.merge-maven-repos.targetId>OSSRH-${build.publish.channel}s</wagon.merge-maven-repos.targetId>
            </properties>
            <distributionManagement>
                <repository><id>OSSRH-staging</id><url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url></repository>
                <snapshotRepository><id>OSSRH-snapshots</id><url>https://oss.sonatype.org/content/repositories/snapshots</url></snapshotRepository>
            </distributionManagement>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.8</version>
                        <extensions>true</extensions>
                        <configuration>
                            <autoReleaseAfterClose>false</autoReleaseAfterClose>
                            <detectBuildFailures>true</detectBuildFailures>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <serverId>OSSRH-staging</serverId>
                            <!--<sslAllowAll>true</sslAllowAll>-->
                            <stagingProgressPauseDurationSeconds>30</stagingProgressPauseDurationSeconds>
                            <stagingProgressTimeoutMinutes>60</stagingProgressTimeoutMinutes>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>infrastructure_private</id>
            <activation><property><name>infrastructure</name><value>private</value></property><activeByDefault>false</activeByDefault></activation>
            <properties>
                <sonar.host.url>${private-sonarqube.host.url}</sonar.host.url>
                <!--sonar.jdbc.url>jdbc:h2:tcp://sonarqube.local/sonar</sonar.jdbc.url>
                <sonar.jdbc.url>jdbc:postgresql://postgresql:5432/sonar</sonar.jdbc.url-->

                <wagon.merge-maven-repos.target>${private-nexus3.repository}/maven-${build.publish.channel}s</wagon.merge-maven-repos.target>
                <wagon.merge-maven-repos.targetId>private-nexus3-${build.publish.channel}s</wagon.merge-maven-repos.targetId>
            </properties>
            <distributionManagement>
                <repository><id>private-nexus3-releases</id><url>${private-nexus3.repository}/maven-releases</url></repository>
                <snapshotRepository><id>private-nexus3-snapshots</id><url>${private-nexus3.repository}/maven-snapshots</url></snapshotRepository>
            </distributionManagement>
            <pluginRepositories>
                <pluginRepository>
                    <id>private-nexus3-releases</id>
                    <name>private nexus3 releases</name>
                    <url>${private-nexus3.repository}/maven-releases/</url>
                    <releases><enabled>true</enabled><updatePolicy>${repositories.releases.updatePolicy}</updatePolicy></releases>
                    <snapshots><enabled>false</enabled></snapshots>
                </pluginRepository>
                <pluginRepository>
                    <id>private-nexus3-snapshots</id>
                    <name>private nexus3 snapshots</name>
                    <url>${private-nexus3.repository}/maven-snapshots/</url>
                    <releases><enabled>false</enabled></releases>
                    <snapshots><enabled>true</enabled><updatePolicy>${repositories.snapshots.updatePolicy}</updatePolicy></snapshots>
                </pluginRepository>
                <pluginRepository>
                    <id>private-nexus3-thirdparty</id>
                    <name>private nexus3 thirdparty</name>
                    <url>${private-nexus3.repository}/maven-thirdparty/</url>
                    <releases><enabled>true</enabled></releases>
                    <snapshots><enabled>true</enabled></snapshots>
                </pluginRepository>
            </pluginRepositories>
            <repositories>
                <repository>
                    <id>private-nexus3-releases</id>
                    <name>private nexus3 releases</name>
                    <url>${private-nexus3.repository}/maven-releases/</url>
                    <releases><enabled>true</enabled><updatePolicy>${repositories.releases.updatePolicy}</updatePolicy></releases>
                    <snapshots><enabled>false</enabled></snapshots>
                </repository>
                <repository>
                    <id>private-nexus3-snapshots</id>
                    <name>private nexus3 snapshots</name>
                    <url>${private-nexus3.repository}/maven-snapshots/</url>
                    <releases><enabled>false</enabled></releases>
                    <snapshots><enabled>true</enabled><updatePolicy>${repositories.snapshots.updatePolicy}</updatePolicy></snapshots>
                </repository>
                <repository>
                    <id>private-nexus3-thirdparty</id>
                    <name>private nexus3 thirdparty</name>
                    <url>${private-nexus3.repository}/maven-thirdparty/</url>
                    <releases><enabled>true</enabled></releases>
                    <snapshots><enabled>true</enabled></snapshots>
                </repository>
            </repositories>
        </profile>

        <profile>
            <id>default-wagon-source-filepath</id>
            <activation><property><name>!wagon.source.filepath</name></property><activeByDefault>false</activeByDefault></activation>
            <properties><wagon.source.filepath>${user.home}/.ci-and-cd/local-deploy/${git.commit.id}</wagon.source.filepath></properties>
        </profile>
        <profile>
            <id>default-wagon-merge-maven-repos-target</id>
            <activation><property><name>!wagon.merge-maven-repos.target</name></property><activeByDefault>false</activeByDefault></activation>
            <properties><wagon.merge-maven-repos.target>${private-nexus3.repository}/maven-${build.publish.channel}s</wagon.merge-maven-repos.target></properties>
        </profile>
        <profile>
            <id>default-wagon-merge-maven-repos-targetId</id>
            <activation><property><name>!wagon.merge-maven-repos.targetId</name></property><activeByDefault>false</activeByDefault></activation>
            <properties><wagon.merge-maven-repos.targetId>private-nexus3-${build.publish.channel}s</wagon.merge-maven-repos.targetId></properties>
        </profile>
        <!-- Why org.codehaus.mojo:wagon-maven-plugin:wagon-maven-plugin-2.0.1-snapshot-chshawkn-1.6?
            see: https://www.mail-archive.com/users@maven.apache.org/msg129243.html -->
        <!--http://www.mojohaus.org/wagon-maven-plugin/usage.html-->
        <!--http://www.mojohaus.org/wagon-maven-plugin/-->
        <profile>
            <id>mvn-deploy-publish-segregation-by-wagon</id>
            <activation><property><name>mvn_deploy_publish_segregation</name><value>true</value></property><activeByDefault>false</activeByDefault></activation>
            <pluginRepositories>
                <pluginRepository>
                    <id>github-mvn-repo-wagon-maven-plugin</id>
                    <url>https://raw.github.com/ci-and-cd/wagon-maven-plugin/mvn-repo</url>
                    <name>Forked wagon-maven-plugin that can merge snapshots metadata correctly</name>
                    <layout>default</layout>
                    <snapshots><enabled>true</enabled></snapshots>
                    <releases><enabled>true</enabled></releases>
                </pluginRepository>
            </pluginRepositories>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin><groupId>org.codehaus.mojo</groupId><artifactId>wagon-maven-plugin</artifactId><version>wagon-maven-plugin-2.0.1-snapshot-chshawkn-1.6</version></plugin>
                    </plugins>
                </pluginManagement>
                <plugins>
                    <!-- clean files deployed to local directory -->
                    <plugin>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>local-deploy-model-path-clean</id>
                                <phase>none</phase>
                                <goals><goal>run</goal></goals>
                                <configuration>
                                    <target>
                                        <echo message="local.deploy.model.path: ${local.deploy.model.path}"/>
                                        <delete failonerror="false" includeemptydirs="true" verbose="true"><fileset dir="${wagon.source.filepath}/${local.deploy.model.path}" includes="**/*"/></delete>
                                    </target>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>wagon-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>merge-maven-repos-deploy</id>
                                <phase>none</phase>
                                <goals><goal>merge-maven-repos</goal></goals>
                                <configuration>
                                    <source>file://${wagon.source.filepath}</source>
                                    <target>${wagon.merge-maven-repos.target}</target>
                                    <targetId>${wagon.merge-maven-repos.targetId}</targetId>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <!-- Do mvn site site:stage -DstagingDirectory=/tmp/path first, then manually add/push to the gh-pages branch on GitHub? -->
            <id>infrastructure_opensource_github_site</id>
            <activation><property><name>github-site-publish</name><value>true</value></property><activeByDefault>false</activeByDefault></activation>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>com.github.github</groupId><artifactId>site-maven-plugin</artifactId><version>0.13.0.OSS-M1</version>
                        </plugin>
                    </plugins>
                </pluginManagement>
                <plugins>
                    <plugin>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>echo-github-site-info</id><phase>site</phase><goals><goal>run</goal></goals>
                                <configuration><target>
                                    <echo message="github.site.path: ${github.site.path}"/>
                                    <echo message="github.global.repositoryName: ${github.global.repositoryName}"/>
                                    <echo message="github.global.repositoryOwner: ${github.global.repositoryOwner}"/>
                                    <echo message="project.distributionManagement.site.url: ${project.distributionManagement.site.url}"/>
                                </target></configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>com.github.github</groupId><artifactId>site-maven-plugin</artifactId>
                        <configuration>
                            <merge>true</merge>
                            <message>Creating site for ${project.artifactId}-${project.version}</message>
                            <noJekyll>true</noJekyll>
                            <path>${project.distributionManagement.site.url}</path>
                            <repositoryName>${github.global.repositoryName}</repositoryName>
                            <repositoryOwner>${github.global.repositoryOwner}</repositoryOwner>
                        </configuration>
                        <executions>
                            <execution><goals><goal>site</goal></goals><phase>site-deploy</phase><!--<phase>site</phase>--></execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
            <distributionManagement>
                <!-- Make github site-maven-plugin to support multi-module site deployment -->
                <!-- see: https://github.com/github/maven-plugins/issues/22 -->
                <!-- If subprojects inherit the site URL from a parent POM, they will automatically append their artifactId to form their effective deployment location. -->
                <site>
                    <id>github-pages-site</id>
                    <name>Deployment through GitHub's site deployment plugin</name>
                    <url>${github.site.path}</url>
                </site>
            </distributionManagement>
            <properties>
                <!-- for site on github, id (github.global.server) must match the config in your settings.xml -->
                <github.global.oauth2Token>${env.CI_INFRA_OPT_OPENSOURCE_GIT_AUTH_TOKEN}</github.global.oauth2Token>
                <github.global.repositoryName>${env.CI_OPT_GITHUB_SITE_REPO_NAME}</github.global.repositoryName>
                <github.global.repositoryOwner>${env.CI_OPT_GITHUB_SITE_REPO_OWNER}</github.global.repositoryOwner>
                <github.global.server>github</github.global.server>

                <!--<github.site.path>${build.publish.channel}/${project.version}</github.site.path>-->
                <github.site.path>${build.publish.channel}</github.site.path>

                <maven.site.deploy.skip>true</maven.site.deploy.skip>
            </properties>
        </profile>

        <profile>
            <id>default-site-path</id>
            <activation><property><name>!site.path</name></property></activation>
            <properties><site.path>${project.artifactId}/${build.publish.channel}</site.path></properties>
        </profile>

        <profile>
            <id>infrastructure_opensource_site</id>
            <activation>
                <property><name>github-site-publish</name><value>false</value></property>
            </activation>
            <distributionManagement>
                <site><id>opensource-mvnsite</id><url>dav:${opensource-nexus3.repository}/mvnsite/${site.path}</url></site>
            </distributionManagement>
        </profile>

        <profile>
            <id>infrastructure_private_site</id>
            <activation><property><name>infrastructure</name><value>private</value></property><activeByDefault>false</activeByDefault></activation>
            <distributionManagement>
                <!-- scpexe uses privateKey, scp uses password -->
                <!-- scpexe://${domain_or_ip}:22/path/to/sites -->
                <site><id>private-mvnsite</id><url>dav:${private-nexus3.repository}/mvnsite/${site.path}</url></site>
            </distributionManagement>
        </profile>

        <!-- set property checkstyle.config.location in MAVEN_OPTS, pom.xml or settings.xml. -->
        <profile>
            <id>default-checkstyle-config</id>
            <activation><property><name>!checkstyle.config.location</name></property></activation>
            <properties><checkstyle.config.location>https://raw.githubusercontent.com/ci-and-cd/maven-build/master/src/main/checkstyle/google_checks_8.10.xml</checkstyle.config.location></properties>
        </profile>
        <profile>
            <id>default-pmd-ruleset</id>
            <activation><property><name>!pmd.ruleset.location</name></property></activation>
            <properties><pmd.ruleset.location>https://raw.githubusercontent.com/ci-and-cd/maven-build/master/src/main/pmd/pmd-ruleset-6.4.0.xml</pmd.ruleset.location></properties>
        </profile>

        <profile>
            <id>spring-restdocs</id>
            <activation>
                <property><name>spring-restdocs</name><value>true</value></property>
                <file><exists>${basedir}/src/main/asciidoc/.gitkeep</exists></file>
            </activation>
            <properties>
                <snippetsDirectory>${project.build.directory}/generated-snippets</snippetsDirectory>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.asciidoctor</groupId>
                        <artifactId>asciidoctor-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>generate-docs</id>
                                <phase>prepare-package</phase>
                                <goals><goal>process-asciidoc</goal></goals>
                                <configuration>
                                    <backend>html</backend>
                                    <doctype>book</doctype>
                                    <attributes><snippets>${snippetsDirectory}</snippets></attributes>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-resources-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>package-spring-restdocs</id>
                                <phase>prepare-package</phase>
                                <goals><goal>copy-resources</goal></goals>
                                <configuration>
                                    <outputDirectory>${project.build.outputDirectory}/static/docs</outputDirectory>
                                    <resources>
                                        <resource><directory>${project.build.directory}/generated-docs</directory></resource>
                                    </resources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>reports-for-site</id>
            <activation><property><name>site</name><value>true</value></property></activation>
            <properties>
                <umlgraph.version>5.6.6</umlgraph.version>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-site-plugin</artifactId>
                        <configuration><attach>true</attach></configuration>
                    </plugin>

                    <plugin>
                        <artifactId>maven-checkstyle-plugin</artifactId>
                        <configuration>
                            <configLocation>${checkstyle.config.location}</configLocation>
                            <encoding>${project.reporting.outputEncoding}</encoding>
                            <consoleOutput>true</consoleOutput>
                            <failsOnError>false</failsOnError>
                        </configuration>
                        <executions>
                            <execution><id>validate</id><phase>validate</phase><goals><goal>check</goal></goals></execution>
                        </executions>
                    </plugin>
                    <!-- see: http://maven.apache.org/plugins/maven-pmd-plugin/examples/multi-module-config.html -->
                    <plugin>
                        <artifactId>maven-pmd-plugin</artifactId>
                        <configuration>
                            <failOnViolation>false</failOnViolation><printFailingErrors>true</printFailingErrors><rulesets><ruleset>${pmd.ruleset.location}</ruleset></rulesets>
                        </configuration>
                        <executions>
                            <execution><goals><goal>check</goal><goal>cpd-check</goal></goals></execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.codehaus.mojo</groupId><artifactId>animal-sniffer-maven-plugin</artifactId>
                        <configuration>
                            <signature><groupId>org.codehaus.mojo.signature</groupId><artifactId>java18</artifactId><version>1.0</version></signature>
                        </configuration>
                    </plugin>
                    <!--<plugin>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>analyze</id>
                                <goals><goal>analyze-only</goal></goals>
                                <configuration><failOnWarning>false</failOnWarning><ignoreNonCompile>true</ignoreNonCompile><outputXML>true</outputXML></configuration>
                            </execution>
                        </executions>
                    </plugin>-->
                </plugins>
            </build>
            <reporting>
                <plugins>
                    <plugin>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <configuration>
                            <failOnError>false</failOnError>
                            <charset>${project.build.sourceEncoding}</charset>
                            <encoding>${project.build.sourceEncoding}</encoding>
                            <doclet>org.umlgraph.doclet.UmlGraphDoc</doclet>
                            <docletArtifact><groupId>org.umlgraph</groupId><artifactId>umlgraph</artifactId><version>${umlgraph.version}</version></docletArtifact>
                            <additionalOptions>-views -all</additionalOptions>
                            <!-- UML Graph needs to match HTML tag to insert images into javadoc -->
                            <additionalJOption>-J-Duser.language=en</additionalJOption>
                            <useStandardDocletOptions>true</useStandardDocletOptions>
                        </configuration>
                        <reportSets>
                            <reportSet><id>html</id><reports><report>javadoc</report></reports></reportSet>
                            <reportSet><id>test-html</id><reports><report>test-javadoc</report></reports></reportSet>
                            <reportSet><id>aggregate</id><inherited>false</inherited><reports><report>aggregate</report></reports></reportSet>
                        </reportSets>
                    </plugin>
                    <plugin>
                        <artifactId>maven-jxr-plugin</artifactId>
                        <reportSets>
                            <reportSet><id>aggregate</id><inherited>false</inherited><reports><report>aggregate</report></reports></reportSet>
                        </reportSets>
                    </plugin>
                    <plugin>
                        <artifactId>maven-surefire-report-plugin</artifactId>
                        <configuration>
                            <aggregate>true</aggregate>
                            <linkXRef>true</linkXRef>
                        </configuration>
                        <reportSets>
                            <reportSet>
                                <id>unit-tests</id>
                                <inherited>false</inherited>
                                <reports><report>report-only</report></reports>
                            </reportSet>
                            <reportSet>
                                <id>integration-tests</id>
                                <inherited>false</inherited>
                                <reports><report>failsafe-report-only</report></reports>
                            </reportSet>
                        </reportSets>
                    </plugin>
                    <plugin><groupId>org.codehaus.mojo</groupId><artifactId>findbugs-maven-plugin</artifactId></plugin>
                    <plugin><groupId>org.codehaus.mojo</groupId><artifactId>jdepend-maven-plugin</artifactId></plugin>
                    <plugin>
                        <artifactId>maven-checkstyle-plugin</artifactId>
                        <reportSets>
                            <reportSet>
                                <configuration>
                                    <configLocation>${checkstyle.config.location}</configLocation>
                                    <encoding>${project.reporting.outputEncoding}</encoding>
                                    <consoleOutput>false</consoleOutput>
                                    <failsOnError>false</failsOnError>
                                    <linkXRef>true</linkXRef>
                                </configuration>
                                <reports><report>checkstyle</report></reports>
                            </reportSet>
                            <reportSet>
                                <id>aggregate</id>
                                <inherited>false</inherited>
                                <reports><report>checkstyle-aggregate</report></reports>
                            </reportSet>
                        </reportSets>
                    </plugin>
                    <!-- Taglist plugin MUST be executed after the JXR plugin. -->
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>taglist-maven-plugin</artifactId>
                        <configuration>
                            <aggregate>true</aggregate>
                            <tagListOptions>
                                <tagClasses>
                                    <tagClass>
                                        <displayName>Todo Work</displayName>
                                        <tags>
                                            <tag><matchString>todo</matchString><matchType>ignoreCase</matchType></tag>
                                            <tag><matchString>FIXME</matchString><matchType>exact</matchType></tag>
                                        </tags>
                                    </tagClass>
                                </tagClasses>
                            </tagListOptions>
                        </configuration>
                    </plugin>
                    <plugin>
                        <artifactId>maven-pmd-plugin</artifactId>
                        <configuration>
                            <aggregate>true</aggregate>
                            <linkXRef>true</linkXRef>
                            <sourceEncoding>${project.build.sourceEncoding}</sourceEncoding>
                            <minimumTokens>100</minimumTokens>
                            <rulesets><ruleset>${pmd.ruleset.location}</ruleset></rulesets>
                        </configuration>
                    </plugin>
                    <!-- see: https://maven.apache.org/plugins/maven-dependency-plugin/analyze-mojo.html -->
                    <!--
                    dependency:analyze goal is intended to be used standalone,
                    thus it always executes the test-compile phase.
                    use the dependency:analyze-only goal instead when participating in the build lifecycle.
                    -->
                    <!--<plugin>-->
                    <!--<artifactId>maven-dependency-plugin</artifactId>-->
                    <!--<reportSets><reportSet><reports><report>analyze-report</report></reports></reportSet></reportSets>-->
                    <!--</plugin>-->
                    <plugin>
                        <artifactId>maven-project-info-reports-plugin</artifactId>
                        <!--<inherited>true</inherited>-->
                        <configuration>
                        </configuration>
                        <reportSets>
                            <reportSet>
                                <reports>
                                    <report>ci-management</report>
                                    <report>dependencies</report>
                                    <!---->
                                    <report>dependency-convergence</report>
                                    <report>dependency-info</report>
                                    <!--<report>dependency-management</report>-->
                                    <report>distribution-management</report>
                                    <!---->
                                    <report>index</report>
                                    <report>issue-management</report>
                                    <report>licenses</report>
                                    <report>mailing-lists</report>
                                    <report>modules</report>
                                    <report>plugin-management</report>
                                    <report>plugins</report>
                                    <report>scm</report>
                                    <report>summary</report>
                                    <report>team</report>
                                </reports>
                            </reportSet>
                        </reportSets>
                    </plugin>
                </plugins>
            </reporting>
        </profile>

        <profile>
            <id>jacoco-report</id>
            <activation><property><name>jacoco</name><value>true</value></property></activation>
            <reporting>
                <plugins>
                    <plugin>
                        <groupId>org.jacoco</groupId><artifactId>jacoco-maven-plugin</artifactId>
                        <reportSets>
                            <reportSet><reports><report>report</report><report>report-integration</report><!--<report>report-aggregate</report>--></reports></reportSet>
                        </reportSets>
                    </plugin>
                </plugins>
            </reporting>
        </profile>

        <profile>
            <id>dependency-check</id>
            <activation><property><name>dependency-check</name><value>true</value></property></activation>
            <build>
                <plugins>
                    <plugin><groupId>org.codehaus.mojo</groupId><artifactId>versions-maven-plugin</artifactId></plugin>
                </plugins>
            </build>
            <reporting>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId><artifactId>versions-maven-plugin</artifactId>
                        <reportSets>
                            <reportSet>
                                <reports><report>dependency-updates-report</report><report>plugin-updates-report</report></reports>
                            </reportSet>
                        </reportSets>
                    </plugin>
                    <plugin>
                        <groupId>org.owasp</groupId><artifactId>dependency-check-maven</artifactId>
                        <reportSets>
                            <reportSet><reports><report>aggregate</report></reports></reportSet>
                        </reportSets>
                    </plugin>
                </plugins>
            </reporting>
        </profile>


        <!--<frontend.nodeDownloadRoot>https://npm.taobao.org/mirrors/node/</frontend.nodeDownloadRoot>-->
        <profile>
            <id>default-frontend-nodeDownloadRoot</id>
            <activation><property><name>!frontend.nodeDownloadRoot</name></property></activation>
            <properties><frontend.nodeDownloadRoot>https://nodejs.org/dist/</frontend.nodeDownloadRoot></properties>
        </profile>
        <!--<frontend.npmDownloadRoot>http://registry.npm.taobao.org/npm/-/</frontend.npmDownloadRoot>-->
        <profile>
            <id>default-frontend-npmDownloadRoot</id>
            <activation><property><name>!frontend.npmDownloadRoot</name></property></activation>
            <properties><frontend.npmDownloadRoot>https://registry.npmjs.org/npm/-/</frontend.npmDownloadRoot></properties>
        </profile>
        <profile>
            <id>frontend</id>
            <activation><file><exists>${basedir}/package.json</exists></file><activeByDefault>false</activeByDefault></activation>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>com.github.eirslett</groupId>
                            <artifactId>frontend-maven-plugin</artifactId>
                            <version>1.6</version>
                            <configuration>
                                <installDirectory>.mvn</installDirectory>
                                <!-- Defaults to https://nodejs.org/dist/ -->
                                <nodeDownloadRoot>${frontend.nodeDownloadRoot}</nodeDownloadRoot>
                                <!-- Defaults to http://registry.npmjs.org/npm/-/ -->
                                <npmDownloadRoot>${frontend.npmDownloadRoot}</npmDownloadRoot>
                            </configuration>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </build>
        </profile>

        <!-- @formatter:off -->
        <profile>
            <id>java8-without-groovy</id>
            <activation><jdk>8</jdk><file><missing>${basedir}/src/main/groovy</missing></file><activeByDefault>false</activeByDefault></activation>
            <properties><java.version>1.8</java.version></properties>
            <build>
                <plugins>
                    <plugin><artifactId>maven-compiler-plugin</artifactId><configuration><compilerVersion>${java.version}</compilerVersion></configuration></plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>java8</id>
            <activation><jdk>1.8</jdk><activeByDefault>false</activeByDefault></activation>
            <properties>
                <java.version>1.8</java.version>
                <maven.compiler.source>1.8</maven.compiler.source>
                <maven.compiler.target>1.8</maven.compiler.target>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>echo-argLine</id><phase>test</phase><goals><goal>run</goal></goals><configuration><target><echo message="java8 argLine: ${argLine}"/></target></configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <configuration><source>${java.version}</source><target>${java.version}</target></configuration>
                    </plugin>
                    <plugin>
                        <artifactId>maven-enforcer-plugin</artifactId>
                        <configuration>
                            <rules>
                                <requireJavaVersion>
                                    <message><![CDATA[You are running an older version of Java. This application requires at least JDK ${java.version}.]]></message>
                                    <version>[${java.version}.0,)</version>
                                </requireJavaVersion>
                            </rules>
                            <fail>true</fail>
                        </configuration>
                    </plugin>
                    <plugin><artifactId>maven-failsafe-plugin</artifactId><configuration><argLine>${argLine}</argLine></configuration></plugin>
                    <plugin><artifactId>maven-surefire-plugin</artifactId><configuration><argLine>${argLine}</argLine></configuration></plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId><artifactId>maven-toolchains-plugin</artifactId>
                        <configuration><toolchains><jdk><version>${java.version}</version><!--<vendor>oracle</vendor>--></jdk></toolchains></configuration>
                        <executions><execution><phase>validate</phase><goals><goal>toolchain</goal></goals></execution></executions>
                    </plugin>
                </plugins>
            </build>
            <reporting>
                <plugins>
                    <plugin><artifactId>maven-pmd-plugin</artifactId><configuration><targetJdk>${java.version}</targetJdk></configuration></plugin>
                </plugins>
            </reporting>
        </profile>
        <profile>
            <id>default-java9-jvmArguments-addModules</id>
            <activation><jdk>1.9</jdk><property><name>!jvmArguments.addModules</name></property></activation>
            <properties><jvmArguments.addModules>java.xml.bind,java.xml.ws,java.xml.ws.annotation</jvmArguments.addModules></properties>
        </profile>
        <profile>
            <id>java9-without-groovy</id>
            <activation><jdk>1.9</jdk><file><missing>${basedir}/src/main/groovy</missing></file><activeByDefault>false</activeByDefault></activation>
            <properties><java.version>1.9</java.version></properties>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <configuration><compilerVersion>${java.version}</compilerVersion><compilerArgs><arg>--add-modules</arg><arg>${jvmArguments.addModules}</arg></compilerArgs></configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>java9-with-groovy</id>
            <activation><jdk>1.9</jdk><file><exists>${basedir}/src/main/groovy</exists></file><activeByDefault>false</activeByDefault></activation>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <configuration><compilerArgs><arg>-J--add-modules</arg><arg>-J${jvmArguments.addModules}</arg></compilerArgs></configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>java9</id>
            <activation><jdk>1.9</jdk><activeByDefault>false</activeByDefault></activation>
            <properties>
                <!-- Runtime modules for java9 -->
                <javax.activation.version>1.1.1</javax.activation.version>
                <jaxb-api.version>2.3.0</jaxb-api.version>
                <java.version>1.9</java.version>
                <maven.compiler.release>9</maven.compiler.release>
                <maven.compiler.source>1.9</maven.compiler.source>
                <maven.compiler.target>1.9</maven.compiler.target>
            </properties>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>com.spotify</groupId><artifactId>docker-maven-plugin</artifactId>
                            <dependencies>
                                <dependency><groupId>javax.activation</groupId><artifactId>activation</artifactId><version>${javax.activation.version}</version></dependency>
                            </dependencies>
                        </plugin>
                    </plugins>
                </pluginManagement>
                <plugins>
                    <plugin>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>echo-argLine</id><phase>test</phase><goals><goal>run</goal></goals><configuration><target><echo message="java9 argLine: ${argLine}"/></target></configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <configuration><release>${maven.compiler.release}</release><source>${java.version}</source><target>${java.version}</target></configuration>
                    </plugin>
                    <plugin>
                        <artifactId>maven-enforcer-plugin</artifactId>
                        <configuration>
                            <rules>
                                <requireJavaVersion>
                                    <message><![CDATA[You are running an older version of Java. This application requires at least JDK ${java.version}.]]></message>
                                    <version>[${java.version}.0,)</version>
                                </requireJavaVersion>
                            </rules>
                            <fail>true</fail>
                        </configuration>
                    </plugin>
                    <plugin><artifactId>maven-failsafe-plugin</artifactId><configuration><argLine>--add-modules ${jvmArguments.addModules} ${argLine}</argLine></configuration></plugin>
                    <plugin><artifactId>maven-surefire-plugin</artifactId><configuration><argLine>--add-modules ${jvmArguments.addModules} ${argLine}</argLine></configuration></plugin>
                    <plugin>
                        <artifactId>maven-toolchains-plugin</artifactId>
                        <configuration><toolchains><jdk><version>${java.version}</version><!--<vendor>oracle</vendor>--></jdk></toolchains></configuration>
                        <executions><execution><phase>validate</phase><goals><goal>toolchain</goal></goals></execution></executions>
                    </plugin>
                </plugins>
            </build>
            <dependencyManagement>
                <dependencies>
                    <dependency><groupId>javax.activation</groupId><artifactId>activation</artifactId><version>${javax.activation.version}</version></dependency>
                    <!-- Hibernate java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException -->
                    <dependency><groupId>javax.xml.bind</groupId><artifactId>jaxb-api</artifactId><version>${jaxb-api.version}</version></dependency>
                </dependencies>
            </dependencyManagement>
            <reporting>
                <plugins>
                    <plugin><artifactId>maven-pmd-plugin</artifactId><configuration><targetJdk>${java.version}</targetJdk></configuration></plugin>
                </plugins>
            </reporting>
        </profile>
        <profile>
            <id>default-java10-jvmArguments-addModules</id>
            <activation><jdk>1.10</jdk><property><name>!jvmArguments.addModules</name></property></activation>
            <properties><jvmArguments.addModules>java.xml.bind,java.xml.ws,java.xml.ws.annotation</jvmArguments.addModules></properties>
        </profile>
        <profile>
            <id>java10-without-groovy</id>
            <activation><jdk>1.10</jdk><file><missing>${basedir}/src/main/groovy</missing></file><activeByDefault>false</activeByDefault></activation>
            <properties><java.version>1.10</java.version></properties>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <configuration><compilerVersion>${java.version}</compilerVersion><compilerArgs><arg>--add-modules</arg><arg>${jvmArguments.addModules}</arg></compilerArgs></configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>java10-with-groovy</id>
            <activation><jdk>1.10</jdk><file><exists>${basedir}/src/main/groovy</exists></file><activeByDefault>false</activeByDefault></activation>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <configuration><compilerArgs><arg>-J--add-modules</arg><arg>-J${jvmArguments.addModules}</arg></compilerArgs></configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>java10</id>
            <activation><jdk>1.10</jdk><activeByDefault>false</activeByDefault></activation>
            <properties>
                <!-- Runtime modules for java10 -->
                <javax.activation.version>1.1.1</javax.activation.version>
                <jaxb-api.version>2.3.0</jaxb-api.version>
                <java.version>1.10</java.version>
                <maven.compiler.release>10</maven.compiler.release>
                <maven.compiler.source>1.10</maven.compiler.source>
                <maven.compiler.target>1.10</maven.compiler.target>
            </properties>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>com.spotify</groupId><artifactId>docker-maven-plugin</artifactId>
                            <dependencies>
                                <dependency><groupId>javax.activation</groupId><artifactId>activation</artifactId><version>${javax.activation.version}</version></dependency>
                            </dependencies>
                        </plugin>
                    </plugins>
                </pluginManagement>
                <plugins>
                    <plugin>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>echo-argLine</id><phase>test</phase><goals><goal>run</goal></goals><configuration><target><echo message="java10 argLine: ${argLine}"/></target></configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <configuration><release>${maven.compiler.release}</release><source>${java.version}</source><target>${java.version}</target></configuration>
                    </plugin>
                    <plugin>
                        <artifactId>maven-enforcer-plugin</artifactId>
                        <configuration>
                            <rules>
                                <requireJavaVersion>
                                    <message><![CDATA[You are running an older version of Java. This application requires at least JDK ${java.version}.]]></message>
                                    <version>[${java.version}.0,)</version>
                                </requireJavaVersion>
                            </rules>
                            <fail>true</fail>
                        </configuration>
                    </plugin>
                    <plugin><artifactId>maven-failsafe-plugin</artifactId><configuration><argLine>--add-modules ${jvmArguments.addModules} ${argLine}</argLine></configuration></plugin>
                    <plugin><artifactId>maven-surefire-plugin</artifactId><configuration><argLine>--add-modules ${jvmArguments.addModules} ${argLine}</argLine></configuration></plugin>
                    <plugin>
                        <artifactId>maven-toolchains-plugin</artifactId>
                        <configuration><toolchains><jdk><version>${java.version}</version><!--<vendor>oracle</vendor>--></jdk></toolchains></configuration>
                        <executions><execution><phase>validate</phase><goals><goal>toolchain</goal></goals></execution></executions>
                    </plugin>
                </plugins>
            </build>
            <dependencyManagement>
                <dependencies>
                    <dependency><groupId>javax.activation</groupId><artifactId>activation</artifactId><version>${javax.activation.version}</version></dependency>
                    <!-- Hibernate java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException -->
                    <dependency><groupId>javax.xml.bind</groupId><artifactId>jaxb-api</artifactId><version>${jaxb-api.version}</version></dependency>
                </dependencies>
            </dependencyManagement>
            <reporting>
                <plugins>
                    <plugin><artifactId>maven-pmd-plugin</artifactId><configuration><targetJdk>${java.version}</targetJdk></configuration></plugin>
                </plugins>
            </reporting>
        </profile>
        <profile>
            <!-- see: https://github.com/groovy/groovy-eclipse/wiki/Groovy-Eclipse-Maven-plugin -->
            <id>groovy</id>
            <activation><file><exists>${basedir}/src/main/groovy</exists></file><activeByDefault>false</activeByDefault></activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId><artifactId>build-helper-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>add-groovy-sources</id><phase>generate-sources</phase><goals><goal>add-source</goal></goals>
                                <configuration><sources><source>src/main/groovy</source></sources></configuration>
                            </execution>
                            <execution>
                                <id>add-groovy-test-sources</id><phase>generate-sources</phase><goals><goal>add-test-source</goal></goals>
                                <configuration><sources><source>src/test/groovy</source></sources></configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin><groupId>org.codehaus.groovy</groupId><artifactId>groovy-eclipse-compiler</artifactId><version>${groovy-eclipse-compiler.version}</version><extensions>true</extensions></plugin>
                </plugins>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <!-- see https://stackoverflow.com/questions/8524891/maven-groovy-and-java-lombok -->
                            <artifactId>maven-compiler-plugin</artifactId>
                            <configuration>
                                <!-- IMPORTANT -->
                                <useIncrementalCompilation>false</useIncrementalCompilation>
                                <compilerId>groovy-eclipse-compiler</compilerId><!-- Use Groovy Eclipse Compiler -->
                                <compilerArguments>
                                    <!--<indy/>-->
                                    <javaAgentClass>lombok.launch.Agent</javaAgentClass>
                                </compilerArguments>
                                <fork>true</fork>
                            </configuration>
                            <dependencies>
                                <dependency><groupId>org.codehaus.groovy</groupId><artifactId>groovy-eclipse-compiler</artifactId><version>${groovy-eclipse-compiler.version}</version></dependency>
                                <dependency><groupId>org.codehaus.groovy</groupId><artifactId>groovy-eclipse-batch</artifactId><version>${groovy-eclipse-batch.version}</version></dependency>
                                <dependency><groupId>org.projectlombok</groupId><artifactId>lombok</artifactId><version>${lombok.version}</version></dependency>
                            </dependencies>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </build>
            <dependencies>
                <dependency><groupId>org.codehaus.groovy</groupId><artifactId>groovy-all</artifactId></dependency>
                <!--<dependency><groupId>org.codehaus.groovy</groupId><artifactId>groovy-all</artifactId><classifier>indy</classifier></dependency>-->
            </dependencies>
            <dependencyManagement>
                <dependencies>
                    <dependency><groupId>org.codehaus.groovy</groupId><artifactId>groovy-all</artifactId><version>${groovy.version}</version></dependency>
                    <dependency><groupId>org.codehaus.groovy</groupId><artifactId>groovy-all</artifactId><classifier>indy</classifier><version>${groovy.version}</version></dependency>
                </dependencies>
            </dependencyManagement>
            <pluginRepositories>
                <pluginRepository>
                    <!-- Needed for latest Groovy Eclipse version -->
                    <id>groovy-bintray</id><name>Groovy Bintray</name><url>https://dl.bintray.com/groovy/maven</url>
                    <releases><updatePolicy>never</updatePolicy></releases>
                    <snapshots><enabled>false</enabled></snapshots>
                </pluginRepository>
            </pluginRepositories>
        </profile>
        <profile>
            <id>scala</id>
            <activation><file><exists>${basedir}/src/main/scala</exists></file><activeByDefault>false</activeByDefault></activation>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>net.alchim31.maven</groupId><artifactId>scala-maven-plugin</artifactId><version>3.4.2</version>
                        </plugin>
                    </plugins>
                </pluginManagement>
                <plugins>
                    <plugin>
                        <groupId>net.alchim31.maven</groupId><artifactId>scala-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <phase>process-sources</phase>
                                <goals>
                                    <goal>compile</goal>
                                    <goal>testCompile</goal>
                                </goals>
                                <configuration>
                                    <sourceDir>src/main/scala</sourceDir>
                                    <testSourceDir>src/test/scala</testSourceDir>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
            <dependencies>
                <dependency><groupId>org.scala-lang</groupId><artifactId>scala-library</artifactId></dependency>
            </dependencies>
            <dependencyManagement>
                <dependencies>
                    <dependency><groupId>org.scala-lang</groupId><artifactId>scala-library</artifactId><version>${scala.version}</version></dependency>
                </dependencies>
            </dependencyManagement>
        </profile>
        <profile>
            <id>kotlin</id>
            <activation><file><exists>${basedir}/src/main/kotlin</exists></file><activeByDefault>false</activeByDefault></activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId><artifactId>build-helper-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>add-kotlin-sources</id><phase>generate-sources</phase><goals><goal>add-source</goal></goals>
                                <configuration><sources><source>src/main/kotlin</source></sources></configuration>
                            </execution>
                            <execution>
                                <id>add-kotlin-test-sources</id><phase>generate-sources</phase><goals><goal>add-test-source</goal></goals>
                                <configuration><sources><source>src/test/kotlin</source></sources></configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.jetbrains.kotlin</groupId><artifactId>kotlin-maven-plugin</artifactId><version>${kotlin.version}</version>
                        <executions>
                            <execution>
                                <id>compile</id>
                                <phase>process-sources</phase>
                                <goals><goal>compile</goal></goals>
                                <configuration><sourceDirs><source>src/main/kotlin</source></sourceDirs></configuration>
                            </execution>
                            <execution>
                                <id>test-compile</id>
                                <phase>process-test-sources</phase>
                                <goals><goal>test-compile</goal></goals>
                                <configuration><sourceDirs><source>src/test/kotlin</source></sourceDirs></configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
            <dependencies>
                <dependency><groupId>org.jetbrains.kotlin</groupId><artifactId>kotlin-stdlib</artifactId><version>${kotlin.version}</version></dependency>
            </dependencies>
        </profile>

        <!-- this plugin has error sometimes, you can disable it by mvn -Dclirr=false -->
        <profile>
            <id>clirr</id>
            <activation>
                <property><name>clirr</name><value>true</value></property>
            </activation>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin><groupId>org.codehaus.mojo</groupId><artifactId>clirr-maven-plugin</artifactId><version>2.8</version></plugin>
                    </plugins>
                </pluginManagement>
                <plugins>
                    <plugin><groupId>org.codehaus.mojo</groupId><artifactId>clirr-maven-plugin</artifactId></plugin>
                </plugins>
            </build>
            <reporting>
                <plugins>
                    <plugin><groupId>org.codehaus.mojo</groupId><artifactId>clirr-maven-plugin</artifactId></plugin>
                </plugins>
            </reporting>
        </profile>


        <profile>
            <id>jira_project</id>
            <activation><property><name>jira.projectKey</name></property><activeByDefault>false</activeByDefault></activation>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-changes-plugin</artifactId><version>2.12.1</version></plugin>
                    </plugins>
                </pluginManagement>
            </build>
            <reporting>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId><artifactId>maven-changes-plugin</artifactId>
                        <configuration>
                            <!-- if jira version > 5.1, set 'useJql' to true -->
                            <useJql>true</useJql>
                            <jiraUser>${jira.user}</jiraUser>
                            <jiraPassword>${jira.password}</jiraPassword>
                            <!--<onlyCurrentVersion>true</onlyCurrentVersion>-->
                            <!-- http://jira7/rest/api/2/resolution/ -->
                            <!-- http://jira7/rest/api/2/status/ -->
                            <resolutionIds>完成</resolutionIds>
                            <statusIds>关闭</statusIds>
                        </configuration>
                        <reportSets>
                            <reportSet><reports><report>jira-report</report><!--<report>changes-report</report>--></reports></reportSet>
                        </reportSets>
                    </plugin>
                </plugins>
            </reporting>
        </profile>
        <!-- @formatter:on -->
    </profiles>
</project>
