mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-03 16:24:31 +08:00
Update README.md
This commit is contained in:
parent
b394e2d455
commit
c0c803bbd0
155
README.md
155
README.md
@ -1,40 +1,40 @@
|
||||
<p align="center">
|
||||
<a href="https://hutool.cn/"><img src="https://cdn.jsdelivr.net/gh/looly/hutool-site/images/logo.jpg" width="45%"></a>
|
||||
<a href="https://hutool.cn/"><img alt="" src="https://plus.hutool.cn/images/hutool.svg" width="45%"></a>
|
||||
</p>
|
||||
<p align="center">
|
||||
<strong>🍬A set of tools that keep Java sweet.</strong>
|
||||
<strong>🍬Make Java Sweet Again.</strong>
|
||||
</p>
|
||||
<p align="center">
|
||||
👉 <a href="https://hutool.cn">https://hutool.cn/</a> 👈
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a target="_blank" href="https://search.maven.org/artifact/cn.hutool/hutool-all">
|
||||
<img src="https://img.shields.io/maven-central/v/cn.hutool/hutool-all.svg?label=Maven%20Central" />
|
||||
<a target="_blank" href="https://search.maven.org/artifact/org.dromara.hutool/hutool-all">
|
||||
<img alt="" src="https://img.shields.io/maven-central/v/org.dromara.hutool/hutool-all.svg?label=Maven%20Central" />
|
||||
</a>
|
||||
<a target="_blank" href="https://license.coscl.org.cn/MulanPSL2">
|
||||
<img src="https://img.shields.io/:license-MulanPSL2-blue.svg" />
|
||||
<a target="_blank" href="https://www.apache.org/licenses/LICENSE-2.0.html">
|
||||
<img alt="" src="https://img.shields.io/:license-apache2.0-blue.svg?logo=apache" />
|
||||
</a>
|
||||
<a target="_blank" href="https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html">
|
||||
<img src="https://img.shields.io/badge/JDK-8+-green.svg" />
|
||||
<img alt="" src="https://img.shields.io/badge/JDK-8+-green.svg" />
|
||||
</a>
|
||||
<a target="_blank" href="https://travis-ci.com/dromara/hutool">
|
||||
<img src="https://travis-ci.com/dromara/hutool.svg?branch=v5-master" />
|
||||
<img alt="" src="https://travis-ci.com/dromara/hutool.svg?branch=v5-master" />
|
||||
</a>
|
||||
<a href="https://www.codacy.com/gh/dromara/hutool/dashboard?utm_source=github.com&utm_medium=referral&utm_content=dromara/hutool&utm_campaign=Badge_Grade">
|
||||
<img src="https://app.codacy.com/project/badge/Grade/8a6897d9de7440dd9de8804c28d2871d"/>
|
||||
<img alt="" src="https://app.codacy.com/project/badge/Grade/8a6897d9de7440dd9de8804c28d2871d"/>
|
||||
</a>
|
||||
<a href="https://codecov.io/gh/dromara/hutool">
|
||||
<img src="https://codecov.io/gh/dromara/hutool/branch/v5-master/graph/badge.svg" />
|
||||
</a> < / >
|
||||
<img alt="" src="https://codecov.io/gh/dromara/hutool/branch/v6-master/graph/badge.svg" />
|
||||
</a>
|
||||
<a target="_blank" href="https://gitter.im/hutool/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge">
|
||||
<img src="https://badges.gitter.im/hutool/Lobby.svg" />
|
||||
<img alt="" src="https://badges.gitter.im/hutool/Lobby.svg" />
|
||||
</a>
|
||||
<a target="_blank" href='https://gitee.com/dromara/hutool/stargazers'>
|
||||
<img src='https://gitee.com/dromara/hutool/badge/star.svg?theme=gvp' alt='star'/>
|
||||
</a> < / >
|
||||
<img alt="star" src='https://gitee.com/dromara/hutool/badge/star.svg?theme=gvp'/>
|
||||
</a>
|
||||
<a target="_blank" href='https://github.com/dromara/hutool'>
|
||||
<img src="https://img.shields.io/github/stars/dromara/hutool.svg?style=social" alt="github star"/>
|
||||
<img alt="github star" src="https://img.shields.io/github/stars/dromara/hutool.svg?style=social"/>
|
||||
</a>
|
||||
<a target="_blank" href='https://gitcode.com/dromara/hutool'>
|
||||
<img src="https://gitcode.com/dromara/hutool/star/badge.svg" alt="gitcode star"/>
|
||||
@ -43,14 +43,14 @@
|
||||
|
||||
<br/>
|
||||
<p align="center">
|
||||
<a href="https://qm.qq.com/q/I7pPlTzCa4">
|
||||
<img src="https://img.shields.io/badge/QQ%E7%BE%A4%E2%91%A6-715292493-orange"/></a>
|
||||
<a href="https://qm.qq.com/cgi-bin/qm/qr?k=QtsqXLkHpLjE99tkre19j6pjPMhSay1a&jump_from=webapi">
|
||||
<img alt="" src="https://img.shields.io/badge/QQ%E7%BE%A4%E2%91%A6-715292493-orange"/></a>
|
||||
</p>
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
|
||||
[**🌎English Documentation**](README-EN.md)(* * * *🌎English文档)(README-EN.md)
|
||||
[**🌎English Documentation**](README-EN.md)
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
@ -60,9 +60,13 @@
|
||||
这些封装的工具涵盖了字符串、数字、集合、编码、日期、文件、IO、加密、数据库JDBC、JSON、HTTP客户端等一系列操作,
|
||||
可以满足各种不同的开发需求。
|
||||
|
||||
### 🎁Hutool名称的由来
|
||||
### 🎁Hutool往事
|
||||
|
||||
Hutool = Hu + tool,是原公司项目底层代码剥离后的开源库,“Hu”是公司名称的表示,tool表示工具。Hutool谐音“糊涂”,一方面简洁易懂,一方面寓意“难得糊涂”。
|
||||
- 2012年,一个刚刚步入职场的少年剥离了业务系统中的公共部分,取名叫做`Common-Tools`。
|
||||
- 2014年,他离开热爱的互联网和IT行业,将这份热爱倾注于开源,并将项目更名为`Hutool`,
|
||||
`Hu`是怀念曾经公司中一起并肩作战的小伙伴们和那段美好回忆,人生难得糊涂,我们都在成长,但不变的是对Coding的热爱。
|
||||
- 现在,“他”变成“他们”——一群热心的Committer。而`Hutool`,数十年如一日,已成为众多Java开发者互助的桥梁。
|
||||
- 将来,Make Java Sweet Again!
|
||||
|
||||
### 🍺Hutool理念
|
||||
|
||||
@ -71,85 +75,85 @@ Hutool = Hu + tool,是原公司项目底层代码剥离后的开源库,“Hu
|
||||
- 你可以引入使用,也可以**拷贝**和修改使用,而**不必标注任何信息**,只是希望能把bug及时反馈回来。
|
||||
- 我们努力健全**中文**注释,为源码学习者提供良好地学习环境,争取做到人人都能看得懂。
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
### ✨版本选择
|
||||
|
||||
Hutool目前主要版本4.x、5.x、6.x,选择如下:
|
||||
|
||||
| 版本 | jdk| Maven仓库 | 主要特点 |
|
||||
|-----|----|--------------------------------------------------------------------------------------------------------|-------------------------------------|
|
||||
| 4.x | jdk1.7 | [cn.hutool/hutool-all/4.x](https://mvnrepository.com/artifact/cn.hutool/hutool-all/4.6.17) | jdk1.7编译 |
|
||||
| 5.x | jdk1.8 | [cn.hutool/hutool-all/5.x ](https://mvnrepository.com/artifact/cn.hutool/hutool-all) | jdk1.8编译,使用JavaEE,适配JDK11、17、21 |
|
||||
| 6.x | jdk1.8 | [org.dromara.hutool/hutool-all/6.x ](https://mvnrepository.com/artifact/org.dromara.hutool/hutool-all) | jdk1.8编译,使用Jakarta EE,适配JDK11、17、21 |
|
||||
|
||||
## 🛠️包含组件
|
||||
一个Java基础工具类,对文件、流、加密解密、转码、正则、线程、XML等JDK方法进行封装,组成各种Util工具类,同时提供以下组件:
|
||||
|
||||
| 模块 | 介绍 |
|
||||
| -------------------|---------------------------------------------------------------------------------- |
|
||||
| hutool-aop | JDK动态代理封装,提供非IOC下的切面支持 |
|
||||
| hutool-bloomFilter | 布隆过滤,提供一些Hash算法的布隆过滤 |
|
||||
| hutool-cache | 简单缓存实现 |
|
||||
| hutool-core | 核心,包括Bean操作、日期、各种Util等 |
|
||||
| hutool-cron | 定时任务模块,提供类Crontab表达式的定时任务 |
|
||||
| hutool-crypto | 加密解密模块,提供对称、非对称和摘要算法封装 |
|
||||
| hutool-db | JDBC封装后的数据操作,基于ActiveRecord思想 |
|
||||
| hutool-dfa | 基于DFA模型的多关键字查找 |
|
||||
| hutool-extra | 扩展模块,对第三方封装(模板引擎、邮件、Servlet、二维码、Emoji、FTP、分词等) |
|
||||
| hutool-http | 基于HttpUrlConnection的Http客户端封装 |
|
||||
| hutool-log | 自动识别日志实现的日志门面 |
|
||||
| hutool-script | 脚本执行封装,例如Javascript |
|
||||
| hutool-setting | 功能更强大的Setting配置文件和Properties封装 |
|
||||
| hutool-system | 系统参数调用封装(JVM信息等) |
|
||||
| hutool-json | JSON实现 |
|
||||
| hutool-captcha | 图片验证码实现 |
|
||||
| hutool-poi | 针对POI中Excel和Word的封装 |
|
||||
| hutool-socket | 基于Java的NIO和AIO的Socket封装 |
|
||||
| hutool-jwt | JSON Web Token (JWT)封装实现 |
|
||||
| 模块 | 介绍 |
|
||||
|----------------|-------------------------------------------------|
|
||||
| hutool-core | 核心,包括Bean操作、日期、各种Util等 |
|
||||
| hutool-cron | 定时任务模块,提供类Crontab表达式的定时任务 |
|
||||
| hutool-crypto | 加密解密模块,提供对称、非对称和摘要算法封装 |
|
||||
| hutool-db | JDBC封装后的数据操作,基于ActiveRecord思想 |
|
||||
| hutool-extra | 扩展模块,对第三方封装(模板引擎、邮件、Servlet、二维码、Emoji、FTP、分词等) |
|
||||
| hutool-http | 基于HttpUrlConnection、HttpClient、OkHttp的Http客户端封装 |
|
||||
| hutool-log | 功能强大的日志门面 |
|
||||
| hutool-setting | 功能更强大的配置文件封装和工具 |
|
||||
| hutool-json | JSON实现 |
|
||||
| hutool-poi | POI中Excel和Word的封装以及OFD封装 |
|
||||
| hutool-socket | 基于Java的NIO和AIO的Socket封装 |
|
||||
| hutool-swing | Swing和JWT相关封装 |
|
||||
|
||||
可以根据需求对每个模块单独引入,也可以通过引入`hutool-all`方式引入所有模块。
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
## 📝文档
|
||||
## 📝文档
|
||||
|
||||
[📘中文文档](https://doc.hutool.cn/pages/index/)
|
||||
|
||||
[📘中文备用文档](https://plus.hutool.cn/)
|
||||
[📘中文备用文档](https://plus.hutool.cn/docs/#/)
|
||||
|
||||
[📙参考API](https://plus.hutool.cn/apidocs/)
|
||||
|
||||
[🎬视频介绍](https://www.bilibili.com/video/BV1bQ4y1M7d9?p=2)
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
## 📦安装
|
||||
|
||||
### 🍊Maven
|
||||
|
||||
在项目的pom.xml的dependencies中加入以下内容:
|
||||
|
||||
```xml
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<groupId>org.dromara.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>5.8.36</version>
|
||||
<version>6.0.0-M21</version>
|
||||
</dependency>
|
||||
```
|
||||
|
||||
### 🍐Gradle
|
||||
|
||||
```
|
||||
implementation 'cn.hutool:hutool-all:5.8.36'
|
||||
implementation 'org.dromara.hutool:hutool-all:6.0.0-M21'
|
||||
```
|
||||
|
||||
### 📥下载jar
|
||||
|
||||
点击以下链接,下载`hutool-all-X.X.X.jar`即可:
|
||||
|
||||
- [Maven中央库](https://repo1.maven.org/maven2/cn/hutool/hutool-all/5.8.36/)
|
||||
- [Maven中央库](https://repo1.maven.org/maven2/org/dromara/hutool/hutool-all/6.0.0-M21/)
|
||||
|
||||
> 🔔️注意
|
||||
> Hutool 5.x支持JDK8+,对Android平台没有测试,不能保证所有工具类或工具方法可用。
|
||||
> 如果你的项目使用JDK7,请使用Hutool 4.x版本(不再更新)
|
||||
> Hutool 6.x支持JDK8+,对Android平台没有测试,不能保证所有工具类或工具方法可用。
|
||||
|
||||
### 🚽编译安装
|
||||
|
||||
访问Hutool的Gitee主页:[https://gitee.com/dromara/hutool](https://gitee.com/dromara/hutool) 下载整个项目源码(v5-master或v5-dev分支都可)然后进入Hutool项目目录执行:
|
||||
访问Hutool的Gitee主页:[https://gitee.com/dromara/hutool](https://gitee.com/dromara/hutool)
|
||||
下载整个项目源码(v6-master或v6-dev分支都可)然后进入Hutool项目目录执行:
|
||||
|
||||
```sh ' ' ' sh
|
||||
./hutool.sh install 。/ hutool.sh安装https://hutool.cn/👉< a href = " https://hutool.cn " > < / >👈https://hutool.cn/👉< a href = " https://hutool.cn " > < / >👈/ hutool。install sh。/ hutool . hs安装https://hutool.cn/👉< a href =“https://hutool.cn " > < / > 👈
|
||||
```sh
|
||||
./hutool.sh install 。/ hutool.sh安装
|
||||
```
|
||||
|
||||
然后就可以使用Maven引入了。
|
||||
@ -162,27 +166,26 @@ implementation 'cn.hutool:hutool-all:5.8.36'
|
||||
|
||||
Hutool的源码分为两个分支,功能如下:
|
||||
|
||||
| 分支 | 作用 |
|
||||
|-----------|---------------------------------------------------------------|
|
||||
| v5-master | 主分支,release版本使用的分支,与中央库提交的jar一致,不接收任何pr或修改 |
|
||||
| v5-dev | 开发分支,默认为下个版本的SNAPSHOT版本,接受修改或pr |
|
||||
| 分支 | 作用 |
|
||||
|-----------|--------------------------------------------|
|
||||
| v6-master | 主分支,release版本使用的分支,与中央库提交的jar一致,不接收任何pr或修改 |
|
||||
| v6-dev | 开发分支,默认为下个版本的SNAPSHOT版本,接受修改或pr |
|
||||
|
||||
### 🐞提供bug反馈或建议
|
||||
|
||||
提交问题反馈请说明正在使用的JDK版本呢、Hutool版本和相关依赖库版本。
|
||||
|
||||
- [Gitee issue Gitee问题](https://gitee.com/dromara/hutool/issues)- [Gitee issue Gitee问题](https://gitee.com/dromara/hutool/issues)
|
||||
- [Github issue Github的问题](https://github.com/dromara/hutool/issues)- [Github问题](https://github.com/dromara/hutool/issues)
|
||||
- [Gitcode issue Gitcode问题](https://gitcode.com/dromara/hutool/issues)- [Gitcode问题](https://gitcode.com/dromara/hutool/issues)
|
||||
|
||||
- [Gitee issue](https://gitee.com/dromara/hutool/issues)
|
||||
- [Github issue](https://github.com/dromara/hutool/issues)
|
||||
- [Gitcode issue Gitcode问题](https://gitcode.com/dromara/hutool/issues)
|
||||
|
||||
### 🧬贡献代码的步骤
|
||||
|
||||
1. 在Gitee或者Github/Gitcode上fork项目到自己的repo
|
||||
1. 在Gitee、Github或Gitcode上fork项目到自己的repo
|
||||
2. 把fork过去的项目也就是你的项目clone到你的本地
|
||||
3. 修改代码(记得一定要修改v5-dev分支)
|
||||
4. commit后push到自己的库(v5-dev分支)
|
||||
5. 登录Gitee或Github/Gitcode在你首页可以看到一个 pull request 按钮,点击它,填写一些说明信息,然后提交即可。
|
||||
3. 修改代码(记得一定要修改v6-dev分支)
|
||||
4. commit后push到自己的库(v6-dev分支)
|
||||
5. 登录Gitee、Github或Gitcode在你首页可以看到一个 pull request 按钮,点击它,填写一些说明信息,然后提交即可。
|
||||
6. 等待维护者合并
|
||||
|
||||
### 📐PR遵照的原则
|
||||
@ -192,15 +195,19 @@ Hutool欢迎任何人为Hutool添砖加瓦,贡献代码,不过维护者是
|
||||
1. 注释完备,尤其每个新增的方法应按照Java文档规范标明方法说明、参数说明、返回值说明等信息,必要时请添加单元测试,如果愿意,也可以加上你的大名。
|
||||
2. Hutool的缩进按照Eclipse(~~不要跟我说IDEA多好用,维护者非常懒,学不会~~,IDEA真香,改了Eclipse快捷键后舒服多了)默认(tab)缩进,所以请遵守(不要和我争执空格与tab的问题,这是一个病人的习惯)。
|
||||
3. 新加的方法不要使用第三方库的方法,Hutool遵循无依赖原则(除非在extra模块中加方法工具)。
|
||||
4. 请pull request到`v5-dev`分支。Hutool在5.x版本后使用了新的分支:`v5-master`是主分支,表示已经发布中央库的版本,这个分支不允许pr,也不允许修改。
|
||||
5. 我们如果关闭了你的issue或pr,请不要诧异,这是我们保持问题处理整洁的一种方式,你依旧可以继续讨论,当有讨论结果时我们会重新打开。
|
||||
4. 请pull request到`v6-dev`分支。Hutool在6.x版本后使用了新的分支:`v6-master`是主分支,表示已经发布中央库的版本,这个分支不允许pr,也不允许修改。
|
||||
|
||||
### 📖文档源码地址
|
||||
### 💞沟通说明
|
||||
|
||||
[文档源码地址](https://gitee.com/loolly_admin/hutool-doc-handy) 点击前往添砖加瓦
|
||||
1. 提交地issue或PR未回复并开启状态表示还未处理,请耐心等待。
|
||||
2. 为了保证新issue及时被发现和处理,我们会关闭一些描述不足的issue,此时你补充说明重新打开即可。
|
||||
3. PR被关闭,表示被拒绝或需要修改地地方较多,重新提交即可。
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
## ⭐Star Hutool
|
||||
|
||||
[](https://starchart.cc/dromara/hutool)[](https://starchart.cc/dromara/hutool)
|
||||
[](https://starchart.cc/dromara/hutool)[](https://starchart.cc/dromara/hutool)
|
||||
|
||||
### GitHub Contributor Over Time
|
||||
[](https://git-contributor.com?chart=contributorOverTime&repo=dromara/hutool)
|
||||
|
Loading…
x
Reference in New Issue
Block a user