<?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>top.csaf</groupId>
  <artifactId>ZUtil</artifactId>
  <version>1.12.1</version>

  <name>ZUtil</name>
  <url>https://github.com/duanluan/ZUtil</url>
  <description>Java Util</description>
  <licenses>
    <license>
      <name>Apache License 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
    </license>
  </licenses>

  <!-- Software Configuration Management -->
  <scm>
    <url>https://github.com/duanluan/ZUtil</url>
    <connection>scm:git:https://github.com/duanluan/ZUtil.git</connection>
    <developerConnection>scm:git:https://github.com/duanluan/ZUtil.git</developerConnection>
  </scm>

  <!-- 开发者信息 -->
  <developers>
    <developer>
      <name>duanluan</name>
      <email>duanluan@outlook.com</email>
      <organization>计算机科学与艺术基金会（CSAF）</organization>
      <organizationUrl>https://github.com/csa-f</organizationUrl>
      <timezone>+8</timezone>
    </developer>
  </developers>

  <properties>
    <java.version>1.8</java.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.projectlombok</groupId>
      <artifactId>lombok</artifactId>
      <version>1.18.22</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>1.7.36</version>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-simple</artifactId>
      <version>1.7.36</version>
    </dependency>

    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
      <version>3.12.0</version>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-text</artifactId>
      <version>1.10.0</version>
      <exclusions>
        <exclusion>
          <groupId>org.apache.commons</groupId>
          <artifactId>commons-lang3</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-collections4</artifactId>
      <version>4.4</version>
    </dependency>
    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <version>2.11.0</version>
    </dependency>
    <dependency>
      <groupId>commons-beanutils</groupId>
      <artifactId>commons-beanutils</artifactId>
      <version>1.9.4</version>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-beans</artifactId>
      <version>5.3.21</version>
    </dependency>
    <!-- 加密算法 -->
    <dependency>
      <groupId>org.bouncycastle</groupId>
      <artifactId>bcprov-jdk15on</artifactId>
      <version>1.70</version>
    </dependency>
    <!-- HTTP、WebSocket、Stomp 请求 -->
    <dependency>
      <groupId>com.ejlchina</groupId>
      <artifactId>okhttps-jackson</artifactId>
      <version>3.5.3</version>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-core</artifactId>
      <version>2.13.2</version>
    </dependency>
    <dependency>
      <groupId>com.alibaba.fastjson2</groupId>
      <artifactId>fastjson2</artifactId>
      <version>2.0.4</version>
    </dependency>
    <dependency>
      <groupId>com.google.code.gson</groupId>
      <artifactId>gson</artifactId>
      <version>2.9.0</version>
    </dependency>
    <!-- XML -->
    <dependency>
      <groupId>org.dom4j</groupId>
      <artifactId>dom4j</artifactId>
      <version>2.1.3</version>
    </dependency>
    <!-- YAML -->
    <dependency>
      <groupId>org.yaml</groupId>
      <artifactId>snakeyaml</artifactId>
      <version>2.0</version>
    </dependency>


    <!-- JUnit：https://junit.org/junit5/docs/current/api/index.html -->
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
      <version>5.8.2</version>
      <scope>test</scope>
    </dependency>
    <!-- JUnit 测试套件 -->
    <dependency>
      <groupId>org.junit.platform</groupId>
      <artifactId>junit-platform-suite</artifactId>
      <version>1.8.2</version>
      <scope>test</scope>
    </dependency>
    <!-- Spring Test，此处主要用于调用 private 方法用于覆盖率测试 -->
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-test</artifactId>
      <version>5.3.19</version>
      <scope>test</scope>
    </dependency>
    <!-- JMH -->
    <dependency>
      <groupId>org.openjdk.jmh</groupId>
      <artifactId>jmh-core</artifactId>
      <version>1.34</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.openjdk.jmh</groupId>
      <artifactId>jmh-generator-annprocess</artifactId>
      <version>1.34</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>cn.hutool</groupId>
      <artifactId>hutool-all</artifactId>
      <version>5.8.11</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.github.biezhi</groupId>
      <artifactId>TinyPinyin</artifactId>
      <version>2.0.3.RELEASE</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jsoup</groupId>
      <artifactId>jsoup</artifactId>
      <version>1.15.3</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.esotericsoftware</groupId>
      <artifactId>kryo</artifactId>
      <version>5.5.0</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.wicketstuff</groupId>
      <artifactId>wicketstuff-serializer-fast2</artifactId>
      <version>9.13.0</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.caucho</groupId>
      <artifactId>hessian</artifactId>
      <version>4.0.66</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.protostuff</groupId>
      <artifactId>protostuff-core</artifactId>
      <version>1.8.0</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.protostuff</groupId>
      <artifactId>protostuff-runtime</artifactId>
      <version>1.8.0</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.dyuproject.protostuff</groupId>
      <artifactId>protostuff-core</artifactId>
      <version>1.3.0</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.dyuproject.protostuff</groupId>
      <artifactId>protostuff-runtime</artifactId>
      <version>1.3.0</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.objenesis</groupId>
      <artifactId>objenesis</artifactId>
      <version>3.3</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <pluginManagement>
      <plugins>
        <!-- Apache Maven Compiler Plugin：配置 compiler:compile、compiler:testCompile https://maven.apache.org/plugins/maven-compiler-plugin/index.html -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.10.1</version>
          <!-- compiler:compile https://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html -->
          <configuration>
            <!-- Setting the -source and -target of the Java Compiler https://maven.apache.org/plugins/maven-compiler-plugin/examples/set-compiler-source-and-target.html -->
            <!-- Java 编译器的 -source 参数 https://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#source -->
            <source>${java.version}</source>
            <!-- Java 编译器的 -target 参数 https://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#target -->
            <target>${java.version}</target>
            <!-- 显示编译警告 https://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#showWarnings -->
            <showWarnings>true</showWarnings>
          </configuration>
        </plugin>
        <!-- Apache Maven Surefire Plugin：配置 test 生命周期阶段 https://maven.apache.org/surefire/maven-surefire-plugin/ -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.22.2</version>
          <!-- surefire:test https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html -->
          <configuration>
            <!-- 忽略测试失败 https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#testFailureIgnore -->
            <testFailureIgnore>true</testFailureIgnore>
            <!-- 需排除的测试 https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#excludes -->
            <excludes>
              <!-- JMH 性能测试 -->
              <exclude>**/jmh/**</exclude>
            </excludes>
            <argLine>${jacocoArgLine}</argLine>
          </configuration>
        </plugin>

        <!-- Javadoc and Sources Attachments - The Central Repository Documentation https://central.sonatype.org/publish/publish-maven/#javadoc-and-sources-attachments -->
        <!-- Apache Maven Source Plugin：创建源码 jar https://maven.apache.org/plugins/maven-source-plugin/ -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>3.2.1</version>
          <executions>
            <execution>
              <id>attach-sources</id>
              <goals>
                <!-- 默认生命周期阶段为 package。其他插件绑定到它的生命周期阶段时，用 jar 会重复打包，jar-no-fork 可以避免 https://stackoverflow.com/a/10568004 -->
                <!-- https://maven.apache.org/plugins/maven-source-plugin/jar-no-fork-mojo.html -->
                <goal>jar-no-fork</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <!-- Maven Javadoc Plugin：生成 Javadoc https://maven.apache.org/plugins/maven-javadoc-plugin/ -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>3.4.1</version>
          <executions>
            <execution>
              <id>attach-javadocs</id>
              <goals>
                <!-- 默认生命周期阶段为 package。用于创建 Javadoc jar https://maven.apache.org/plugins/maven-javadoc-plugin/jar-mojo.html -->
                <goal>jar</goal>
              </goals>
            </execution>
          </executions>
        </plugin>

        <!-- GPG Signed Components - The Central Repository Documentation https://central.sonatype.org/publish/publish-maven/#gpg-signed-components -->
        <!-- Apache Maven GPG Plugin：使用 GPG 对项目 Artifacts（发行版文件）进行签名 https://maven.apache.org/plugins/maven-gpg-plugin/ -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-gpg-plugin</artifactId>
          <version>1.6</version>
          <executions>
            <execution>
              <id>sign-artifacts</id>
              <goals>
                <!-- 签名项目 Artifact、POM、附加 artifacts（源码、Javadoc、本地 jar 等） https://maven.apache.org/plugins/maven-gpg-plugin/sign-mojo.html -->
                <goal>sign</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <!-- Nexus Staging Maven Plugin for Deployment and Release - The Central Repository Documentation https://central.sonatype.org/publish/publish-maven/#nexus-staging-maven-plugin-for-deployment-and-release -->
        <!-- Nexus Staging Maven Plugin：Nexus 流程 https://github.com/sonatype/nexus-maven-plugins/tree/main/staging/maven-plugin -->
        <plugin>
          <groupId>org.sonatype.plugins</groupId>
          <artifactId>nexus-staging-maven-plugin</artifactId>
          <version>1.6.13</version>
          <extensions>true</extensions>
          <configuration>
            <!-- Maven setting.xml 中 <server> 的 ID，用于获取身份验证信息 https://github.com/sonatype/nexus-maven-plugins/tree/main/staging/maven-plugin#configuring-the-plugin -->
            <serverId>ossrh</serverId>
            <!-- 目标 Nexus URL -->
            <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
            <!-- deploy、close、rc-close 执行成功后自动 release -->
            <autoReleaseAfterClose>true</autoReleaseAfterClose>
          </configuration>
        </plugin>

        <!--
          JaCoCo https://www.eclemma.org/jacoco/trunk/doc/maven.html
          如果想在覆盖率报告中显示行号，或者突出显示源代码，必须 debug 编译
          使用 maven-surefire-plugin 或 maven-fails-plugin 时，不能将 forkCount 设置为 0 或将 forkMode 设置为 never，因为这将阻止运行测试的 -javaagent 参数，导致无法记录覆盖率
        -->
        <plugin>
          <groupId>org.jacoco</groupId>
          <artifactId>jacoco-maven-plugin</artifactId>
          <version>0.8.8</version>
          <configuration>
            <!-- 指定包含 JaCoCo 代理的属性名 https://www.eclemma.org/jacoco/trunk/doc/prepare-agent-mojo.html#propertyName -->
            <!-- 使用 maven-surefire-plugin 时会覆盖 VM 参数，所以需要取名并配置到 maven-surefire-plugin 的 argLine 中 -->
            <propertyName>jacocoArgLine</propertyName>
          </configuration>
          <executions>
            <execution>
              <id>jacoco-initialize</id>
              <goals>
                <!-- 默认生命周期阶段为 initialize。此代理通过 VM 参数传递给测试程序，在执行阶段收集覆盖率信息，在结束时写入文件。https://www.eclemma.org/jacoco/trunk/doc/prepare-agent-mojo.html -->
                <goal>prepare-agent</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-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-javadoc-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.sonatype.plugins</groupId>
        <artifactId>nexus-staging-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-gpg-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
      </plugin>
    </plugins>
  </build>

  <!-- id 和 settings.xml 中设置用户名、密码的保持一致 -->
  <distributionManagement>
    <snapshotRepository>
      <id>ossrh</id>
      <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
    <repository>
      <id>ossrh</id>
      <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
  </distributionManagement>

  <repositories>
    <repository>
      <id>huaweicloud</id>
      <url>https://repo.huaweicloud.com/repository/maven/</url>
    </repository>
    <repository>
      <id>aliyunmaven</id>
      <url>https://maven.aliyun.com/repository/public</url>
    </repository>
    <repository>
      <id>maven_central</id>
      <name>Maven Central</name>
      <url>https://repo.maven.apache.org/maven2/</url>
    </repository>
    <!-- jitpack -->
    <repository>
      <id>jitpack.io</id>
      <url>https://jitpack.io</url>
    </repository>
  </repositories>
  <pluginRepositories>
    <pluginRepository>
      <id>huaweicloud</id>
      <url>https://repo.huaweicloud.com/repository/maven/</url>
    </pluginRepository>
    <pluginRepository>
      <id>aliyunmaven</id>
      <url>https://maven.aliyun.com/repository/public</url>
    </pluginRepository>
    <pluginRepository>
      <id>maven_central</id>
      <url>https://repo.maven.apache.org/maven2/</url>
    </pluginRepository>
  </pluginRepositories>
</project>
