<?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>wang.52jing</groupId>
    <artifactId>wangboot-utils</artifactId>
    <version>0.4.0</version>

    <name>wangboot-utils</name>
    <description>wangboot 工具包</description>

    <packaging>pom</packaging>

    <properties>
        <!-- 版本 -->
        <java.version>1.8</java.version>
        <maven.compiler.source>8</maven.compiler.source>
        <maven.compiler.target>8</maven.compiler.target>
        <!-- 依赖版本 -->
        <spring.version>5.3.31</spring.version>
        <spring.boot.version>2.7.18</spring.boot.version>
        <hutool.bom.version>5.8.28</hutool.bom.version>
        <thumbnailator.version>0.4.20</thumbnailator.version>
        <bcprov.version>1.76</bcprov.version>
        <commons.lang3.version>3.14.0</commons.lang3.version>
        <mybatis.flex.version>1.9.2</mybatis.flex.version>
        <druid.version>1.2.23</druid.version>
        <logback.encoder.version>7.3</logback.encoder.version>
        <easy.excel.version>3.3.4</easy.excel.version>
        <!-- Maven插件版本 -->
        <maven.plugin.version>3.8.1</maven.plugin.version>
        <source.plugin.version>2.2.1</source.plugin.version>
        <javadoc.plugin.version>2.9.1</javadoc.plugin.version>
        <gpg.plugin.version>1.5</gpg.plugin.version>
        <publishing.plugin.version>0.4.0</publishing.plugin.version>
        <surefire.plugin.version>3.2.5</surefire.plugin.version>
        <versions.plugin.version>2.16.1</versions.plugin.version>
        <flatten.plugin.version>1.6.0</flatten.plugin.version>
        <spotless.plugin.version>2.29.0</spotless.plugin.version>
        <jacoco.plugin.version>0.8.11</jacoco.plugin.version>
    </properties>


    <url>https://github.com/52jing/wangboot-utils</url>

    <issueManagement>
        <system>GitHub Issues</system>
        <url>https://github.com/52jing/wangboot-utils/issues</url>
    </issueManagement>
    <scm>
        <connection>scm:git:https://github.com/52jing/wangboot-utils.git</connection>
        <developerConnection>scm:git:git@github.com:52jing/wangboot-utils.git</developerConnection>
        <url>https://github.com/52jing/wangboot-utils</url>
    </scm>
    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>
    <developers>
        <developer>
            <id>wwtg99</id>
            <name>wwtg99</name>
            <email>wwtg99@126.com</email>
            <organizationUrl>https://github.com/52jing</organizationUrl>
            <roles>
                <role>owner</role>
                <role>developer</role>
            </roles>
        </developer>
    </developers>

    <modules>
        <module>wb-bom</module>
        <module>wb-core-auth</module>
        <module>wb-core-cache</module>
        <module>wb-core-captcha</module>
        <module>wb-core-crypto</module>
        <module>wb-core-errorcode</module>
        <module>wb-core-event</module>
        <module>wb-core-image</module>
        <module>wb-core-reliability</module>
        <module>wb-test-report</module>
        <module>wb-core-test</module>
        <module>wb-core-utils</module>
        <module>wb-core-web</module>
        <module>wb-model-attachment</module>
        <module>wb-model-dataauthority</module>
        <module>wb-model-entity</module>
        <module>wb-model-flex</module>
        <module>wb-spring-boot-starter</module>
    </modules>

    <!-- 全局依赖 -->
    <dependencies>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <dependencyManagement>
        <dependencies>
            <!-- Spring依赖 -->
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-framework-bom</artifactId>
                <version>${spring.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <!-- SpringBoot依赖 -->
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>${spring.boot.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <!-- hutool工具类 -->
            <dependency>
                <groupId>cn.hutool</groupId>
                <artifactId>hutool-bom</artifactId>
                <version>${hutool.bom.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <!-- 缩略图 -->
            <dependency>
                <groupId>net.coobird</groupId>
                <artifactId>thumbnailator</artifactId>
                <version>${thumbnailator.version}</version>
            </dependency>
            <!-- AES PKCS7Padding 模式 -->
            <dependency>
                <groupId>org.bouncycastle</groupId>
                <artifactId>bcprov-jdk15to18</artifactId>
                <version>${bcprov.version}</version>
            </dependency>
            <!-- lang3工具类 -->
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-lang3</artifactId>
                <version>${commons.lang3.version}</version>
            </dependency>
            <!-- Mybatis-Flex -->
            <dependency>
                <groupId>com.mybatis-flex</groupId>
                <artifactId>mybatis-flex-spring-boot-starter</artifactId>
                <version>${mybatis.flex.version}</version>
            </dependency>
            <!-- 代码生成 -->
            <dependency>
                <groupId>com.mybatis-flex</groupId>
                <artifactId>mybatis-flex-codegen</artifactId>
                <version>${mybatis.flex.version}</version>
            </dependency>
            <dependency>
                <groupId>com.alibaba</groupId>
                <artifactId>easyexcel</artifactId>
                <version>${easy.excel.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <finalName>${project.name}</finalName>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
            </resource>
            <resource>
                <directory>src/main/java</directory>
                <includes>
                    <include>**/*.xml</include>
                </includes>
            </resource>
        </resources>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-maven-plugin</artifactId>
                    <version>${spring.boot.version}</version>
                    <configuration>
                        <finalName>${project.build.finalName}</finalName>
                    </configuration>
                    <executions>
                        <execution>
                            <goals>
                                <goal>repackage</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>${jacoco.plugin.version}</version>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven.plugin.version}</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                    <encoding>UTF-8</encoding>
                    <compilerArgs>
                        <arg>-parameters</arg>
                    </compilerArgs>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${surefire.plugin.version}</version>
                <configuration>
                    <reuseForks>false</reuseForks>
                    <forkCount>1</forkCount>
                    <skip>false</skip>
                    <testFailureIgnore>true</testFailureIgnore>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>${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-javadoc-plugin</artifactId>
                <version>${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-gpg-plugin</artifactId>
                <version>${gpg.plugin.version}</version>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!-- 发布插件 -->
            <plugin>
                <groupId>org.sonatype.central</groupId>
                <artifactId>central-publishing-maven-plugin</artifactId>
                <version>${publishing.plugin.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <publishingServerId>central</publishingServerId>
                    <tokenAuth>true</tokenAuth>
                </configuration>
            </plugin>
            <!-- 父子模块版本控制 -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>versions-maven-plugin</artifactId>
                <version>${versions.plugin.version}</version>
                <configuration>
                    <generateBackupPoms>false</generateBackupPoms>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.diffplug.spotless</groupId>
                <artifactId>spotless-maven-plugin</artifactId>
                <version>${spotless.plugin.version}</version>
                <configuration>
                    <java>
                        <removeUnusedImports />
                        <googleJavaFormat>
                            <version>1.7</version>
                            <style>GOOGLE</style>
                        </googleJavaFormat>
                    </java>
                </configuration>
                <executions>
                    <execution>
                        <id>spotless-apply</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>apply</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!-- Jacoco -->
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <configuration>
                    <excludes>
                        <exclude>**/*Test.class</exclude>
                        <exclude>**/*Configuration.class</exclude>
                        <exclude>**/*Properties.class</exclude>
                    </excludes>
                </configuration>
                <executions>
                    <execution>
                        <id>jacoco-prepare-agent</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>jacoco-report</id>
                        <phase>test</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                        <configuration>
                            <!--定义输出的文件夹-->
                            <outputDirectory>target/test-report</outputDirectory>
                            <footer>WangBoot</footer>
                        </configuration>
                    </execution>
                    <execution>
                        <id>jacoco-check</id>
                        <goals>
                            <goal>check</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <rule>
                                    <element>BUNDLE</element>
                                    <excludes>
                                        <exclude>**/*Test.class</exclude>
                                        <exclude>**/*Configuration.class</exclude>
                                        <exclude>**/*Properties.class</exclude>
                                    </excludes>
                                    <limits>
                                        <limit>
                                            <counter>LINE</counter>
                                            <value>COVEREDRATIO</value>
                                            <minimum>0.0</minimum>
                                        </limit>
                                        <limit>
                                            <counter>CLASS</counter>
                                            <value>COVEREDRATIO</value>
                                            <minimum>0.0</minimum>
                                        </limit>
                                    </limits>
                                </rule>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>