<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>topinfra-maven</artifactId>
    <description>Core extensions for maven based projects</description>
    <groupId>top.infra.maven</groupId>
    <name>topinfra-maven</name>
    <packaging>pom</packaging>
    <url>https://github.com/ci-and-cd/topinfra-maven</url>
    <version>1.0.7</version>

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

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

    <build>
        <!-- @formatter:off -->
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>wagonRepository-on-initialize</id>
                        <phase>initialize</phase>
                        <goals><goal>bsh-property</goal></goals>
                        <configuration>
                            <source>
                                multiModuleProjectDirectory = System.getProperty("maven.multiModuleProjectDirectory", "");
                                wagonRepository = multiModuleProjectDirectory + File.separator + ".mvn" + File.separator + "wagonRepository";

                                deferred = wagonRepository + File.separator + "deferred";
                                altDeployment = wagonRepository + File.separator + "altDeployment";

                                System.setProperty("wagon.merge-maven-repos.source", altDeployment);
                                session.getUserProperties().setProperty("wagon.merge-maven-repos.source", altDeployment);

                                altDeploymentRepository = "repo::default::file://" + altDeployment;
                                System.setProperty("altDeploymentRepository", altDeploymentRepository);
                                session.getUserProperties().setProperty("altDeploymentRepository", altDeploymentRepository);
                            </source>
                            <properties><property>wagonRepository</property></properties>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <id>echo-altDeploymentRepository-at-initialize</id>
                        <phase>initialize</phase>
                        <goals><goal>run</goal></goals>
                        <configuration>
                            <target>
                                <echo message="altDeploymentRepository: ${altDeploymentRepository}"/>
                            </target>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <!-- @formatter:on -->

        <pluginManagement>
            <!-- @formatter:off -->
            <plugins>
                <plugin>
                    <groupId>pl.project13.maven</groupId>
                    <artifactId>git-commit-id-plugin</artifactId>
                    <version>${version.git-commit-id-plugin}</version>
                    <configuration>
                        <commitIdGenerationMode>flat</commitIdGenerationMode>
                        <dotGitDirectory>${maven.multiModuleProjectDirectory}/.git</dotGitDirectory>
                        <failOnNoGitDirectory>false</failOnNoGitDirectory>
                        <failOnUnableToExtractRepoInfo>true</failOnUnableToExtractRepoInfo>
                        <generateGitPropertiesFile>true</generateGitPropertiesFile>
                        <!--generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename-->
                        <generateGitPropertiesFilename>src/main/resources/git.properties</generateGitPropertiesFilename>
                        <injectAllReactorProjects>true</injectAllReactorProjects>
                        <prefix>git</prefix>
                        <skipPoms>false</skipPoms>
                        <verbose>false</verbose>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.plexus</groupId>
                    <artifactId>plexus-component-metadata</artifactId>
                    <version>2.0.0</version>
                    <dependencies>
                        <!-- Java 11 support. -->
                        <dependency>
                            <groupId>org.ow2.asm</groupId>
                            <artifactId>asm</artifactId>
                            <version>7.1</version>
                        </dependency>
                    </dependencies>
                </plugin>
                <plugin>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <version>${version.maven-antrun-plugin}</version>
                    <dependencies>
                        <dependency><groupId>ant-contrib</groupId><artifactId>ant-contrib</artifactId><version>${version.ant-contrib}</version></dependency>
                    </dependencies>
                </plugin>
                <plugin><artifactId>maven-deploy-plugin</artifactId><version>${version.maven-deploy-plugin}</version></plugin>
                <plugin><artifactId>maven-invoker-plugin</artifactId><version>3.2.0</version></plugin>
                <plugin><artifactId>maven-jar-plugin</artifactId><version>${version.maven-jar-plugin}</version></plugin>
                <plugin><artifactId>maven-gpg-plugin</artifactId><version>${version.maven-gpg-plugin}</version></plugin>
                <plugin><artifactId>maven-javadoc-plugin</artifactId><version>${version.maven-javadoc-plugin}</version></plugin>
                <plugin><artifactId>maven-resources-plugin</artifactId><version>${version.maven-resources-plugin}</version></plugin>
                <plugin><artifactId>maven-shade-plugin</artifactId><version>3.2.1</version></plugin>
                <plugin><artifactId>maven-source-plugin</artifactId><version>${version.maven-source-plugin}</version></plugin>
                <plugin><artifactId>nexus-staging-maven-plugin</artifactId><groupId>org.sonatype.plugins</groupId><version>${version.nexus-staging-maven-plugin}</version></plugin>

                <plugin><groupId>org.codehaus.mojo</groupId><artifactId>build-helper-maven-plugin</artifactId><version>${version.build-helper-maven-plugin}</version></plugin>
                <plugin><groupId>org.codehaus.mojo</groupId><artifactId>wagon-maven-plugin</artifactId><version>${version.wagon-maven-plugin}</version></plugin>
            </plugins>
            <!-- @formatter:on -->
        </pluginManagement>

        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
    </build>

    <!-- @formatter:off -->
    <dependencies>
        <!--<dependency><groupId>com.google.code.findbugs</groupId><artifactId>annotations</artifactId></dependency>-->
        <dependency><groupId>org.jetbrains</groupId><artifactId>annotations</artifactId></dependency>

        <dependency><groupId>org.apache.maven</groupId><artifactId>maven-core</artifactId><scope>provided</scope></dependency>

        <dependency><groupId>ch.qos.logback</groupId><artifactId>logback-classic</artifactId><scope>test</scope></dependency>
        <dependency><groupId>junit</groupId><artifactId>junit</artifactId><scope>test</scope></dependency>
    </dependencies>
    <dependencyManagement>
        <dependencies>
            <dependency><groupId>${project.groupId}</groupId><artifactId>topinfra-maven-dist</artifactId><version>${project.version}</version></dependency>
            <dependency><groupId>${project.groupId}</groupId><artifactId>topinfra-maven-dist</artifactId><classifier>mvn${version.maven}</classifier><version>${project.version}</version></dependency>
            <dependency><groupId>${project.groupId}</groupId><artifactId>topinfra-maven-dist</artifactId><classifier>shaded</classifier><version>${project.version}</version></dependency>
            <dependency><groupId>${project.groupId}</groupId><artifactId>topinfra-maven-test</artifactId><version>${project.version}</version></dependency>
            <dependency><groupId>${project.groupId}</groupId><artifactId>topinfra-mvnext-module-docker</artifactId><version>${project.version}</version></dependency>
            <dependency><groupId>${project.groupId}</groupId><artifactId>topinfra-mvnext-module-gitflow-semver</artifactId><version>${project.version}</version></dependency>
            <dependency><groupId>${project.groupId}</groupId><artifactId>topinfra-mvnext-module-gpg-key</artifactId><version>${project.version}</version></dependency>
            <dependency><groupId>${project.groupId}</groupId><artifactId>topinfra-mvnext-module-infrastructure-settings</artifactId><version>${project.version}</version></dependency>
            <dependency><groupId>${project.groupId}</groupId><artifactId>topinfra-maven-extension</artifactId><version>${project.version}</version></dependency>
            <dependency><groupId>${project.groupId}</groupId><artifactId>topinfra-mvnext-module-maven-build-pom</artifactId><version>${project.version}</version></dependency>
            <dependency><groupId>${project.groupId}</groupId><artifactId>topinfra-mvnext-module-settings-security</artifactId><version>${project.version}</version></dependency>

            <dependency><groupId>cn.home1.tools</groupId><artifactId>maven-settings-decoder-core</artifactId><version>1.1.0</version></dependency>
            <dependency><groupId>com.google.code.findbugs</groupId><artifactId>annotations</artifactId><version>3.0.1u2</version></dependency>
            <dependency><groupId>com.google.guava</groupId><artifactId>guava</artifactId><version>${version.guava}</version></dependency>
            <dependency><groupId>org.jetbrains</groupId><artifactId>annotations</artifactId><version>16.0.3</version></dependency>

            <dependency><groupId>org.apache.maven</groupId><artifactId>maven-artifact</artifactId><version>${version.maven}</version></dependency>
            <dependency><groupId>org.apache.maven</groupId><artifactId>maven-core</artifactId><version>${version.maven}</version></dependency>
            <dependency><groupId>org.apache.maven</groupId><artifactId>maven-embedder</artifactId><version>${version.maven}</version></dependency>
            <dependency><groupId>org.apache.maven</groupId><artifactId>maven-model</artifactId><version>${version.maven}</version></dependency>
            <dependency><groupId>org.codehaus.plexus</groupId><artifactId>plexus-component-annotations</artifactId><version>1.7.1</version></dependency>

            <dependency><groupId>org.apache.maven</groupId><artifactId>maven-settings</artifactId><version>${version.maven}</version></dependency>
            <dependency><groupId>org.sonatype.plexus</groupId><artifactId>plexus-cipher</artifactId><version>${version.plexus-cipher}</version></dependency>

            <!--<dependency><groupId>com.squareup.okhttp3</groupId><artifactId>okhttp</artifactId><version>3.14.2</version></dependency>-->
            <dependency><groupId>org.eclipse.jgit</groupId><artifactId>org.eclipse.jgit</artifactId><version>5.1.3.201810200350-r</version></dependency>
            <dependency><groupId>org.json</groupId><artifactId>json</artifactId><version>20180813</version></dependency>
            <dependency><groupId>org.unix4j</groupId><artifactId>unix4j-command</artifactId><version>0.5</version></dependency>

            <dependency><groupId>ch.qos.logback</groupId><artifactId>logback-classic</artifactId><version>${version.logback}</version></dependency>
            <dependency><groupId>org.apache.commons</groupId><artifactId>commons-lang3</artifactId><version>${version.commons-lang3}</version></dependency>
            <dependency><groupId>org.projectlombok</groupId><artifactId>lombok</artifactId><version>${version.lombok}</version></dependency>
            <dependency><groupId>org.springframework</groupId><artifactId>spring-context</artifactId><version>${version.spring-context}</version></dependency>
            <dependency><groupId>junit</groupId><artifactId>junit</artifactId><version>${version.junit.legacy}</version></dependency>
        </dependencies>
    </dependencyManagement>
    <!-- @formatter:on -->

    <modules>
        <module>topinfra-maven-dist</module>
        <module>topinfra-maven-extension</module>
        <module>topinfra-maven-test</module>
        <module>topinfra-mvnext-module-docker</module>
        <module>topinfra-mvnext-module-gitflow-semver</module>
        <module>topinfra-mvnext-module-gpg-key</module>
        <module>topinfra-mvnext-module-infrastructure-settings</module>
        <module>topinfra-mvnext-module-maven-build-pom</module>
        <module>topinfra-mvnext-module-settings-security</module>
    </modules>

    <!-- @formatter:off -->
    <profiles>
        <profile>
            <id>default-infrastructure_ossrh</id>
            <activation><property><name>!infrastructure</name></property></activation>
            <distributionManagement>
                <repository><id>ossrh-nexus2-staging</id><url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url></repository>
                <snapshotRepository><id>ossrh-nexus2-snapshots</id><url>https://oss.sonatype.org/content/repositories/snapshots</url></snapshotRepository>
            </distributionManagement>
        </profile>
        <profile>
            <id>infrastructure_custom</id>
            <activation><property><name>infrastructure</name><value>custom</value></property></activation>
            <distributionManagement>
                <repository><id>custom-nexus3-releases</id><url>${custom.nexus3}repository/maven-releases/</url></repository>
                <snapshotRepository><id>custom-nexus3-snapshots</id><url>${custom.nexus3}repository/maven-snapshots/</url></snapshotRepository>
            </distributionManagement>
            <pluginRepositories>
                <pluginRepository>
                    <id>custom-nexus3-releases</id>
                    <name>custom nexus3 releases</name>
                    <url>${custom.nexus3}repository/maven-releases/</url>
                    <releases><enabled>true</enabled><updatePolicy>never</updatePolicy></releases>
                    <snapshots><enabled>false</enabled></snapshots>
                </pluginRepository>
                <pluginRepository>
                    <id>custom-nexus3-snapshots</id>
                    <name>custom nexus3 snapshots</name>
                    <url>${custom.nexus3}repository/maven-snapshots/</url>
                    <releases><enabled>false</enabled></releases>
                    <snapshots><enabled>true</enabled><updatePolicy>daily</updatePolicy></snapshots>
                </pluginRepository>
                <pluginRepository>
                    <id>custom-nexus3-thirdparty</id>
                    <name>custom nexus3 thirdparty</name>
                    <url>${custom.nexus3}repository/maven-thirdparty/</url>
                    <releases><enabled>true</enabled><updatePolicy>never</updatePolicy></releases>
                    <snapshots><enabled>true</enabled><updatePolicy>daily</updatePolicy></snapshots>
                </pluginRepository>
            </pluginRepositories>
            <properties>
                <nexus3>${custom.nexus3}</nexus3>
            </properties>
            <repositories>
                <repository>
                    <id>custom-nexus3-releases</id>
                    <name>custom nexus3 releases</name>
                    <url>${custom.nexus3}repository/maven-releases/</url>
                    <releases><enabled>true</enabled><updatePolicy>never</updatePolicy></releases>
                    <snapshots><enabled>false</enabled></snapshots>
                </repository>
                <repository>
                    <id>custom-nexus3-snapshots</id>
                    <name>custom nexus3 snapshots</name>
                    <url>${custom.nexus3}repository/maven-snapshots/</url>
                    <releases><enabled>false</enabled></releases>
                    <snapshots><enabled>true</enabled><updatePolicy>daily</updatePolicy></snapshots>
                </repository>
                <repository>
                    <id>custom-nexus3-thirdparty</id>
                    <name>custom nexus3 thirdparty</name>
                    <url>${custom.nexus3}repository/maven-thirdparty/</url>
                    <releases><enabled>true</enabled><updatePolicy>never</updatePolicy></releases>
                    <snapshots><enabled>true</enabled><updatePolicy>daily</updatePolicy></snapshots>
                </repository>
            </repositories>
        </profile>
        <profile>
            <id>gpg2-arguments</id>
            <activation><property><name>gpg.loopback</name><value>true</value></property></activation>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <configuration>
                            <gpgArguments>
                                <gpgArgument>--use-agent</gpgArgument>
                                <gpgArgument>--pinentry-mode</gpgArgument>
                                <gpgArgument>loopback</gpgArgument>
                            </gpgArguments>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>gpg-for-travis-and-maven-central</id>
            <activation><property><name>gpg.executable</name></property></activation>
            <properties>
                <!-- Do not set gpg.executable here -->
                <!--<gpg.executable>gpg</gpg.executable>-->
                <gpg.keyname>${env.CI_OPT_GPG_KEYNAME}</gpg.keyname>
                <gpg.passphrase>${env.CI_OPT_GPG_PASSPHRASE}</gpg.passphrase>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <executions>
                            <execution><id>sign-artifacts</id><phase>verify</phase><goals><goal>sign</goal></goals></execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>maven_packages_skip</id>
            <activation>
                <!--<file><exists>${wagon.merge-maven-repos.source}</exists></file>-->
                <property><name>maven.packages.skip</name><value>true</value></property>
            </activation>
            <build>
                <pluginManagement>
                    <plugins>
                        <!-- -Dassembly.skipAssembly=true -->
                        <plugin>
                            <artifactId>maven-assembly-plugin</artifactId>
                            <configuration><skipAssembly>true</skipAssembly></configuration>
                        </plugin>
                        <plugin>
                            <artifactId>maven-jar-plugin</artifactId>
                            <executions><execution><id>default-jar</id><phase>none</phase></execution></executions>
                        </plugin>
                        <plugin>
                            <artifactId>maven-install-plugin</artifactId>
                            <configuration><skip>true</skip></configuration>
                            <executions>
                                <execution>
                                    <id>default-install</id>
                                    <phase>none</phase>
                                    <goals><goal>install</goal></goals>
                                </execution>
                            </executions>
                        </plugin>
                        <plugin>
                            <artifactId>maven-deploy-plugin</artifactId>
                            <configuration><skip>true</skip></configuration>
                        </plugin>
                    </plugins>
                </pluginManagement>
                <plugins>
                    <plugin>
                        <groupId>pl.project13.maven</groupId><artifactId>git-commit-id-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>get-the-git-infos</id>
                                <phase>initialize</phase>
                                <goals><goal>revision</goal></goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>build-helper-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>gitRef-on-initialize</id>
                                <phase>initialize</phase>
                                <goals><goal>bsh-property</goal></goals>
                                <configuration>
                                    <source>
                                        gitRef = session.getUserProperties().getProperty("git.branch", System.getProperty("git.branch", project.getProperties().getProperty("git.branch")));
                                    </source>
                                    <properties><property>gitRef</property></properties>
                                </configuration>
                            </execution>
                            <execution>
                                <id>targetId-on-initialize</id>
                                <phase>initialize</phase>
                                <goals><goal>bsh-property</goal></goals>
                                <configuration>
                                    <source>
                                        gitRef = project.getProperties().getProperty("gitRef");
                                        releaseRef = gitRef == null || gitRef.equals("") ? false : gitRef.startsWith("hotfix/") || gitRef.startsWith("release/") || gitRef.startsWith("support/");
                                        snapshotRef = gitRef == null || gitRef.equals("") ? false : gitRef.equals("develop") || gitRef.startsWith("feature/");
                                        channel = releaseRef ? "releases" : snapshotRef ? "snapshots" : "mixed";

                                        targetId = "custom-nexus3-" + channel;

                                        System.setProperty("wagon.merge-maven-repos.targetId", targetId);
                                        session.getUserProperties().setProperty("wagon.merge-maven-repos.targetId", targetId);
                                        project.getProperties().setProperty("wagon.merge-maven-repos.targetId", targetId);
                                    </source>
                                    <properties><property>targetId</property></properties>
                                </configuration>
                            </execution>
                            <execution>
                                <id>targetRepo-on-initialize</id>
                                <phase>initialize</phase>
                                <goals><goal>bsh-property</goal></goals>
                                <configuration>
                                    <source>
                                        gitRef = project.getProperties().getProperty("gitRef");
                                        releaseRef = gitRef == null || gitRef.equals("") ? false : gitRef.startsWith("hotfix/") || gitRef.startsWith("release/") || gitRef.startsWith("support/");
                                        snapshotRef = gitRef == null || gitRef.equals("") ? false : gitRef.equals("develop") || gitRef.startsWith("feature/");
                                        channel = releaseRef ? "releases" : snapshotRef ? "snapshots" : "mixed";

                                        targetRepo = "${custom.nexus3}repository/maven-" + channel + "/";

                                        System.setProperty("wagon.merge-maven-repos.target", targetRepo);
                                        session.getUserProperties().setProperty("wagon.merge-maven-repos.target", targetRepo);
                                        project.getProperties().setProperty("wagon.merge-maven-repos.target", targetRepo);
                                    </source>
                                    <properties><property>targetRepo</property></properties>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>echo-wagon-properties-at-initialize</id>
                                <phase>initialize</phase>
                                <goals><goal>run</goal></goals>
                                <configuration>
                                    <target>
                                        <echo message="gitRef: ${gitRef}"/>
                                        <echo message="wagon.merge-maven-repos.source: ${wagon.merge-maven-repos.source}"/>
                                        <echo message="wagon.merge-maven-repos.target: ${wagon.merge-maven-repos.target}"/>
                                        <echo message="wagon.merge-maven-repos.targetId: ${wagon.merge-maven-repos.targetId}"/>
                                    </target>
                                </configuration>
                            </execution>
                            <execution>
                                <id>rename-maven_metadata_nexus_xml-to-maven_metadata_xml</id>
                                <inherited>false</inherited>
                                <phase>initialize</phase>
                                <goals><goal>run</goal></goals>
                                <configuration>
                                    <target>
                                        <echo message="rename ${wagon.merge-maven-repos.source}/**/maven-metadata-nexus.xml"/>
                                        <mkdir dir="${wagon.merge-maven-repos.source}"/>
                                        <move includeemptydirs="false"
                                              overwrite="true"
                                              todir="${wagon.merge-maven-repos.source}"
                                              verbose="true">
                                            <fileset dir="${wagon.merge-maven-repos.source}">
                                                <include name="**/maven-metadata-nexus.*"/>
                                            </fileset>
                                            <filtermapper>
                                                <replacestring from="maven-metadata-nexus" to="maven-metadata"/>
                                            </filtermapper>
                                        </move>
                                    </target>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>wagon-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>merge-maven-repos-deploy</id>
                                <inherited>false</inherited>
                                <phase>deploy</phase>
                                <goals><goal>merge-maven-repos</goal></goals>
                                <configuration>
                                    <source>file://${wagon.merge-maven-repos.source}</source>
                                    <target>${wagon.merge-maven-repos.target}</target>
                                    <targetId>${wagon.merge-maven-repos.targetId}</targetId>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>skip-tests-when-fast-option-present</id>
            <activation><property><name>fast</name></property></activation>
            <properties>
                <skipTests>true</skipTests>
                <skipITs>true</skipITs>
            </properties>
        </profile>
        <profile>
            <id>nexus2_staging</id>
            <activation><property><name>nexus2.staging</name><value>true</value></property></activation>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>org.sonatype.plugins</groupId>
                            <artifactId>nexus-staging-maven-plugin</artifactId>
                            <configuration>
                                <altStagingDirectory>${wagonRepository}</altStagingDirectory>
                                <autoDropAfterRelease>true</autoDropAfterRelease>
                                <autoReleaseAfterClose>false</autoReleaseAfterClose>
                                <detectBuildFailures>true</detectBuildFailures>
                                <keepStagingRepositoryOnFailure>false</keepStagingRepositoryOnFailure>
                                <keepStagingRepositoryOnCloseRuleFailure>false</keepStagingRepositoryOnCloseRuleFailure>
                                <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                                <serverId>ossrh-nexus2-staging</serverId>
                                <!--<sslAllowAll>true</sslAllowAll>-->
                                <stagingProgressPauseDurationSeconds>30</stagingProgressPauseDurationSeconds>
                                <stagingProgressTimeoutMinutes>60</stagingProgressTimeoutMinutes>

                                <!--
                                <skipLocalStaging>${snapshotRef}</skipLocalStaging>
                                <skipNexusStagingDeployMojo>${snapshotRef}</skipNexusStagingDeployMojo>
                                <skipRemoteStaging>${snapshotRef}</skipRemoteStaging>
                                <skipStaging>${snapshotRef}</skipStaging>
                                <skipStagingRepositoryClose>${snapshotRef}</skipStagingRepositoryClose>
                                -->
                            </configuration>
                        </plugin>
                    </plugins>
                </pluginManagement>
                <plugins>
                    <plugin>
                        <artifactId>maven-deploy-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>default-deploy</id>
                                <phase>deploy</phase>
                                <goals><goal>deploy</goal></goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <!--<extensions>true</extensions>-->
                        <executions>
                            <execution>
                                <id>default-deploy</id>
                                <phase>deploy</phase>
                                <goals><goal>deploy</goal></goals>
                            </execution>
                            <!--
                            <execution>
                                <id>deploy-staged-repository</id>
                                <phase>deploy</phase>
                                <goals><goal>deploy-staged-repository</goal></goals>
                                <configuration>
                                    <repositoryDirectory>${wagonRepository}</repositoryDirectory>
                                </configuration>
                            </execution>
                            -->
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>skip-these-plugins-when-fast-option-present</id>
            <activation><property><name>!fast</name></property></activation>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-source-plugin</artifactId>
                        <executions>
                            <execution><id>attach-sources</id><goals><goal>jar-no-fork</goal></goals><phase>prepare-package</phase></execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <executions>
                            <execution><id>attach-javadocs</id><goals><goal>jar</goal></goals><phase>prepare-package</phase></execution>
                            <execution><id>attach-test-javadocs</id><goals><goal>test-jar</goal></goals><phase>prepare-package</phase></execution>
                        </executions>
                    </plugin>
                </plugins>
                <pluginManagement>
                    <plugins>
                        <plugin><groupId>com.googlecode.maven-download-plugin</groupId><artifactId>download-maven-plugin</artifactId><version>1.4.2</version></plugin>

                        <plugin>
                            <artifactId>maven-invoker-plugin</artifactId>
                            <configuration>
                                <cloneProjectsTo>${project.basedir}/target/it</cloneProjectsTo>
                                <debug>false</debug>
                                <goals>
                                    <!-- Goals for child maven. -->
                                    <goal>clean</goal>
                                    <goal>dependency:resolve</goal>
                                    <goal>install</goal>
                                </goals>
                                <ignoreFailures>false</ignoreFailures>
                                <invokerPropertiesFile>invoker.properties</invokerPropertiesFile>
                                <postBuildHookScript>verify</postBuildHookScript>
                                <preBuildHookScript>setup</preBuildHookScript>
                                <properties>
                                    <add.prefix.to.itself>text</add.prefix.to.itself>
                                    <git.commit.id.skip>false</git.commit.id.skip>
                                    <!-- Avoid error 'Invalid version [0.0.1-SNAPSHOT] for ref [release/1.0.0]' on release branches -->
                                    <git.ref.name>develop</git.ref.name>
                                    <infrastructure>ossrh</infrastructure>
                                    <sonar>true</sonar>
                                    <private.sonar.host.url>http://my-sonarqube:9000</private.sonar.host.url>
                                    <site>true</site>
                                </properties>
                                <projectsDirectory>${project.basedir}/src/it</projectsDirectory>
                                <!--<settingsFile>src/it/settings.xml</settingsFile>-->
                                <showErrors>false</showErrors>
                                <streamLogs>false</streamLogs>
                            </configuration>
                            <executions>
                                <execution>
                                    <id>integration-test</id>
                                    <goals>
                                        <!-- Goals for parent maven. -->
                                        <goal>install</goal>
                                        <goal>run</goal>
                                        <goal>verify</goal>
                                    </goals>
                                </execution>
                            </executions>
                        </plugin>
                        <plugin>
                            <artifactId>maven-javadoc-plugin</artifactId>
                            <configuration>
                                <additionalJOption>-J-Duser.language=en</additionalJOption>
                                <!--<additionalOptions>-views -all</additionalOptions>-->
                                <charset>${project.build.sourceEncoding}</charset>
                                <!--<doclet>org.umlgraph.doclet.UmlGraphDoc</doclet>-->
                                <!-- UML Graph needs to match HTML tag to insert images into javadoc -->
                                <!--<docletArtifact><groupId>org.umlgraph</groupId><artifactId>umlgraph</artifactId><version>${umlgraph.version}</version></docletArtifact>-->
                                <doclint>none</doclint>
                                <encoding>${project.build.sourceEncoding}</encoding>
                                <failOnError>${maven.javadoc.failsOnError}</failOnError>
                                <notimestamp>true</notimestamp>
                                <useStandardDocletOptions>true</useStandardDocletOptions>
                            </configuration>
                        </plugin>
                        <plugin>
                            <artifactId>maven-surefire-plugin</artifactId>
                            <version>${version.maven.testing}</version>
                            <dependencies>
                                <dependency>
                                    <groupId>org.junit.jupiter</groupId>
                                    <artifactId>junit-jupiter-engine</artifactId>
                                    <version>${version.junit.jupiter}</version>
                                </dependency>
                                <dependency>
                                    <groupId>org.junit.vintage</groupId>
                                    <artifactId>junit-vintage-engine</artifactId>
                                    <version>${version.junit.vintage}</version>
                                </dependency>
                            </dependencies>
                            <configuration>
                                <runOrder>alphabetical</runOrder>
                                <includes>
                                    <include>**/*Test.class</include>
                                    <include>**/*Suite.class</include>
                                </includes>
                            </configuration>
                        </plugin>

                        <plugin>
                            <artifactId>maven-failsafe-plugin</artifactId>
                            <version>${version.maven.testing}</version>
                            <dependencies>
                                <dependency>
                                    <groupId>org.junit.jupiter</groupId>
                                    <artifactId>junit-jupiter-engine</artifactId>
                                    <version>${version.junit.jupiter}</version>
                                </dependency>
                                <dependency>
                                    <groupId>org.junit.vintage</groupId>
                                    <artifactId>junit-vintage-engine</artifactId>
                                    <version>${version.junit.vintage}</version>
                                </dependency>
                            </dependencies>
                            <configuration>
                                <includes>
                                    <include>**/*IT.java</include>
                                    <include>**/*Verify.java</include>
                                </includes>
                            </configuration>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </build>
        </profile>

        <profile>
            <id>userProperties</id>
            <activation><file><exists>${basedir}/src/main/resources/userProperties.properties</exists></file></activation>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-resources-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>filtering-dockerfile</id>
                                <phase>process-sources</phase>
                                <goals>
                                    <goal>copy-resources</goal>
                                </goals>
                                <configuration>
                                    <outputDirectory>${project.build.directory}</outputDirectory>
                                    <delimiters>
                                        <!--<delimiter>${*}</delimiter>-->
                                        <delimiter>@</delimiter>
                                    </delimiters>
                                    <resources>
                                        <resource>
                                            <directory>src/main/resources</directory>
                                            <includes>
                                                <include>userProperties.properties</include>
                                            </includes>
                                            <filtering>true</filtering>
                                        </resource>
                                    </resources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
    <!-- @formatter:on -->

    <properties>
        <custom.nexus3>https://nexus3.infra.top/nexus/</custom.nexus3>

        <java.version>8</java.version>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>

        <maven.javadoc.failsOnError>false</maven.javadoc.failsOnError>

        <!-- mvn install -Dprofile="profile name" -DprofileFormat=JSON,HTML -->
        <maven-profiler-report-directory>${project.basedir}/.mvn/profiler-report</maven-profiler-report-directory>

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

        <version.ant-contrib>20020829</version.ant-contrib>
        <version.build-helper-maven-plugin>3.0.0</version.build-helper-maven-plugin>
        <version.git-commit-id-plugin>2.2.6</version.git-commit-id-plugin>
        <version.maven-antrun-plugin>1.8</version.maven-antrun-plugin>
        <version.maven-deploy-plugin>3.0.0-M1</version.maven-deploy-plugin>
        <version.maven-gpg-plugin>1.6</version.maven-gpg-plugin>
        <version.maven-javadoc-plugin>3.1.0</version.maven-javadoc-plugin>
        <version.maven-resources-plugin>3.1.0</version.maven-resources-plugin>
        <version.maven-source-plugin>3.0.1</version.maven-source-plugin>

        <version.commons-lang3>3.8.1</version.commons-lang3>
        <version.guava>27.1-jre</version.guava>
        <version.junit.jupiter>5.4.2</version.junit.jupiter>
        <version.junit.legacy>4.12</version.junit.legacy>
        <version.junit.vintage>5.4.2</version.junit.vintage>
        <version.logback>1.2.3</version.logback>
        <version.lombok>1.16.14</version.lombok>
        <version.maven>3.6.1</version.maven>
        <md5.maven>fd43b329dcf4c837f4951ff9834f0e6f</md5.maven>
        <version.maven-jar-plugin>3.1.2</version.maven-jar-plugin>
        <version.maven.testing>2.22.2</version.maven.testing>
        <version.nexus-staging-maven-plugin>1.6.8</version.nexus-staging-maven-plugin>
        <version.plexus-cipher>1.7</version.plexus-cipher>
        <version.spring-context>5.1.6.RELEASE</version.spring-context>

        <version.wagon-maven-plugin>wagon-maven-plugin-2.0.1-snapshot-chshawkn-1.6</version.wagon-maven-plugin>
    </properties>

    <!-- @formatter:off -->
    <pluginRepositories>
        <pluginRepository>
            <id>github-mvn-repo-wagon-maven-plugin</id>
            <url>https://raw.github.com/ci-and-cd/wagon-maven-plugin/mvn-repo/</url>
            <name>Forked wagon-maven-plugin that can merge snapshots metadata correctly</name>
            <layout>default</layout>
            <snapshots><enabled>true</enabled><updatePolicy>daily</updatePolicy></snapshots>
            <releases><enabled>true</enabled><updatePolicy>never</updatePolicy></releases>
        </pluginRepository>
    </pluginRepositories>
    <repositories>
        <repository>
            <id>ossrh-nexus2-releases</id><name>ossrh nexus2 releases</name><url>https://oss.sonatype.org/content/repositories/releases/</url>
            <releases><enabled>true</enabled><updatePolicy>never</updatePolicy></releases><snapshots><enabled>false</enabled></snapshots>
        </repository>
        <repository>
            <id>ossrh-nexus2-snapshots</id><name>ossrh nexus2 snapshots</name><url>https://oss.sonatype.org/content/repositories/snapshots/</url>
            <releases><enabled>false</enabled></releases><snapshots><enabled>true</enabled><updatePolicy>daily</updatePolicy></snapshots>
        </repository>
    </repositories>
    <!-- @formatter:on -->
</project>