<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>cn.com.xuxiaowei.utils</groupId>
    <artifactId>unit</artifactId>
    <version>0.0.2</version>
    <name>unit</name>
    <description>单位</description>
    <url>https://github.com/xuxiaowei-com-cn/unit</url>
    <inceptionYear>2024</inceptionYear>
    <properties>
        <java.version>1.8</java.version>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>

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

        <!-- https://mvnrepository.com/artifact/org.assertj/assertj-core -->
        <assertj.version>3.25.3</assertj.version>

        <!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api -->
        <junit.version>5.10.2</junit.version>

        <!-- https://mvnrepository.com/artifact/pl.project13.maven/git-commit-id-plugin -->
        <git-commit-id-plugin.version>4.9.10</git-commit-id-plugin.version>

        <!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-gpg-plugin -->
        <maven-gpg-plugin.version>3.1.0</maven-gpg-plugin.version>

        <skipTests>true</skipTests>

    </properties>

    <dependencies>

        <!-- https://mvnrepository.com/artifact/org.assertj/assertj-core -->
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <version>${assertj.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <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>

    <licenses>
        <license>
            <name>Apache 2</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
            <comments>A business-friendly OSS license</comments>
        </license>
        <license>
            <name>996.ICU</name>
            <url>https://github.com/996icu/996.ICU/blob/master/LICENSE</url>
            <distribution>repo</distribution>
            <comments>The name 996.ICU refers to "Work by '996', sick in ICU", an ironic saying among Chinese
                developers, which means that by following the "996" work schedule, you are risking yourself getting into
                the ICU (Intensive Care Unit).
            </comments>
        </license>
    </licenses>

    <scm>
        <url>https://github.com/xuxiaowei-com-cn/unit</url>
        <connection>scm:git:https://git@github.com/xuxiaowei-com-cn/unit.git</connection>
    </scm>

    <issueManagement>
        <system>Github</system>
        <url>https://github.com/xuxiaowei-com-cn/unit/issues</url>
    </issueManagement>

    <organization>
        <name>徐晓伟工作室</name>
        <url>http://xuxiaowei.com.cn</url>
    </organization>

    <developers>
        <developer>
            <name>徐晓伟</name>
            <email>xuxiaowei@xuxiaowei.com.cn</email>
            <organization>徐晓伟工作室</organization>
            <organizationUrl>http://xuxiaowei.com.cn</organizationUrl>
        </developer>
    </developers>

    <build>
        <plugins>

            <!-- https://mvnrepository.com/artifact/pl.project13.maven/git-commit-id-plugin -->
            <plugin>
                <groupId>pl.project13.maven</groupId>
                <artifactId>git-commit-id-plugin</artifactId>
                <version>${git-commit-id-plugin.version}</version>
                <executions>
                    <execution>
                        <id>get-the-git-infos</id>
                        <goals>
                            <!-- 父子项目必须添加 -->
                            <goal>revision</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <!-- 父子项目必须添加 -->
                    <generateGitPropertiesFile>true</generateGitPropertiesFile>
                    <offline>true</offline>
                    <!-- 输出详细内容 -->
                    <!--<verbose>true</verbose>-->
                    <dateFormatTimeZone>${user.timezone}</dateFormatTimeZone>
                    <dateFormat>yyyy-MM-dd HH:mm:ss</dateFormat>
                    <format>json</format>
                    <generateGitPropertiesFilename>${project.build.outputDirectory}/git.json
                    </generateGitPropertiesFilename>
                </configuration>
            </plugin>

        </plugins>
    </build>

    <profiles>

        <profile>
            <!-- 使用 -Pgpg 激活此构建进行文件签名 -->
            <id>gpg</id>
            <build>
                <plugins>
                    <!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-gpg-plugin -->
                    <!-- 安装：https://www.gpg4win.org/thanks-for-download.html -->
                    <!--
                        1、新建密钥对
                        2、生成密钥对副本
                        3、上传公钥至目录服务器（手动上传（需要验证邮箱）：https://keys.openpgp.org/upload/）
                     -->
                    <!--
                        单个文件签名：
                        gpg &#45;&#45;armor &#45;&#45;detach-sign 文件名
                     -->
                    <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>
                </plugins>
            </build>
        </profile>

    </profiles>

</project>
