<?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>

    <groupId>cn.yusiwen</groupId>
    <artifactId>spring-base-dependencies</artifactId>
    <version>2</version>
    <packaging>pom</packaging>

    <name>spring-cloud-parent-pom</name>
    <description>Generic Dependency POM for Spring Cloud Projects</description>
    <url>https://github.com/yusiwen/spring-base-dependencies</url>

    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:ssh://git@github.com/yusiwen/spring-base-dependencies.git</connection>
        <developerConnection>scm:git:ssh://git@github.com/yusiwen/spring-base-dependencies.git</developerConnection>
        <url>https://github.com/yusiwen/spring-base-dependencies</url>
        <tag>v2</tag>
    </scm>

    <developers>
        <developer>
            <id>yusiwen</id>
            <name>Siwen Yu</name>
            <email>yusiwen@gmail.com</email>
        </developer>
    </developers>


    <issueManagement>
        <system>Github</system>
        <url>https://github.com/yusiwen/spring-base-dependencies/issues</url>
    </issueManagement>
    <ciManagement>
        <system>travis-ci</system>
        <url>https://travis-ci.org/yusiwen/spring-base-dependencies</url>
    </ciManagement>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <java.version>1.8</java.version>
        <build.environment>dev</build.environment>

        <docker.build.name>${project.groupId}.${project.artifactId}:${project.version}-${build.environment}</docker.build.name>
        <docker.image.skip>true</docker.image.skip>

        <spring-cloud.version>Hoxton.SR12</spring-cloud.version>
        <spring-boot.version>2.3.12.RELEASE</spring-boot.version>
        <spring-cloud.alibaba.version>2.2.7.RELEASE</spring-cloud.alibaba.version>
        <openfeign-dependencies.version>2.2.7.RELEASE</openfeign-dependencies.version>
        <spring-boot-admin.version>2.3.1</spring-boot-admin.version>
        <jasypt.version>3.0.4</jasypt.version>
        <nimbus.version>8.23</nimbus.version>
        <java.websocket.version>1.5.2</java.websocket.version>

        <jetcache.version>2.5.16</jetcache.version>
        <fastjson.version>1.2.78</fastjson.version>
        <json-schema-validator.version>1.0.64</json-schema-validator.version>

        <mysql-connector.version>8.0.27</mysql-connector.version>
        <mybatis.version>3.5.7</mybatis.version>
        <mybatis-plus.version>3.4.3.4</mybatis-plus.version>
        <mybatis-plus-generator.version>3.5.1</mybatis-plus-generator.version>
        <freemarker.version>2.3.31</freemarker.version>

        <log4j2.version>2.15.0</log4j2.version> <!-- Patch for CVE-2021-44228 -->
        <hutool.version>5.7.16</hutool.version>
        <lombok.version>1.18.22</lombok.version>
        <swagger.version>3.0.0</swagger.version>

        <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version> <!-- 编译插件 -->
        <maven-resources-plugin.version>3.2.0</maven-resources-plugin.version> <!-- 资源文件处理插件 -->
        <maven-source-plugin.version>3.2.1</maven-source-plugin.version> <!-- 源码打包插件 -->
        <maven-javadoc-plugin.version>3.3.1</maven-javadoc-plugin.version> <!-- 文档打包插件 -->
        <maven-deploy-plugin.version>2.8.2</maven-deploy-plugin.version> <!-- 部署插件 -->
        <maven-gpg-plugin.version>3.0.1</maven-gpg-plugin.version> <!-- GPG 签名插件 -->
        <maven-release-plugin.version>3.0.0-M4</maven-release-plugin.version> <!-- 发布插件 -->
        <maven-war-plugin.version>3.2.2</maven-war-plugin.version> <!-- war打包插件 -->
        <maven-dependency-plugin.version>3.1.1</maven-dependency-plugin.version> <!-- 依赖插件 -->
        <dependency-check-maven.version>7.0.4</dependency-check-maven.version>
        <maven-clean-plugin.version>3.1.0</maven-clean-plugin.version> <!-- clean插件 -->
        <maven-checkstyle-plugin.version>3.1.2</maven-checkstyle-plugin.version> <!--checkstyle check插件 -->
        <checkstyle.version>9.2</checkstyle.version>
        <maven-jxr-plugin.version>3.0.0</maven-jxr-plugin.version>
        <finbugs.version>3.0.1</finbugs.version>
        <spotbugs-maven-plugin.version>4.5.0.0</spotbugs-maven-plugin.version> <!--findbugs check插件 -->
        <properties-maven-plugin.version>1.0.0</properties-maven-plugin.version> <!--读取properties文件插件 -->
        <maven-pmd-plugin.version>3.8</maven-pmd-plugin.version>
        <p3c-pmd.version>1.3.6</p3c-pmd.version>
        <build-helper-maven-plugin.version>3.2.0</build-helper-maven-plugin.version>
        <maven-build-helper.version>1.2</maven-build-helper.version>
        <directory-maven-plugin.version>1.0</directory-maven-plugin.version>
        <flyway-maven-plugin.version>8.2.0</flyway-maven-plugin.version>
        <jacoco.version>0.8.7</jacoco.version>
        <sonar-maven-plugin.version>3.9.1.2184</sonar-maven-plugin.version>

        <groovy.version>3.0.9</groovy.version>
        <okhttp.version>3.14.9</okhttp.version>
        <embedded-consul.verion>2.2.1</embedded-consul.verion>

        <antrun-plugin.version>3.0.0</antrun-plugin.version>
        <docker-maven-plugin.version>0.38.0</docker-maven-plugin.version>

        <formatter.plugin>2.16.0</formatter.plugin>
        <impsort.plugin>1.6.2</impsort.plugin>
        <whitespace.plugin>1.0.5</whitespace.plugin>
        <xml-format.plugin>3.2.0</xml-format.plugin>

        <javacv.version>1.5.6</javacv.version>
        <ffmpeg-platform.version>4.4-1.5.6</ffmpeg-platform.version>
        <poi.version>4.1.2</poi.version>

        <!-- Overriding chained dependencies for fixing vulnerabilities -->
        <spring-framework.version>5.2.20.RELEASE</spring-framework.version>
        <spring-cloud-netflix.version>2.2.10.RELEASE</spring-cloud-netflix.version>
        <spring-security-crypto.version>5.3.13.RELEASE</spring-security-crypto.version>
        <bouncycastle.version>1.67</bouncycastle.version>
        <jakarta.el.version>3.0.4</jakarta.el.version>
        <logback.version>1.2.11</logback.version>
        <nacos-client.version>2.0.4</nacos-client.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <!-- Vulnerabilities fixing: Overriding dependencies version -->
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-framework-bom</artifactId>
                <version>${spring-framework.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-starter-netflix-ribbon</artifactId>
                <version>${spring-cloud-netflix.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-starter-netflix-archaius</artifactId>
                <version>${spring-cloud-netflix.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-netflix-archaius</artifactId>
                <version>${spring-cloud-netflix.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-netflix-hystrix</artifactId>
                <version>${spring-cloud-netflix.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-netflix-ribbon</artifactId>
                <version>${spring-cloud-netflix.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.security</groupId>
                <artifactId>spring-security-crypto</artifactId>
                <version>${spring-security-crypto.version}</version>
            </dependency>
            <dependency>
                <groupId>org.bouncycastle</groupId>
                <artifactId>bcprov-jdk15on</artifactId>
                <version>${bouncycastle.version}</version>
            </dependency>
            <dependency>
                <groupId>org.bouncycastle</groupId>
                <artifactId>bcpkix-jdk15on</artifactId>
                <version>${bouncycastle.version}</version>
            </dependency>
            <dependency>
                <groupId>org.glassfish</groupId>
                <artifactId>jakarta.el</artifactId>
                <version>${jakarta.el.version}</version>
            </dependency>
            <dependency>
                <groupId>ch.qos.logback</groupId>
                <artifactId>logback-classic</artifactId>
                <version>${logback.version}</version>
            </dependency>
            <dependency>
                <groupId>ch.qos.logback</groupId>
                <artifactId>logback-core</artifactId>
                <version>${logback.version}</version>
            </dependency>
            <dependency>
                <groupId>com.alibaba.nacos</groupId>
                <artifactId>nacos-client</artifactId>
                <version>${nacos-client.version}</version>
            </dependency>
            <!-- End of vulnerabilities fixing -->

            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>${spring-cloud.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>${spring-boot.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>com.alibaba.cloud</groupId>
                <artifactId>spring-cloud-alibaba-dependencies</artifactId>
                <version>${spring-cloud.alibaba.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-openfeign-dependencies</artifactId>
                <version>${openfeign-dependencies.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>com.nimbusds</groupId>
                <artifactId>nimbus-jose-jwt</artifactId>
                <version>${nimbus.version}</version>
            </dependency>

            <dependency>
                <groupId>org.java-websocket</groupId>
                <artifactId>Java-WebSocket</artifactId>
                <version>${java.websocket.version}</version>
            </dependency>

            <!--监控服务端-->
            <dependency>
                <groupId>de.codecentric</groupId>
                <artifactId>spring-boot-admin-starter-server</artifactId>
                <version>${spring-boot-admin.version}</version>
            </dependency>

            <!--配置文件加解密-->
            <dependency>
                <groupId>com.github.ulisesbocchio</groupId>
                <artifactId>jasypt-spring-boot-starter</artifactId>
                <version>${jasypt.version}</version>
            </dependency>

            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-amqp</artifactId>
                <version>${spring-boot.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-websocket</artifactId>
                <version>${spring-boot.version}</version>
            </dependency>

            <dependency>
                <groupId>com.alicp.jetcache</groupId>
                <artifactId>jetcache-starter-redis-lettuce</artifactId>
                <version>${jetcache.version}</version>
            </dependency>
            <dependency>
                <groupId>com.alibaba</groupId>
                <artifactId>fastjson</artifactId>
                <version>${fastjson.version}</version>
            </dependency>

            <dependency>
                <groupId>mysql</groupId>
                <artifactId>mysql-connector-java</artifactId>
                <version>${mysql-connector.version}</version>
            </dependency>
            <dependency>
                <groupId>com.baomidou</groupId>
                <artifactId>mybatis-plus-boot-starter</artifactId>
                <version>${mybatis-plus.version}</version>
            </dependency>
            <dependency>
                <groupId>com.baomidou</groupId>
                <artifactId>mybatis-plus-annotation</artifactId>
                <version>${mybatis-plus.version}</version>
            </dependency>
            <dependency>
                <groupId>com.baomidou</groupId>
                <artifactId>mybatis-plus-extension</artifactId>
                <version>${mybatis-plus.version}</version>
            </dependency>
            <dependency>
                <groupId>com.baomidou</groupId>
                <artifactId>mybatis-plus-generator</artifactId>
                <version>${mybatis-plus-generator.version}</version>
            </dependency>
            <dependency>
                <groupId>org.freemarker</groupId>
                <artifactId>freemarker</artifactId>
                <version>${freemarker.version}</version>
            </dependency>

            <dependency>
                <groupId>org.projectlombok</groupId>
                <artifactId>lombok</artifactId>
                <version>${lombok.version}</version>
            </dependency>
            <dependency>
                <groupId>cn.hutool</groupId>
                <artifactId>hutool-all</artifactId>
                <version>${hutool.version}</version>
            </dependency>

            <dependency>
                <groupId>io.springfox</groupId>
                <artifactId>springfox-boot-starter</artifactId>
                <version>${swagger.version}</version>
            </dependency>

            <dependency>
                <groupId>org.codehaus.groovy</groupId>
                <artifactId>groovy</artifactId>
                <version>${groovy.version}</version>
            </dependency>
            <dependency>
                <groupId>org.codehaus.groovy</groupId>
                <artifactId>groovy-xml</artifactId>
                <version>${groovy.version}</version>
            </dependency>
            <dependency>
                <groupId>com.squareup.okhttp3</groupId>
                <artifactId>okhttp</artifactId>
                <version>${okhttp.version}</version>
            </dependency>
            <dependency>
                <groupId>com.pszymczyk.consul</groupId>
                <artifactId>embedded-consul</artifactId>
                <version>${embedded-consul.verion}</version>
            </dependency>

            <dependency>
                <groupId>com.google.code.findbugs</groupId>
                <artifactId>annotations</artifactId>
                <version>${finbugs.version}</version>
            </dependency>
            <dependency>
                <groupId>com.google.code.findbugs</groupId>
                <artifactId>jsr305</artifactId>
                <version>${finbugs.version}</version>
            </dependency>
            <dependency>
                <groupId>com.networknt</groupId>
                <artifactId>json-schema-validator</artifactId>
                <version>${json-schema-validator.version}</version>
            </dependency>

            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-api</artifactId>
                <version>${log4j2.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-to-slf4j</artifactId>
                <version>${log4j2.version}</version>
            </dependency>

            <dependency>
                <groupId>org.bytedeco</groupId>
                <artifactId>javacv</artifactId>
                <version>${javacv.version}</version>
            </dependency>
            <dependency>
                <groupId>org.bytedeco</groupId>
                <artifactId>ffmpeg-platform</artifactId>
                <version>${ffmpeg-platform.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.poi</groupId>
                <artifactId>poi</artifactId>
                <version>${poi.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.poi</groupId>
                <artifactId>poi-ooxml</artifactId>
                <version>${poi.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
        </dependency>
        <dependency>
            <groupId>cn.hutool</groupId>
            <artifactId>hutool-all</artifactId>
        </dependency>

        <dependency>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>annotations</artifactId>
        </dependency>
        <dependency>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>jsr305</artifactId>
        </dependency>
    </dependencies>

    <build>
        <sourceDirectory>src/main/java</sourceDirectory>
        <plugins>
            <plugin>
                <groupId>org.commonjava.maven.plugins</groupId>
                <artifactId>directory-maven-plugin</artifactId> <!-- 用来生成顶级模块的绝对路径properties,提供其他插件使用-->
                <version>${directory-maven-plugin.version}</version>
                <executions>
                    <execution>
                        <id>directories</id>
                        <goals>
                            <goal>highest-basedir</goal> <!-- 顶级模块的绝对路径-->
                        </goals>
                        <phase>validate</phase>
                        <configuration>
                            <property>top.my.basedir</property> <!-- 顶级模块的绝对路径properties-->
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId> <!--checkstyle检查-->
                <version>${maven-checkstyle-plugin.version}</version>
                <dependencies>
                    <dependency>
                        <groupId>com.puppycrawl.tools</groupId>
                        <artifactId>checkstyle</artifactId>
                        <version>${checkstyle.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>cn.yusiwen</groupId>
                        <artifactId>maven-build-helper</artifactId>
                        <version>${maven-build-helper.version}</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <id>checkstyle-validation</id>
                        <phase>compile</phase>
                        <configuration>
                            <violationSeverity>warn</violationSeverity>
                            <!--suppress UnresolvedMavenProperty -->
                            <configLocation>checkstyle.xml</configLocation> <!--checkstyle自定义规则-->
                            <includeTestSourceDirectory>false</includeTestSourceDirectory>
                            <encoding>UTF-8</encoding>
                            <consoleOutput>true</consoleOutput>
                            <failOnViolation>true</failOnViolation>
                            <failsOnError>true</failsOnError>
                            <excludes>**/enums/*Enum.java,**/Launcher.java,**/*Application.java</excludes>
                        </configuration>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-pmd-plugin</artifactId> <!--pmd检查-->
                <version>${maven-pmd-plugin.version}</version>
                <configuration>
                    <linkXRef>false</linkXRef>
                    <aggregate>true</aggregate>
                    <sourceEncoding>${project.build.sourceEncoding}</sourceEncoding>
                    <targetJdk>${java.version}</targetJdk>
                    <printFailingErrors>true</printFailingErrors>
                    <failurePriority>2</failurePriority> <!--报错优先级：共3级 -->
                    <rulesets>
                        <!--<ruleset>rulesets/java/ali-comment.xml</ruleset>-->
                        <!--由checkstyle检查-->
                        <ruleset>rulesets/java/ali-concurrent.xml</ruleset>
                        <!--<ruleset>rulesets/java/ali-constant.xml</ruleset>-->
                        <!--由checkstyle检查-->
                        <ruleset>rulesets/java/ali-exception.xml</ruleset>
                        <ruleset>rulesets/java/ali-flowcontrol.xml</ruleset>
                        <ruleset>rulesets/java/ali-naming.xml</ruleset>
                        <ruleset>rulesets/java/ali-oop.xml</ruleset>
                        <ruleset>rulesets/java/ali-orm.xml</ruleset>
                        <ruleset>rulesets/java/ali-other.xml</ruleset>
                        <ruleset>rulesets/java/ali-set.xml</ruleset>
                    </rulesets>
                </configuration>
                <executions>
                    <execution>
                        <phase>compile</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>com.alibaba.p3c</groupId>
                        <artifactId>p3c-pmd</artifactId>
                        <version>${p3c-pmd.version}</version>
                    </dependency>
                </dependencies>
            </plugin>
            <!-- findbugs插件 -->
            <plugin>
                <groupId>com.github.spotbugs</groupId>
                <artifactId>spotbugs-maven-plugin</artifactId> <!--findbugs检查-->
                <version>${spotbugs-maven-plugin.version}</version>
                <dependencies>
                    <dependency>
                        <groupId>cn.yusiwen</groupId>
                        <artifactId>maven-build-helper</artifactId>
                        <version>${maven-build-helper.version}</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <!-- 设置分析工作的等级，可以为Min、Default和Max -->
                    <effort>Max</effort>
                    <!-- Low、Medium和High (Low最严格) -->
                    <threshold>Medium</threshold>
                    <failOnError>true</failOnError> <!--发现错误则中断构建-->
                    <includeTests>false</includeTests> <!--不检查test代码 -->
                    <!--findbugs需要忽略的错误的配置文件-->
                    <!--suppress UnresolvedMavenProperty -->
                    <excludeFilterFile>findbugs-exclude-filter.xml</excludeFilterFile>
                </configuration>
                <executions>
                    <execution>
                        <id>run-findbugs</id>
                        <!-- validate 阶段触发执行findbugs检查，比如执行 mvn clean package -->
                        <phase>compile</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-maven-plugin</artifactId>
                    <version>${spring-boot.version}</version>
                    <configuration>
                        <!--suppress UnresolvedMavenProperty -->
                        <finalName>${jar.name}</finalName>
                        <fork>true</fork>
                    </configuration>
                    <executions>
                        <execution>
                            <goals>
                                <goal>repackage</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>${maven-clean-plugin.version}</version>
                </plugin>
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId> <!-- 编译插件 -->
                    <version>${maven-compiler-plugin.version}</version>
                    <configuration>
                        <source>${java.version}</source>
                        <target>${java.version}</target>
                        <encoding>UTF-8</encoding>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId> <!-- 资源管理插件 -->
                    <version>${maven-resources-plugin.version}</version>
                    <configuration>
                        <encoding>UTF-8</encoding>
                        <delimiters>
                            <delimiter>${*}</delimiter> <!-- 使用${*}作为变量分隔符 -->
                        </delimiters>
                        <useDefaultDelimiters>false</useDefaultDelimiters> <!--禁止使用默认： 默认delimiter包括 ${*}和@ -->
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${maven-javadoc-plugin.version}</version>
                    <executions>
                        <execution>
                            <id>attach-javadocs</id>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>${maven-source-plugin.version}</version>
                    <executions>
                        <execution>
                            <id>attach-sources</id>
                            <goals>
                                <goal>jar-no-fork</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>${maven-gpg-plugin.version}</version>
                    <executions>
                        <execution>
                            <id>sign-artifacts</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>sign</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>${maven-deploy-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>${maven-release-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>build-helper-maven-plugin</artifactId>
                    <version>${build-helper-maven-plugin.version}</version>
                    <executions>
                        <execution>
                            <id>timestamp-property</id>
                            <goals>
                                <goal>timestamp-property</goal>
                            </goals>
                            <configuration>
                                <name>current.time</name>
                                <pattern>yyyyMMdd</pattern>
                                <timeZone>GMT+8</timeZone>
                                <locale>zh_CN</locale>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <configuration>
                        <testFailureIgnore>true</testFailureIgnore>
                        <includes>
                            <include>**/*Test.java</include>
                        </includes>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>${jacoco.version}</version>
                    <configuration>
                        <excludes>
                            <exclude>**/po/**</exclude>
                            <exclude>*/dto/**</exclude>
                            <exclude>**/vo/**</exclude>
                            <exclude>**/feign/**</exclude>
                            <exclude>**/enums/**</exclude>
                            <exclude>**/config/**</exclude>
                            <exclude>**/utils/**</exclude>
                            <exclude>**/domain/**</exclude>
                        </excludes>
                        <destFile>${project.build.directory}/coverage-reports/jacoco-unit.exec</destFile>
                        <dataFile>${project.build.directory}/coverage-reports/jacoco-unit.exec</dataFile>
                        <!-- rules里面指定覆盖规则 -->
                        <rules>
                            <rule implementation="org.jacoco.maven.RuleConfiguration">
                                <element>BUNDLE</element>
                                <limits>
                                    <!-- 方法覆盖率到100% -->
                                    <limit implementation="org.jacoco.report.check.Limit">
                                        <counter>METHOD</counter>
                                        <value>MISSEDCOUNT</value>
                                        <maximum>0</maximum>
                                    </limit>
                                    <!-- 指令覆盖率到90% -->
                                    <limit implementation="org.jacoco.report.check.Limit">
                                        <counter>INSTRUCTION</counter>
                                        <value>COVEREDRATIO</value>
                                        <minimum>0.90</minimum>
                                    </limit>
                                    <!-- 行覆盖率到90% -->
                                    <limit implementation="org.jacoco.report.check.Limit">
                                        <counter>LINE</counter>
                                        <value>COVEREDRATIO</value>
                                        <minimum>0.90</minimum>
                                    </limit>
                                    <!-- 指定类覆盖到100%，不能遗失任何类 -->
                                    <limit implementation="org.jacoco.report.check.Limit">
                                        <counter>CLASS</counter>
                                        <value>MISSEDCOUNT</value>
                                        <maximum>0</maximum>
                                    </limit>
                                </limits>
                            </rule>
                        </rules>
                    </configuration>
                    <executions>
                        <execution>
                            <id>jacoco-initialize</id>
                            <goals>
                                <goal>prepare-agent</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>jacoco-site</id>
                            <phase>test</phase>
                            <goals>
                                <goal>report</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.flywaydb</groupId>
                    <artifactId>flyway-maven-plugin</artifactId>
                    <version>${flyway-maven-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <version>${antrun-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>io.fabric8</groupId>
                    <artifactId>docker-maven-plugin</artifactId>
                    <version>${docker-maven-plugin.version}</version>
                    <configuration>
                        <!--suppress UnresolvedMavenProperty -->
                        <skip>${docker.image.skip}</skip>
                        <images>
                            <image>
                                <!--suppress UnresolvedMavenProperty -->
                                <name>${docker.build.name}</name>
                                <build>
                                    <!--suppress UnresolvedMavenProperty -->
                                    <dockerFile>${docker.build.dockerfile}</dockerFile>
                                    <contextDir>${project.basedir}</contextDir>
                                </build>
                            </image>
                        </images>
                    </configuration>
                    <executions>
                        <execution>
                            <id>docker</id>
                            <phase>package</phase>
                            <goals>
                                <goal>build</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>registry</id>
                            <phase>deploy</phase>
                            <goals>
                                <goal>push</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

                <!-- Sonar -->
                <plugin>
                    <groupId>org.sonarsource.scanner.maven</groupId>
                    <artifactId>sonar-maven-plugin</artifactId>
                    <version>${sonar-maven-plugin.version}</version>
                </plugin>

                <!-- OWASP Vulnerabilities check -->
                <plugin>
                    <groupId>org.owasp</groupId>
                    <artifactId>dependency-check-maven</artifactId>
                    <version>${dependency-check-maven.version}</version>
                    <configuration>
                        <!-- Disable .net analyzer -->
                        <assemblyAnalyzerEnabled>false</assemblyAnalyzerEnabled>
                        <nugetconfAnalyzerEnabled>false</nugetconfAnalyzerEnabled>
                        <nuspecAnalyzerEnabled>false</nuspecAnalyzerEnabled>
                        <!-- Disable node analyzer -->
                        <nodeAnalyzerEnabled>false</nodeAnalyzerEnabled>
                        <nodeAuditAnalyzerEnabled>false</nodeAuditAnalyzerEnabled>
                        <!-- Disable python analyzer -->
                        <pyDistributionAnalyzerEnabled>false</pyDistributionAnalyzerEnabled>
                        <pyPackageAnalyzerEnabled>false</pyPackageAnalyzerEnabled>
                        <pipAnalyzerEnabled>false</pipAnalyzerEnabled>
                        <pipfileAnalyzerEnabled>false</pipfileAnalyzerEnabled>
                        <!-- Disable ruby analyzer -->
                        <rubygemsAnalyzerEnabled>false</rubygemsAnalyzerEnabled>
                        <cmakeAnalyzerEnabled>false</cmakeAnalyzerEnabled>
                        <autoconfAnalyzerEnabled>false</autoconfAnalyzerEnabled>
                        <composerAnalyzerEnabled>false</composerAnalyzerEnabled>
                        <cpanfileAnalyzerEnabled>false</cpanfileAnalyzerEnabled>
                        <yarnAuditAnalyzerEnabled>false</yarnAuditAnalyzerEnabled>
                        <pnpmAuditAnalyzerEnabled>false</pnpmAuditAnalyzerEnabled>
                    </configuration>
                </plugin>

                <!--  Formatter -->
                <plugin>
                    <groupId>net.revelc.code.formatter</groupId>
                    <artifactId>formatter-maven-plugin</artifactId>
                    <version>${formatter.plugin}</version>
                    <dependencies>
                        <dependency>
                            <groupId>cn.yusiwen</groupId>
                            <artifactId>maven-build-helper</artifactId>
                            <version>${maven-build-helper.version}</version>
                        </dependency>
                    </dependencies>
                    <configuration>
                        <!--suppress UnresolvedMavenProperty -->
                        <configFile>formatter.xml</configFile>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>net.revelc.code</groupId>
                    <artifactId>impsort-maven-plugin</artifactId>
                    <version>${impsort.plugin}</version>
                    <configuration>
                        <groups>com,java,javax,lombok,mockit,net,org</groups>
                        <staticGroups>java,*</staticGroups>
                        <removeUnused>true</removeUnused>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>cn.yusiwen</groupId>
                    <artifactId>whitespace-maven-plugin</artifactId>
                    <version>${whitespace.plugin}</version>
                </plugin>
                <plugin>
                    <groupId>au.com.acegi</groupId>
                    <artifactId>xml-format-maven-plugin</artifactId>
                    <version>${xml-format.plugin}</version>
                    <configuration>
                        <indentSize>4</indentSize>
                        <lineLength>120</lineLength>
                        <skip>true</skip> <!-- TODO: Skip this for now until some adjustments are made -->
                    </configuration>
                </plugin>

                <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
                <plugin>
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>org.codehaus.mojo</groupId>
                                        <artifactId>build-helper-maven-plugin</artifactId>
                                        <versionRange>[1.9.1,)</versionRange>
                                        <goals>
                                            <goal>validate</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                </pluginExecution>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>org.commonjava.maven.plugins</groupId>
                                        <artifactId>directory-maven-plugin</artifactId>
                                        <versionRange>[0.3.1,)</versionRange>
                                        <goals>
                                            <goal>validate</goal>
                                            <goal>highest-basedir</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore />
                                    </action>
                                </pluginExecution>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>com.github.spotbugs</groupId>
                                        <artifactId>spotbugs-maven-plugin</artifactId>
                                        <versionRange>[4.3.0,)</versionRange>
                                        <goals>
                                            <goal>check</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore />
                                    </action>
                                </pluginExecution>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>cn.yusiwen</groupId>
                                        <artifactId>whitespace-maven-plugin</artifactId>
                                        <versionRange>[1.0.5,)</versionRange>
                                        <goals>
                                            <goal>trim</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore />
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <profiles>
        <profile>
            <id>jar</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                <docker.image.skip>true</docker.image.skip>
            </properties>
        </profile>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>docker</id>
            <properties>
                <docker.image.skip>false</docker.image.skip>
            </properties>
        </profile>
        <profile>
            <id>format</id>
            <activation>
                <file>
                    <exists>.format</exists>
                </file>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>net.revelc.code.formatter</groupId>
                        <artifactId>formatter-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>format</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>net.revelc.code</groupId>
                        <artifactId>impsort-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>sort</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>cn.yusiwen</groupId>
                        <artifactId>whitespace-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <phase>process-sources</phase>
                                <goals>
                                    <goal>trim</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>au.com.acegi</groupId>
                        <artifactId>xml-format-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>xml-format</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>jdk11</id>
            <activation>
                <jdk>11</jdk>
            </activation>
            <properties>
                <!-- JAXB -->
                <javax.activation.version>1.2.0</javax.activation.version>
                <jaxb.api.version>2.3.0</jaxb.api.version>
                <lombok.version>1.18.6</lombok.version>
            </properties>
            <dependencies>
                <dependency>
                    <groupId>com.sun.activation</groupId>
                    <artifactId>javax.activation</artifactId>
                    <version>${javax.activation.version}</version>
                </dependency>
                <dependency>
                    <groupId>javax.xml.bind</groupId>
                    <artifactId>jaxb-api</artifactId>
                    <version>${jaxb.api.version}</version>
                </dependency>
                <dependency>
                    <groupId>com.sun.xml.bind</groupId>
                    <artifactId>jaxb-core</artifactId>
                    <version>${jaxb.api.version}</version>
                </dependency>
                <dependency>
                    <groupId>com.sun.xml.bind</groupId>
                    <artifactId>jaxb-impl</artifactId>
                    <version>${jaxb.api.version}</version>
                </dependency>
            </dependencies>
        </profile>
    </profiles>
</project>
