<?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>oss-build</artifactId>
    <description>Module to centralize common resources and configuration for open source stack builds.</description>
    <groupId>cn.home1</groupId>
    <name>oss-build</name>
    <packaging>pom</packaging>
    <url>https://github.com/home1-oss/oss-build</url>
    <version>1.0.9.OSS</version>

    <developers>
        <developer>
            <name>Haolun Zhang</name>
            <url>https://github.com/chshawkn</url>
        </developer>
        <developer>
            <name>Jian Liang</name>
            <email>https://github.com/rainleon</email>
        </developer>
        <developer>
            <name>Shuangjie Feng</name>
            <url>https://github.com/youhouhouhou</url>
        </developer>
        <developer>
            <name>Yan Zhang</name>
            <url>https://github.com/iforgetyou</url>
        </developer>
        <developer>
            <name>Yuliang Jin</name>
            <email>zhixiangjin@126.com</email>
        </developer>
        <developer>
            <name>Zecheng Zhao</name>
            <url>https://github.com/sealake</url>
        </developer>
    </developers>

    <ciManagement>
        <system>Travis CI</system>
        <url>https://travis-ci.org/home1-oss/oss-build</url>
    </ciManagement>

    <issueManagement>
        <system>GitHub Issues</system>
        <url>https://github.com/home1-oss/oss-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/home1-oss/oss-build</url>
        <connection>scm:git:https://github.com/home1-oss/oss-build.git</connection>
        <developerConnection>scm:git:ssh://git@github.com/home1-oss/oss-build.git</developerConnection>
        <tag>HEAD</tag>
    </scm>

    <repositories>
        <repository>
            <id>spring-libs-release</id>
            <url>http://repo.spring.io/libs-release</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>spring-milestone</id>
            <url>http://repo.spring.io/milestone</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>spring-libs-snapshot</id>
            <url>http://repo.spring.io/libs-snapshot</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>spring-libs-release</id>
            <url>http://repo.spring.io/libs-release</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </pluginRepository>
        <pluginRepository>
            <id>spring-milestone</id>
            <url>http://repo.spring.io/milestone</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </pluginRepository>
        <pluginRepository>
            <id>spring-libs-snapshot</id>
            <url>http://repo.spring.io/libs-snapshot</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </pluginRepository>
        <pluginRepository>
            <id>oss-github-maven-plugins</id>
            <url>https://raw.github.com/home1-oss/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>
    </pluginRepositories>

    <!--modules>
        <module>oss-dependency</module>
    </modules-->

    <properties>
        <java.version>1.8</java.version>
        <maven.compiler.encoding>UTF-8</maven.compiler.encoding>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <downloadSources>true</downloadSources>

        <sonar.language>java</sonar.language>
        <sonar.sourceEncoding>UTF-8</sonar.sourceEncoding>
    </properties>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>com.github.eirslett</groupId>
                    <artifactId>frontend-maven-plugin</artifactId>
                    <version>1.3</version>
                    <configuration>
                        <!-- Defaults to https://nodejs.org/dist/ -->
                        <nodeDownloadRoot>${frontend.nodeDownloadRoot}</nodeDownloadRoot>
                        <!-- Defaults to http://registry.npmjs.org/npm/-/ -->
                        <npmDownloadRoot>${frontend.npmDownloadRoot}</npmDownloadRoot>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>com.amashchenko.maven.plugin</groupId>
                    <artifactId>gitflow-maven-plugin</artifactId>
                    <version>1.2.1</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>
                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.19.1</version>
                </plugin>
                <plugin>
                    <groupId>io.fabric8</groupId>
                    <artifactId>docker-maven-plugin</artifactId>
                    <version>0.18.1</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>build-helper-maven-plugin</artifactId>
                    <version>1.12</version>
                </plugin>
                <plugin>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>2.19.1</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>properties-maven-plugin</artifactId>
                    <version>1.0.0</version>
                </plugin>
                <plugin>
                    <groupId>com.spotify</groupId>
                    <artifactId>docker-maven-plugin</artifactId>
                    <version>0.4.13</version>
                    <configuration>
                        <imageName>${docker.registry}/${project.artifactId}</imageName>
                        <imageTags>
                            <imageTag>${project.version}</imageTag>
                            <imageTag>latest</imageTag>
                        </imageTags>
                        <resources>
                            <resource>
                                <targetPath>/</targetPath>
                                <directory>${project.build.directory}</directory>
                                <include>${project.build.finalName}.jar</include>
                                <include>${project.build.finalName}-exec.jar</include>
                            </resource>
                        </resources>
                        <dockerDirectory>${project.basedir}/src/main/docker</dockerDirectory>
                        <noCache>true</noCache>
                        <!--this will use auth info in file :~/.docker/config.json-->
                        <useConfigFile>${docker-maven.useConfigFile}</useConfigFile>
                    </configuration>
                    <executions>
                        <execution>
                            <id>remove-image</id>
                            <phase>clean</phase>
                            <goals>
                                <goal>removeImage</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <!-- see: https://github.com/SonarSource/sonar-scanner-maven -->
                <plugin>
                    <groupId>org.sonarsource.scanner.maven</groupId>
                    <artifactId>sonar-maven-plugin</artifactId>
                    <version>3.2</version>
                </plugin>
                <plugin>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <version>1.8</version>
                </plugin>
                <plugin>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>3.0.0</version>
                </plugin>
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.5.1</version>
                </plugin>
                <plugin>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>2.10</version>
                </plugin>
                <plugin>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>2.8.2</version>
                </plugin>
                <plugin>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>1.4.1</version>
                </plugin>
                <plugin>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>2.5.2</version>
                </plugin>
                <plugin>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>3.0.2</version>
                </plugin>
                <plugin>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>2.10.4</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-site-plugin</artifactId>
                    <version>3.5.1</version>
                    <dependencies>
                        <dependency>
                            <groupId>org.apache.maven.doxia</groupId>
                            <artifactId>doxia-module-markdown</artifactId>
                            <version>1.7</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>2.10</version>
                        </dependency>
                        <!-- support for ssh/scp and password only -->
                        <dependency>
                            <groupId>org.apache.maven.wagon</groupId>
                            <artifactId>wagon-ssh</artifactId>
                            <version>2.10</version>
                            <exclusions>
                                <exclusion>
                                    <groupId>com.jcraft</groupId>
                                    <artifactId>jsch</artifactId>
                                </exclusion>
                            </exclusions>
                        </dependency>
                        <dependency>
                            <groupId>com.jcraft</groupId>
                            <artifactId>jsch</artifactId>
                            <version>0.1.53</version>
                        </dependency>
                        <!-- support for sshexe/scpexe and privateKey -->
                        <dependency>
                            <groupId>org.apache.maven.wagon</groupId>
                            <artifactId>wagon-ssh-external</artifactId>
                            <version>2.10</version>
                        </dependency>
                        <!-- provide org.apache.maven.wagon.providers.ssh.knownhost.NullKnownHostProvider -->
                        <dependency>
                            <groupId>org.apache.maven.wagon</groupId>
                            <artifactId>wagon-ssh-common</artifactId>
                            <version>2.10</version>
                            <exclusions>
                                <exclusion>
                                    <groupId>org.codehaus.plexus</groupId>
                                    <artifactId>plexus-utils</artifactId>
                                </exclusion>
                            </exclusions>
                        </dependency>
                    </dependencies>
                </plugin>
                <plugin>
                    <groupId>org.asciidoctor</groupId>
                    <artifactId>asciidoctor-maven-plugin</artifactId>
                    <version>1.5.3</version>
                </plugin>

                <plugin>
                    <groupId>pl.project13.maven</groupId>
                    <artifactId>git-commit-id-plugin</artifactId>
                    <version>2.2.1</version>
                </plugin>

                <!-- site report plugins -->
                <plugin>
                    <groupId>com.qualinsight.mojo.cobertura</groupId>
                    <artifactId>qualinsight-mojo-cobertura-core</artifactId>
                    <version>1.1.0</version>
                </plugin>
                <!-- cobertura-maven-plugin is deprecated, see: https://github.com/QualInsight/qualinsight-mojo-cobertura -->
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>cobertura-maven-plugin</artifactId>
                    <version>2.7</version>
                </plugin>

                <plugin>
                    <groupId>com.github.github</groupId>
                    <artifactId>site-maven-plugin</artifactId>
                    <version>0.13.0.OSS-M1</version>
                </plugin>

                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>versions-maven-plugin</artifactId>
                    <version>2.2</version>
                </plugin>
                <plugin>
                    <groupId>org.owasp</groupId>
                    <artifactId>dependency-check-maven</artifactId>
                    <version>1.3.6</version>
                </plugin>

                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>animal-sniffer-maven-plugin</artifactId>
                    <version>1.15</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>findbugs-maven-plugin</artifactId>
                    <version>3.0.4</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>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <version>2.17</version>
                    <dependencies>
                        <dependency>
                            <groupId>com.puppycrawl.tools</groupId>
                            <artifactId>checkstyle</artifactId>
                            <version>6.19</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 -->
                <plugin>
                    <artifactId>maven-pmd-plugin</artifactId>
                    <version>3.6</version>
                </plugin>
                <plugin>
                    <artifactId>maven-project-info-reports-plugin</artifactId>
                    <version>2.9</version>
                </plugin>
                <plugin>
                    <artifactId>maven-surefire-report-plugin</artifactId>
                    <version>2.19.1</version>
                </plugin>
            </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>
            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <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>
                    <execution>
                        <id>auto-clean-dockerfile</id>
                        <phase>clean</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <target>
                                <delete failonerror="false">
                                    <fileset dir="${project.basedir}/src/main/docker" includes="Dockerfile"/>
                                </delete>
                            </target>
                        </configuration>
                    </execution>
                    <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>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>ant-contrib</groupId>
                        <artifactId>ant-contrib</artifactId>
                        <version>20020829</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                    <compilerVersion>${java.version}</compilerVersion>
                    <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>
                <!-- see: https://github.com/google/error-prone -->
                <!-- override plexus-compiler-javac-errorprone's dependency on Error Prone with the latest version -->
                <dependencies>
                    <dependency>
                        <groupId>org.codehaus.plexus</groupId>
                        <artifactId>plexus-compiler-javac-errorprone</artifactId>
                        <version>2.7</version>
                    </dependency>
                    <dependency>
                        <groupId>com.google.errorprone</groupId>
                        <artifactId>error_prone_core</artifactId>
                        <version>2.0.9</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <executions>
                    <execution>
                        <id>default-test</id>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <configuration>
                            <argLine>${surefireArgLine}</argLine>
                            <skip>${maven.test.skip}</skip>
                            <useSystemClassLoader>false</useSystemClassLoader>
                            <includes>
                                <include>**/*Documentation.java</include>
                                <include>**/Test*.java</include>
                                <include>**/*Test.java</include>
                                <include>**/*TestCase.java</include>
                                <include>**/*Tests.java</include>
                            </includes>
                            <excludes>
                                <exclude>**/*IT.java</exclude>
                                <exclude>**/deprecated/*.java</exclude>
                                <exclude>**/Deprecated*.java</exclude>
                            </excludes>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-failsafe-plugin</artifactId>
                <configuration>
                    <skip>${maven.integration-test.skip}</skip>
                </configuration>
                <executions>
                    <execution>
                        <id>failsafe-integration-test</id>
                        <phase>integration-test</phase>
                        <goals>
                            <goal>integration-test</goal>
                        </goals>
                        <configuration>
                            <argLine>${failsafeArgLine}</argLine>
                            <includes>
                                <include>**/*IT.java</include>
                            </includes>
                            <excludes>
                                <exclude>**/*Documentation.java</exclude>
                                <exclude>**/Test*.java</exclude>
                                <exclude>**/*Test.java</exclude>
                                <exclude>**/*TestCase.java</exclude>
                                <exclude>**/*Tests.java</exclude>
                                <exclude>**/deprecated/*.java</exclude>
                                <exclude>**/Deprecated*.java</exclude>
                            </excludes>
                        </configuration>
                    </execution>
                    <execution>
                        <id>failsafe-verify</id>
                        <phase>post-integration-test</phase>
                        <goals>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-site-plugin</artifactId>
                <configuration>
                    <attach>true</attach>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <executions>
                    <execution>
                        <id>auto-copy-readme-to-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-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>
                    <execution>
                        <id>filtering-dockerfile</id>
                        <phase>process-sources</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.basedir}/src/main/docker</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>src/main/resources/docker</directory>
                                    <filtering>true</filtering>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-deploy-plugin</artifactId>
            </plugin>
            <plugin>
                <artifactId>maven-enforcer-plugin</artifactId>
                <executions>
                    <execution>
                        <id>enforce-banned-dependencies</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <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>
                                <requireMavenVersion>
                                    <!-- travis-ci uses 3.2.5 not 3.3.9  -->
                                    <version>[3.2.5,)</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>
                    </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>aggregate</id>
                        <goals>
                            <goal>aggregate</goal>
                        </goals>
                        <phase>site</phase>
                        <configuration>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-source-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <!--https://maven.apache.org/plugins/maven-source-plugin/test-jar-no-fork-mojo.html-->
                            <!--jar会执行此插件绑定的maven默认生命周期：@Execute( phase = LifecyclePhase.GENERATE_SOURCES )
                            ，这里使用jar-no-fork避免这个问题  -->
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>

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

    <profiles>
        <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>default-docker-registry</id>
            <activation>
                <property>
                    <name>!docker.registry</name>
                </property>
            </activation>
            <properties>
                <docker.registry>registry.docker.local</docker.registry>
            </properties>
        </profile>
        <profile>
            <id>default-frontend-nodeDownloadRoot</id>
            <activation>
                <property>
                    <name>!frontend.nodeDownloadRoot</name>
                </property>
            </activation>
            <properties>
                <frontend.nodeDownloadRoot>https://npm.taobao.org/mirrors/node/</frontend.nodeDownloadRoot>
            </properties>
        </profile>
        <profile>
            <id>default-frontend-npmDownloadRoot</id>
            <activation>
                <property>
                    <name>!frontend.npmDownloadRoot</name>
                </property>
            </activation>
            <properties>
                <frontend.npmDownloadRoot>http://registry.npm.taobao.org/npm/-/</frontend.npmDownloadRoot>
            </properties>
        </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>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>github_infrastructure</id>
            <activation>
                <property>
                    <name>infrastructure</name>
                    <value>github</value>
                </property>
                <activeByDefault>false</activeByDefault>
            </activation>
            <properties>
                <docker-maven.useConfigFile>true</docker-maven.useConfigFile>
                <!-- id as in your settings.xml -->
                <github.global.server>github</github.global.server>
                <!--github.global.oauth2Token>${env.GITHUB_GIT_SERVICE_TOKEN}</github.global.oauth2Token-->
                <github.global.oauth2Token>${env.GITHUB_GIT_SERVICE_TOKEN}</github.global.oauth2Token>
                <!--<github.site.path>${project.version}</github.site.path>-->
                <!-- In child projects
                Do not add url. Let it inherit from parent.
                <github.site.path>${project.version}/${project.artifactId}</github.site.path>
                -->
                <maven.site.deploy.skip>true</maven.site.deploy.skip>
            </properties>
            <distributionManagement>
                <repository>
                    <id>github-nexus-releases</id>
                    <url>${env.NEXUS_RELEASE_DISTRIBUTE_URL}</url>
                </repository>
                <snapshotRepository>
                    <id>github-nexus-snapshots</id>
                    <url>${env.NEXUS_SNAPSHOT_DISTRIBUTE_URL}</url>
                </snapshotRepository>
                <!-- Do mvn site site:stage -DstagingDirectory=/tmp/path first,
                then manually add/push to the gh-pages branch on GitHub -->
                <site>
                    <id>github-site</id>
                    <name>Deployment through GitHub's site deployment plugin</name>
                    <!--If sub projects/module inherit the site URL from a parent POM,they will automatically append their <artifactId>
                    to their effective deployment location. More info in http://maven.apache.org/guides/mini/guide-site.html-->
                    <url>${build.publish.channel}</url>
                </site>
            </distributionManagement>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.github.github</groupId>
                        <artifactId>site-maven-plugin</artifactId>
                        <configuration>
                            <message>Creating site for ${project.artifactId}-${project.version}</message>
                            <path>${project.distributionManagement.site.url}</path>
                            <merge>true</merge>
                            <noJekyll>true</noJekyll>
                            <repositoryOwner>${env.BUILD_SITE_GITHUB_REPOSITORY_OWNER}</repositoryOwner>
                            <repositoryName>${env.BUILD_SITE_GITHUB_REPOSITORY_NAME}</repositoryName>
                        </configuration>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>site</goal>
                                </goals>
                                <!--phase>site</phase-->
                                <phase>site-deploy</phase>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.8</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>github-nexus-snapshots</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>local_infrastructure</id>
            <activation>
                <property>
                    <name>infrastructure</name>
                    <value>local</value>
                </property>
                <activeByDefault>false</activeByDefault>
            </activation>
            <properties>
                <wagon.merge-maven-repos.target>${nexus.local.repositories}/maven-${build.publish.channel}s</wagon.merge-maven-repos.target>
                <wagon.merge-maven-repos.targetId>nexus.local-${build.publish.channel}s</wagon.merge-maven-repos.targetId>
                <docker-maven.useConfigFile>false</docker-maven.useConfigFile>
            </properties>
            <distributionManagement>
                <repository>
                    <id>nexus.local-releases</id>
                    <url>${nexus.local.repositories}/maven-releases/</url>
                </repository>
                <snapshotRepository>
                    <id>nexus.local-snapshots</id>
                    <url>${nexus.local.repositories}/maven-snapshots/</url>
                </snapshotRepository>
                <site>
                    <id>local-mvnsite</id>
                    <url>${local-mvnsite.prefix}/${site.path}</url>
                </site>
            </distributionManagement>
        </profile>
        <profile>
            <id>internal_infrastructure</id>
            <activation>
                <property>
                    <name>infrastructure</name>
                    <value>internal</value>
                </property>
                <activeByDefault>false</activeByDefault>
            </activation>
            <properties>
                <wagon.merge-maven-repos.target>${internal-nexus.repositories}/${build.publish.channel}s</wagon.merge-maven-repos.target>
                <wagon.merge-maven-repos.targetId>internal-nexus-${build.publish.channel}s</wagon.merge-maven-repos.targetId>
                <docker-maven.useConfigFile>true</docker-maven.useConfigFile>
            </properties>
            <distributionManagement>
                <repository>
                    <id>internal-nexus-releases</id>
                    <url>${internal-nexus.repositories}/releases</url>
                </repository>
                <snapshotRepository>
                    <id>internal-nexus-snapshots</id>
                    <url>${internal-nexus.repositories}/snapshots</url>
                </snapshotRepository>
                <site>
                    <id>internal-mvnsite</id>
                    <!-- scpexe uses privateKey, scp uses password -->
                    <url>${internal-mvnsite.prefix}/${site.path}</url>
                </site>
            </distributionManagement>
        </profile>

        <profile>
            <id>jacoco</id>
            <activation>
                <property>
                    <name>!jacoco</name>
                </property>
            </activation>
            <properties>
                <jacoco-ut.skip>${maven.test.skip}</jacoco-ut.skip>
                <jacoco-it.skip>${maven.integration-test.skip}</jacoco-it.skip>

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

                <!--sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin-->
                <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
                <sonar.jacoco.reportPath>${project.build.directory}/jacoco.exec</sonar.jacoco.reportPath>
                <sonar.jacoco.itReportPath>${jacoco.itReportPath}</sonar.jacoco.itReportPath>
                <!-- should match version of sonar-java-plugin -->
                <sonar-jacoco-listeners.version>4.4.0.8066</sonar-jacoco-listeners.version>
            </properties>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>org.jacoco</groupId>
                            <artifactId>jacoco-maven-plugin</artifactId>
                            <version>${jacoco.version}</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>
                    <!-- 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/ -->
                    <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>
                                <configuration>
                                    <!--destFile>${project.build.directory}/jacoco.exec</destFile-->
                                    <propertyName>surefireArgLine</propertyName>
                                    <skip>${jacoco-ut.skip}</skip>
                                </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>
                                    <!--destFile>${project.build.directory}/jacoco-it.exec</destFile-->
                                    <propertyName>failsafeArgLine</propertyName>
                                    <skip>${jacoco-it.skip}</skip>
                                </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>${jacoco-it.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>${jacoco-it.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>
            <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>
            <dependencies>
                <dependency>
                    <groupId>org.sonarsource.java</groupId>
                    <artifactId>sonar-jacoco-listeners</artifactId>
                    <version>${sonar-jacoco-listeners.version}</version>
                    <scope>test</scope>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>cobertura</id>
            <activation>
                <property>
                    <name>jacoco</name>
                    <value>false</value>
                </property>
            </activation>
            <properties>
                <jacoco-ut.skip>true</jacoco-ut.skip>
                <jacoco-it.skip>true</jacoco-it.skip>
            </properties>
            <dependencyManagement>
                <dependencies>
                    <!-- for cobertura-maven-plugin and qualinsight-mojo-cobertura -->
                    <dependency>
                        <groupId>net.sourceforge.cobertura</groupId>
                        <artifactId>cobertura</artifactId>
                        <version>2.1.1</version>
                        <exclusions>
                            <exclusion>
                                <groupId>ch.qos.logback</groupId>
                                <artifactId>logback-classic</artifactId>
                            </exclusion>
                        </exclusions>
                    </dependency>
                    <!-- resolve cobertura transitive junit version, and SpringJUnit4ClassRunner requires JUnit 4.12 or higher -->
                    <dependency>
                        <groupId>junit</groupId>
                        <artifactId>junit</artifactId>
                        <version>4.12</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>
                <plugins>
                    <!--
                    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
                    -->
                    <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>
                    <!-- cobertura-maven-plugin is deprecated, see: https://github.com/QualInsight/qualinsight-mojo-cobertura -->
                    <!--plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>cobertura-maven-plugin</artifactId>
                        <reportSets>
                            <reportSet>
                                <reports>
                                    <report>cobertura</report>
                                </reports>
                            </reportSet>
                        </reportSets>
                    </plugin-->
                </plugins>
            </build>
        </profile>

        <profile>
            <id>git-commit-id</id>
            <activation>
                <file>
                    <exists>${maven.multiModuleProjectDirectory}/.git/HEAD</exists>
                </file>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>pl.project13.maven</groupId>
                        <artifactId>git-commit-id-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>get-the-git-infos</id>
                                <goals>
                                    <goal>revision</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <commitIdGenerationMode>flat</commitIdGenerationMode>
                            <dotGitDirectory>${maven.multiModuleProjectDirectory}/.git</dotGitDirectory>
                            <failOnNoGitDirectory>false</failOnNoGitDirectory>
                            <generateGitPropertiesFile>true</generateGitPropertiesFile>
                            <!--generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename-->
                            <generateGitPropertiesFilename>src/main/resources/git.properties
                            </generateGitPropertiesFilename>
                            <prefix>git</prefix>
                            <skipPoms>false</skipPoms>
                            <verbose>false</verbose>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <!-- set property checkstyle.config.location in MAVEN_OPTS, pom.xml or settings.xml. -->
        <profile>
            <id>local-checkstyle-config</id>
            <activation>
                <property>
                    <name>!checkstyle.config.location</name>
                </property>
                <file>
                    <exists>${maven.multiModuleProjectDirectory}/src/main/checkstyle/google_checks_6.19.xml</exists>
                </file>
            </activation>
            <properties>
                <checkstyle.config.location>
                    ${maven.multiModuleProjectDirectory}/src/main/checkstyle/google_checks_6.19.xml
                </checkstyle.config.location>
            </properties>
        </profile>

        <profile>
            <id>local-pmd-ruleset</id>
            <activation>
                <property>
                    <name>!pmd.ruleset.location</name>
                </property>
                <file>
                    <exists>${maven.multiModuleProjectDirectory}/src/main/pmd/pmd-ruleset-5.3.5.xml</exists>
                </file>
            </activation>
            <properties>
                <pmd.ruleset.location>
                    ${maven.multiModuleProjectDirectory}/src/main/pmd/pmd-ruleset-5.3.5.xml
                </pmd.ruleset.location>
            </properties>
        </profile>

        <profile>
            <id>build-push-segregation-with-docker</id>
            <activation>
                <property>
                    <name>!active_publish_segregation</name>
                </property>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>com.spotify</groupId>
                            <artifactId>docker-maven-plugin</artifactId>
                            <executions>
                                <execution>
                                    <id>build-image</id>
                                    <phase>package</phase>
                                    <goals>
                                        <goal>build</goal>
                                    </goals>
                                </execution>
                                <execution>
                                    <id>push-image</id>
                                    <phase>deploy</phase>
                                    <goals>
                                        <goal>push</goal>
                                    </goals>
                                </execution>
                            </executions>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </build>
        </profile>

        <profile>
            <id>publish-deploy-segregation-with-wagon</id>
            <activation>
                <property>
                    <name>active_publish_segregation</name>
                    <value>true</value>
                </property>
                <activeByDefault>false</activeByDefault>
            </activation>
            <pluginRepositories>
                <pluginRepository>
                    <id>github-chshawkn-wagon-maven-plugin</id>
                    <url>https://raw.github.com/chshawkn/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.groovy.maven</groupId>
                            <artifactId>gmaven-plugin</artifactId>
                            <version>1.0</version>
                        </plugin>
                        <!--https://www.mail-archive.com/users@maven.apache.org/msg129243.html-->
                        <plugin>
                            <groupId>org.codehaus.mojo</groupId>
                            <artifactId>wagon-maven-plugin</artifactId>
                            <version>1.1-snapshot-chshawkn-1.4</version>
                        </plugin>
                    </plugins>
                </pluginManagement>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.groovy.maven</groupId>
                        <artifactId>gmaven-plugin</artifactId>
                        <executions>
                            <execution>
                                <phase>pre-clean</phase>
                                <goals>
                                    <goal>execute</goal>
                                </goals>
                                <configuration>
                                    <source>
                                        System.setProperty("local.deploy.model.path",
                                                "${project.groupId}".replace('.', '/')+"/${project.artifactId}")
                                    </source>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                            <!--对deploy到本地的文件进行清理-->
                            <execution>
                                <id>clean-local-deploy-dir</id>
                                <phase>none</phase>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <configuration>
                                    <target>
                                        <echo message="${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>
                        <!--http://www.mojohaus.org/wagon-maven-plugin/usage.html-->
                        <!--http://www.mojohaus.org/wagon-maven-plugin/-->
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>wagon-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>deploy-merge-maven-repos</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>
            <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>

        <!-- this plugin has error sometimes, you can disable it by mvn -Dclirr=false -->
        <profile>
            <id>clirr</id>
            <activation>
                <property>
                    <name>site</name>
                    <value>true</value>
                </property>
                <!--
                <property>
                    <name>!clirr</name>
                </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>site</id>
            <activation>
                <property>
                    <name>site</name>
                    <value>true</value>
                </property>
            </activation>
            <properties>
                <umlgraph.version>5.6.6</umlgraph.version>
            </properties>
            <build>
                <plugins>
                    <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-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>
                        <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-surefire-report-plugin</artifactId>
                        <reportSets>
                            <reportSet>
                                <id>unit-tests</id>
                                <reports>
                                    <report>report-only</report>
                                </reports>
                            </reportSet>
                            <reportSet>
                                <id>integration-tests</id>
                                <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>
                        </reportSets>
                    </plugin>
                    <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>
                            <additionalparam>-views -all</additionalparam>
                            <!-- UML Graph需要通过匹配标签插入javadoc生成的html -->
                            <additionalJOption>-J-Duser.language=en</additionalJOption>
                            <useStandardDocletOptions>true</useStandardDocletOptions>
                        </configuration>
                        <reportSets>
                            <reportSet>
                                <id>non-aggregate</id>
                                <reports>
                                    <report>javadoc</report>
                                    <!--report>it-javadoc</report-->
                                </reports>
                            </reportSet>
                            <!-- aggregate reportSet, to define in poms having modules -->
                            <!-- don't run aggregate in child modules -->
                            <!-- TODO inherited false bug? -->
                            <!--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>
                    <!-- Taglist plugin MUST be executed after the JXR plugin. -->
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>taglist-maven-plugin</artifactId>
                        <configuration>
                            <tagListOptions>
                                <tagClasses>
                                    <tagClass>
                                        <displayName>Todo Work</displayName>
                                        <tags>
                                            <tag>
                                                <matchString>todo</matchString>
                                                <matchType>ignoreCase</matchType>
                                            </tag>
                                            <tag>
                                                <matchString>FIXME</matchString>
                                                <matchType>exact</matchType>
                                            </tag>
                                        </tags>
                                    </tagClass>
                                </tagClasses>
                            </tagListOptions>
                        </configuration>
                    </plugin>
                    <plugin>
                        <artifactId>maven-pmd-plugin</artifactId>
                        <configuration>
                            <linkXRef>true</linkXRef>
                            <sourceEncoding>${project.build.sourceEncoding}</sourceEncoding>
                            <minimumTokens>100</minimumTokens>
                            <targetJdk>${java.version}</targetJdk>
                            <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>
                            <dependencyLocationsEnabled>false</dependencyLocationsEnabled>
                        </configuration>
                        <reportSets>
                            <reportSet>
                                <reports>
                                    <report>cim</report>
                                    <report>dependencies</report>
                                    <!--
                                    <report>dependency-convergence</report>
                                    <report>dependency-info</report>
                                    <report>dependency-management</report>
                                    <report>distribution-management</report>
                                    -->
                                    <report>index</report>
                                    <report>summary</report>
                                    <report>mailing-list</report>
                                    <report>issue-tracking</report>
                                    <report>modules</report>
                                    <report>project-team</report>
                                    <report>scm</report>
                                    <report>license</report>
                                </reports>
                            </reportSet>
                        </reportSets>
                    </plugin>
                </plugins>
            </reporting>
        </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>jira_project</id>
            <activation>
                <property>
                    <name>jira.projectKey</name>
                </property>
            </activation>
            <reporting>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-changes-plugin</artifactId>
                        <version>2.12.1</version>
                        <!-- if jira version > 5.1, use this flag -->
                        <configuration>
                            <useJql>true</useJql>
                            <jiraUser>${jira.user}</jiraUser>
                            <jiraPassword>${jira.password}</jiraPassword>
                            <!--
                                <onlyCurrentVersion>true</onlyCurrentVersion>
                             -->
                            <!-- http://jira7.internal/rest/api/2/resolution/ -->
                            <!-- http://jira7.internal/rest/api/2/status/ -->
                            <resolutionIds>完成</resolutionIds>
                            <!--  -->
                            <statusIds>关闭</statusIds>
                        </configuration>
                        <reportSets>
                            <reportSet>
                                <reports>
                                    <!--
                                      <report>changes-report</report>
                                     -->
                                    <report>jira-report</report>
                                </reports>
                            </reportSet>
                        </reportSets>
                    </plugin>
                </plugins>
            </reporting>
        </profile>

        <profile>
            <id>github</id>
            <activation>
                <property>
                    <name>github-publish</name>
                </property>
            </activation>
            <properties>
                <!-- id as in your settings.xml -->
                <github.global.server>github</github.global.server>
                <github.global.oauth2Token>${env.GITHUB_GIT_SERVICE_TOKEN}</github.global.oauth2Token>
                <github.site.path>${project.version}</github.site.path>
                <!-- In child projects
                Do not add url. Let it inherit from parent.
                <github.site.path>${project.version}/${project.artifactId}</github.site.path>
                -->
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.github.github</groupId>
                        <artifactId>site-maven-plugin</artifactId>
                        <configuration>
                            <message>Creating site for ${project.artifactId}-${project.version}</message>
                            <path>${github.site.path}</path>
                            <merge>true</merge>
                            <noJekyll>true</noJekyll>
                            <repositoryOwner>${env.GITHUB_USERNAME}</repositoryOwner>
                        </configuration>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>site</goal>
                                </goals>
                                <phase>site</phase>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
