utools
Used in:
components
- OverviewOverview
- VersionsVersions
- DependentsDependents
- DependenciesDependencies
<dependency> <groupId>io.github.shallwecodex</groupId> <artifactId>utools</artifactId> <version>1.0.2</version> </dependency>
<?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/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <packaging>pom</packaging> <!--坐标--> <groupId>io.github.shallwecodex</groupId> <artifactId>utools</artifactId> <version>1.0.2</version> <name>${project.groupId}:${project.artifactId}</name> <description>轻量级工具</description> <url>https://github.com/shallwecodex/utools</url> <!--子模块--> <modules> <module>utool-core</module> <module>utool-flexdim</module> <module>utool-tianji</module> <module>utool-all</module> </modules> <!-- 根节点 <licenses>,用于包含一个或多个许可证信息 --> <licenses> <!-- 单个许可证条目 --> <license> <!-- 许可证名称:Apache License, Version 2.0 --> <name>The Apache License, Version 2.0</name> <!-- 许可证文件的官方链接 --> <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url> </license> <!-- 如果需要添加更多许可证,可以在 <licenses> 标签内继续添加多个 <license> 块。 例如: <license> <name>MIT License</name> <url>https://opensource.org/licenses/MIT</url> </license> --> </licenses> <!-- 根节点 <developers>,用于包含一个或多个开发者信息 --> <developers> <!-- 单个开发者条目 --> <developer> <!-- 开发者姓名 --> <name>wongbin</name> <!-- 开发者的联系邮箱 --> <email>wongbin.work@foxmail.com</email> <!-- 开发者所属组织/公司 --> <organization>Sonatype</organization> <!-- 开发者所属组织的官方网站链接 --> <organizationUrl>http://www.sonatype.com</organizationUrl> <!-- 开发者在项目中的角色列表 --> <roles> <!-- 一个角色 --> <role>Project Manager</role> <!-- 另一个角色 --> <role>Architect</role> </roles> </developer> <!-- 如果需要添加更多开发者,可以在 <developers> 标签内继续添加多个 <developer> 块。 例如: <developer> <name>Jane Doe</name> <email>jane.doe@example.com</email> <roles> <role>Developer</role> <role>QA</role> </roles> </developer> --> </developers> <!-- <scm> 节点用于声明项目的源码控制系统(Source Control Management)信息, 通常在项目描述文件中使用(如 Maven 的 pom.xml)。 --> <scm> <!-- <connection> 定义项目源码仓库的只读连接地址(适用于普通克隆操作)。 一般使用 HTTPS 协议,无需认证即可访问。 --> <connection>https://github.com/shallwecodex/utools.git</connection> <!-- <developerConnection> 定义开发者使用的可写连接地址(用于推送代码等操作)。 通常使用 SSH 或 scm:git 协议,需要配置密钥或权限。 此处是基于 SSH 的 Git 连接方式。 --> <developerConnection>scm:git:ssh://git@github.com:shallwecodex/utools.git</developerConnection> <!-- <url> 提供一个浏览源码的网页地址,通常指向 GitHub、GitLab 等平台上的项目主页。 用户可以通过此链接直接查看源码(特别是 master 分支)。 --> <url>https://github.com/shallwecodex/utools/tree/master</url> </scm> <!--版本管理--> <properties> <!--编译环境--> <maven.compiler.source>8</maven.compiler.source> <maven.compiler.target>8</maven.compiler.target> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <!--编译插件版本--> <Automatic-Module-Name>com.utool</Automatic-Module-Name> <maven-gpg-plugin.version>1.5</maven-gpg-plugin.version> <central-publishing-maven-plugin.version>0.7.0</central-publishing-maven-plugin.version> <maven-deploy-plugin.version>2.8.2</maven-deploy-plugin.version> <maven-source-plugin.version>3.3.1</maven-source-plugin.version> <javadoc.plugin.version>3.11.2</javadoc.plugin.version> <!--统一切换依赖版本--> <!--mvn versions:set -DnewVersion='1.0.1'--> <versions-maven-plugin.version>2.17.1</versions-maven-plugin.version> <cobertura-maven-plugin.version>2.7</cobertura-maven-plugin.version> <maven-jar-plugin.version>3.4.2</maven-jar-plugin.version> <maven-compiler-plugin.version>3.13.0</maven-compiler-plugin.version> <!--gpg 认证--> <gpg.keyname>io.github.hlsd</gpg.keyname> <!-- versions --> <junit.version>5.10.3</junit.version> <lombok.version>1.18.36</lombok.version> <springfox.version>3.0.0</springfox.version> <spring-boot.version>2.7.18</spring-boot.version> <hutool-all.version>5.8.38</hutool-all.version> <vavr.version>1.0.0-alpha-4</vavr.version> <fastjson.version>2.0.57</fastjson.version> <knife4j.version>3.0.3</knife4j.version> <pinyin4j.version>2.5.1</pinyin4j.version> <swagger-annotations.version>1.6.6</swagger-annotations.version> <jsr305.version>3.0.2</jsr305.version> </properties> <!--全局依赖--> <dependencies> <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <version>${lombok.version}</version> <scope>provided</scope> </dependency> <dependency> <groupId>cn.hutool</groupId> <artifactId>hutool-all</artifactId> <version>${hutool-all.version}</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-logging</artifactId> <scope>provided</scope> </dependency> </dependencies> <!--依赖管理--> <dependencyManagement> <dependencies> <!-- SpringBoot 依赖配置 spring-boot-dependencies 是一个 BOM,它定义了一组 Spring Boot 相关依赖的版本。 通过 <type>pom</type> 和 <scope>import</scope>, 你告诉 Maven 使用这个 POM 来管理依赖版本,而不是直接引入该 POM 作为一个依赖 对于普通的依赖项(如 springfox-boot-starter 和 hutool-all), 你不需要也不应该添加 <type>pom</type> 和 <scope>import</scope>。 它们只是声明了特定依赖的版本和坐标,供项目中的实际依赖引用或覆盖默认版本使用--> <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.fastjson2</groupId> <artifactId>fastjson2-parent</artifactId> <version>${fastjson.version}</version> <scope>import</scope> <type>pom</type> </dependency> <!--vavr工具包 https://docs.vavr.io/#_introduction--> <dependency> <groupId>io.vavr</groupId> <artifactId>vavr</artifactId> <version>${vavr.version}</version> </dependency> <dependency> <groupId>com.belerweb</groupId> <artifactId>pinyin4j</artifactId> <version>${pinyin4j.version}</version> </dependency> <dependency> <groupId>io.swagger</groupId> <artifactId>swagger-annotations</artifactId> <version>${swagger-annotations.version}</version> <scope>compile</scope> </dependency> <dependency> <groupId>com.google.code.findbugs</groupId> <artifactId>jsr305</artifactId> <version>${jsr305.version}</version> </dependency> </dependencies> </dependencyManagement> <!-- <build> 节点用于定义 Maven 构建项目的相关配置, 主要包括插件(plugins)、资源过滤、目录结构等。 --> <build> <!-- <plugins> 是构建过程中使用的各种 Maven 插件列表。 每个插件负责一个特定的构建任务,如编译、打包、生成文档等。 --> <plugins> <!-- 1. Maven 编译插件:控制 Java 源码和目标版本 --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>${maven-compiler-plugin.version}</version> <configuration> <!-- 设置编译时使用的 Java 版本(源码兼容性) --> <source>${maven.compiler.source}</source> <!-- 设置编译时生成的目标字节码版本(JVM 兼容性) --> <target>${maven.compiler.target}</target> <!-- 启用编译器参数,例如显示未检查的警告(Xlint:unchecked) --> <compilerArgument>-Xlint:unchecked</compilerArgument> </configuration> </plugin> <!-- 2. Maven 打包插件:控制 jar 包的生成方式 --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <version>${maven-jar-plugin.version}</version> <configuration> <archive> <!-- 是否在 MANIFEST.MF 中创建索引 --> <index>true</index> <manifest> <!-- 是否添加默认实现条目(如项目信息、构建时间等) --> <addDefaultImplementationEntries>true</addDefaultImplementationEntries> </manifest> <!-- 自定义 MANIFEST.MF 文件中的条目 --> <manifestEntries> <!-- 构建操作系统 --> <Build-OS>${os.name}</Build-OS> <!-- 构建者用户名 --> <Built-By>${user.name}</Built-By> <!-- 使用的 JDK 版本 --> <Build-Jdk>${java.version}</Build-Jdk> <!-- 构建时间戳 --> <Build-Timestamp>${maven.build.timestamp}</Build-Timestamp> <Automatic-Module-Name>${Automatic-Module-Name}</Automatic-Module-Name> </manifestEntries> </archive> </configuration> </plugin> <!-- Maven Javadoc 插件:用于生成 API 文档 --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> <version>${javadoc.plugin.version}</version> <configuration> <charset>${project.build.sourceEncoding}</charset> <encoding>${project.build.sourceEncoding}</encoding> <docencoding>${project.build.sourceEncoding}</docencoding> <additionalJOptions> <additionalJOption>-Xdoclint:none</additionalJOption> </additionalJOptions> </configuration> <executions> <execution> <id>attach-javadocs</id> <!-- 绑定到 package 生命周期阶段 --> <phase>package</phase> <goals> <goal>jar</goal> </goals> </execution> </executions> </plugin> <!-- 4. Versions Maven 插件:用于统一管理并更新项目版本 --> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>versions-maven-plugin</artifactId> <version>${versions-maven-plugin.version}</version> <configuration> <!-- 不生成备份 pom.xml 文件 --> <generateBackupPoms>false</generateBackupPoms> </configuration> </plugin> </plugins> </build> <profiles> <profile> <id>release</id> <!-- <distributionManagement> 节点用于配置项目的分发管理信息, 主要用于 Maven 等构建工具在部署(deploy)阶段时知道将构建产物发布到哪里。 --> <distributionManagement> <!-- <snapshotRepository> 用于配置快照版本(SNAPSHOT)的仓库地址。 快照版本是开发中的不稳定版本,适合持续集成和测试使用。 --> <snapshotRepository> <!-- <id> 指向 settings.xml 中配置的服务器认证信息的 ID。 这里使用的是 ossrh,通常对应 Sonatype 的 OSSRH(Open Source Software Repository Hosting)服务。 --> <id>ossrh</id> <!-- <url> 是实际的快照版本仓库地址。 所有以 -SNAPSHOT 结尾的版本都会被部署到这里。 --> <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url> </snapshotRepository> <!-- <repository> 用于配置正式版本(非 SNAPSHOT)的部署地址。 正式版本一旦部署就不应更改,用于生产或发布用途。 --> <repository> <!-- 同样使用 ossrh 作为 ID,表示使用相同的认证信息 --> <id>ossrh</id> <!-- 正式版本部署的目标仓库地址 --> <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2</url> </repository> </distributionManagement> <build> <plugins> <!-- Source --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-source-plugin</artifactId> <version>${maven-source-plugin.version}</version> <executions> <execution> <id>attach-sources</id> <phase>package</phase> <goals> <goal>jar-no-fork</goal> </goals> </execution> </executions> </plugin> <!-- 测试覆盖度 --> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>cobertura-maven-plugin</artifactId> <version>${cobertura-maven-plugin.version}</version> <configuration> <formats> <format>html</format> <format>xml</format> </formats> <check/> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-gpg-plugin</artifactId> <version>${maven-gpg-plugin.version}</version> <configuration> <keyname>${gpg.keyname}</keyname> <executable>C:\Program Files (x86)\GnuPG\bin\gpg.exe</executable> </configuration> <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>${central-publishing-maven-plugin.version}</version> <extensions>true</extensions> <configuration> <publishingServerId>central</publishingServerId> <autoPublish>false</autoPublish> <waitUntil>published</waitUntil> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-deploy-plugin</artifactId> <version>${maven-deploy-plugin.version}</version> </plugin> </plugins> </build> </profile> </profiles> </project>