Skip to content

Commit

Permalink
docs(docs): 兼容 JDK8
Browse files Browse the repository at this point in the history
  • Loading branch information
hylexus committed Aug 3, 2024
1 parent e768d58 commit 94d2a4e
Show file tree
Hide file tree
Showing 7 changed files with 84 additions and 90 deletions.
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
## 2.3.0-rc.1(2024-08-03)

### ⭐ New Features

下面模块的最低 **JDK** 版本从 `11` 改为 `8`:

- **jt-core**
- **jt-808-server-support**
- **jt-808-server-spring-boot-autoconfigure**
- **jt-808-server-spring-boot-starter-boot2**
- **jt-1078-server-support**
- **jt-1078-server-spring-boot-autoconfigure**
- **jt-1078-server-spring-boot-starter-boot2**

### ❤️ Contributors

- [@MaxonCinker](https://github.com/MaxonCinker)
- [@hylexus](https://github.com/hylexus)

## 2.1.5(2024-07-20)

### ⭐ New Features
Expand Down
86 changes: 29 additions & 57 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@ Jt-808协议服务端。

最新版升级问题,请参考 [升级指南--2.0.x升级到2.1.x](https://hylexus.github.io/jt-framework/v2/jt-808/guide/migration/migrating-from-2.0.x-to-2.1.x.html)

最新版升级问题,请参考 [升级指南--2.0.x升级到2.1.x](https://hylexus.github.io/jt-framework/v2/jt-808/guide/migration/migrating-from-2.0.x-to-2.1.x.html)

最新版升级问题,请参考 [升级指南--2.0.x升级到2.1.x](https://hylexus.github.io/jt-framework/v2/jt-808/guide/migration/migrating-from-2.0.x-to-2.1.x.html)

## 私有协议编解码小工具推荐「广告」
## 私有协议编解码小工具推荐

不依赖具体协议的私有协议编解码小工具。

Expand All @@ -30,9 +26,9 @@ Jt-808协议服务端。

| Module | JDK | spring-boot | Desc |
|--------------------------------------------|-------|-------------------|--------------------------------------------|
| `jt-808-server-spring-boot-starter-boot2` | `11+` | `[2.2.x, 2.7.18]` |**spring-boot-2.x** 提供的 starter |
| `jt-808-server-spring-boot-starter-boot2` | `8+` | `[2.2.x, 2.7.18]` |**spring-boot-2.x** 提供的 starter |
| `jt-808-server-spring-boot-starter` | `17+` | `[3.0.0, ...]` |**spring-boot-3.x** 提供的 starter |
| `jt-1078-server-spring-boot-starter-boot2` | `11+` | `[2.2.x, 2.7.18]` |**spring-boot-2.x** 提供的 starter; `beta版` |
| `jt-1078-server-spring-boot-starter-boot2` | `8+` | `[2.2.x, 2.7.18]` |**spring-boot-2.x** 提供的 starter; `beta版` |
| `jt-1078-server-spring-boot-starter` | `17+` | `[3.0.0, ...]` |**spring-boot-3.x** 提供的 starter; `beta版` |
| `jt-dashboard-client-spring-boot-starter` | `17+` | `[3.0.0, ...]` | 暂时只支持 `jdk17+/spring-boot-3.x`; `beta版` |
| `jt-dashboard-server-spring-boot-starter` | `17+` | `[3.0.0, ...]` | 暂时只支持 `jdk17+/spring-boot-3.x`; `beta版` |
Expand All @@ -43,32 +39,32 @@ Jt-808协议服务端。

| Module | JDK | CompileLevel | .class | spring-boot | Desc |
|------------------------------------------|-----|--------------|-------------|-------------|-------------------------------------------|
| jt-core | 17 | JDK-11 | 55 (JDK-11) | -- | |
| jt-core | 17 | JDK-8 | 52 (JDK-8) | -- | |
| jt-808-server-spring-boot-starter | 17 | _**JDK-17**_ | 61 (JDK-17) | _**3.3.0**_ | |
| jt-808-server-spring-boot-starter-boot2 | 17 | JDK-11 | 55 (JDK-11) | 2.7.18 | |
| jt-808-server-spring-boot-autoconfigure | 17 | JDK-11 | 55 (JDK-11) | 2.7.18 | |
| jt-808-server-support | 17 | JDK-11 | 55 (JDK-11) | -- | |
| jt-808-server-spring-boot-starter-boot2 | 17 | JDK-8 | 52 (JDK-8) | 2.7.18 | |
| jt-808-server-spring-boot-autoconfigure | 17 | JDK-8 | 52 (JDK-8) | 2.7.18 | |
| jt-808-server-support | 17 | JDK-8 | 52 (JDK-8) | -- | |
| jt-1078-server-spring-boot-starter | 17 | _**JDK-17**_ | 61 (JDK-17) | _**3.3.0**_ | |
| jt-1078-server-spring-boot-starter-boot2 | 17 | JDK-11 | 55 (JDK-11) | 2.7.18 | |
| jt-1078-server-spring-boot-autoconfigure | 17 | JDK-11 | 55 (JDK-11) | 2.7.18 | |
| jt-1078-server-support | 17 | JDK-11 | 55 (JDK-11) | -- | |
| `dashboard/**` | 17 | _**JDK-17**_ | 61 (JDK-11) | _**3.3.0**_ | dashboard 模块暂时只支持 `spring-boot-3.x/jdk17` |
| jt-1078-server-spring-boot-starter-boot2 | 17 | JDK-8 | 52 (JDK-8) | 2.7.18 | |
| jt-1078-server-spring-boot-autoconfigure | 17 | JDK-8 | 52 (JDK-8) | 2.7.18 | |
| jt-1078-server-support | 17 | JDK-8 | 52 (JDK-8) | -- | |
| `dashboard/**` | 17 | _**JDK-17**_ | 61 (JDK-17) | _**3.3.0**_ | dashboard 模块暂时只支持 `spring-boot-3.x/jdk17` |

- 模块介绍

```sh
.
├── build-script # gradle 用到的构建脚本和checkstyle配置
├── docs # 文档 (vue-press)
├── jt-1078-server-spring-boot-autoconfigure # (jdk11+)
├── jt-1078-server-spring-boot-autoconfigure # (jdk8+)
├── jt-1078-server-spring-boot-starter # spring-boot-v3 自动配置 (jdk17+)
├── jt-1078-server-spring-boot-starter-boot2 # spring-boot-v2 自动配置 (jdk11+)
├── jt-1078-server-support # jt-1078 的实现 (jdk11+)
├── jt-808-server-spring-boot-autoconfigure # (jdk11+)
├── jt-1078-server-spring-boot-starter-boot2 # spring-boot-v2 自动配置 (jdk8+)
├── jt-1078-server-support # jt-1078 的实现 (jdk8+)
├── jt-808-server-spring-boot-autoconfigure # (jdk8+)
├── jt-808-server-spring-boot-starter # spring-boot-v3 自动配置 (jdk17+)
├── jt-808-server-spring-boot-starter-boot2 # spring-boot-v2 自动配置 (jdk11+)
├── jt-808-server-support # jt-808 的实现 (jdk11+)
├── jt-core # 一些公共类 (jdk11+)
├── jt-808-server-spring-boot-starter-boot2 # spring-boot-v2 自动配置 (jdk8+)
├── jt-808-server-support # jt-808 的实现 (jdk8+)
├── jt-core # 一些公共类 (jdk8+)
├── dashboard # dashboard 模块 「暂时」 不支持 spring-boot-2.x
│ ├── jt-dashboard-client # dashboard 客户端 (jdk17+)
│ ├── jt-dashboard-client-spring-boot-starter # dashboard 客户端的 spring-boot-v3 自动配置 (jdk17+)
Expand All @@ -84,62 +80,41 @@ Jt-808协议服务端。
└── samples
├── jt-1078-server-sample-webflux-boot3 # JT/T 1078 的示例(spring-boot-3.x; Webflux) (jdk17+)
├── jt-1078-server-sample-webmvc-boot3 # JT/T 1078 的示例(spring-boot-3.x; SpringMVC) (jdk17+)
├── jt-808-server-sample-annotation # 注解相关的示例(spring-boot-2.x) (jdk11+)
├── jt-808-server-sample-bare # 几乎零配置的示例(spring-boot-2.x) (jdk11+)
├── jt-808-server-sample-annotation # 注解相关的示例(spring-boot-2.x) (jdk8+)
├── jt-808-server-sample-bare # 几乎零配置的示例(spring-boot-2.x) (jdk8+)
├── jt-808-server-sample-bare-boot3 # 几乎零配置的示例(spring-boot-3.x) (jdk17+)
├── jt-808-server-sample-customized # 定制化示例(spring-boot-2.x) (jdk11+)
├── jt-808-server-sample-customized # 定制化示例(spring-boot-2.x) (jdk8+)
├── jt-808-client-sample-debug # 开发时用来Debug的项目,请忽略
├── jt-808-server-sample-debug # 开发时用来Debug的项目,请忽略
└── jt-sample-common # samples 项目共同的依赖 (jdk11+)
└── jt-sample-common # samples 项目共同的依赖 (jdk8+)

```

## Docs

- 文档请移步:[https://hylexus.github.io/jt-framework/](https://hylexus.github.io/jt-framework/)
- 文档请移步:[https://hylexus.github.io/jt-framework/](https://hylexus.github.io/jt-framework/)
- 文档请移步:[https://hylexus.github.io/jt-framework/](https://hylexus.github.io/jt-framework/)

## QuickStart

更多信息,请移步 [入门--快速开始](https://hylexus.github.io/jt-framework/v2/jt-808/guide/quick-start/quick-start.html)

更多信息,请移步 [入门--快速开始](https://hylexus.github.io/jt-framework/v2/jt-808/guide/quick-start/quick-start.html)

更多信息,请移步 [入门--快速开始](https://hylexus.github.io/jt-framework/v2/jt-808/guide/quick-start/quick-start.html)

### 1. 创建工程

创建一个空的 `spring-boot` 工程。

### 2. 添加依赖

关于 `starter` 项目名称的说明:

- **2.1.x** 开始
- 1). 分为 **spring-boot-2.x****spring-boot-3.x** 两个版本
- 2). **RELEASE** 版本命名不带任何后缀(不再以 `-RELEASE` 结尾)
- 3). 低版本中写错的单词 `stater` 更正为 `starter`
- 4). **RELEASE** 版本命名规则如下所示:
- **spring-boot-3.x**
- `jt-808-server-spring-boot-starter-2.1.0.jar`
- **spring-boot-2.x**
- `jt-808-server-spring-boot-starter-boot2-2.1.0.jar`
- **2.1.x** 之前
- 1). **RELEASE** 版本命名以 `-RELEASE` 结尾
- 2). 模块名中的单词 `starter` 误写为 `stater`
- 3). **RELEASE** 版本命名规则如下所示:
- `jt-808-server-spring-boot-stater-2.0.3-RELEASE.jar`
- `jt-808-server-spring-boot-stater-2.0.1-RELEASE.jar`
- ...
- `jt-808-server-spring-boot-stater-1.0.0-RELEASE.jar`
- **spring-boot-3.x**
- `jt-808-server-spring-boot-starter-2.3.0-rc.1.jar`
- **spring-boot-2.x**
- `jt-808-server-spring-boot-starter-boot2-2.3.0-rc.1.jar`

按需求引入为 `808协议` 提供的 `spring-boot-starter`

- gradle

```groovy
implementation group: 'io.github.hylexus.jt', name: 'jt-808-server-spring-boot-starter-boot2', version: "2.1.5"
implementation group: 'io.github.hylexus.jt', name: 'jt-808-server-spring-boot-starter-boot2', version: "2.3.0-rc.1"
```

- maven
Expand All @@ -149,7 +124,7 @@ implementation group: 'io.github.hylexus.jt', name: 'jt-808-server-spring-boot-s
<dependency>
<groupId>io.github.hylexus.jt</groupId>
<artifactId>jt-808-server-spring-boot-starter-boot2</artifactId>
<version>2.1.5</version>
<version>2.3.0-rc.1</version>
</dependency>
```

Expand Down Expand Up @@ -178,6 +153,7 @@ logging:
- 支持消息下发
- 支持消息分包
- 支持多版本
- 支持报文加解密
## Maven Samples
Expand All @@ -190,10 +166,6 @@ Maven版示例项目
更多有关编译源码的信息,请移步 [入门--编译源码](https://hylexus.github.io/jt-framework/v2/jt-808/guide/quick-start/building-from-source.html) 。
更多有关编译源码的信息,请移步 [入门--编译源码](https://hylexus.github.io/jt-framework/v2/jt-808/guide/quick-start/building-from-source.html) 。
更多有关编译源码的信息,请移步 [入门--编译源码](https://hylexus.github.io/jt-framework/v2/jt-808/guide/quick-start/building-from-source.html) 。
- Mac/Linux/Unix-Based System
```shell script
Expand Down
4 changes: 2 additions & 2 deletions build-script/script/common-maven-config.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ jar {
manifest.attributes["Implementation-Title"] = project.name
manifest.attributes["Implementation-Version"] = project.version
manifest.attributes["Automatic-Module-Name"] = project.name.replace('-', '.')
manifest.attributes["JDK-Version"] = obtainJavaVersion()
manifest.attributes["Created-By"] = "${System.getProperty("user.name")}"
manifest.attributes["Created-By"] = "${System.getProperty("java.version")} (${System.getProperty("java.vendor")})"
manifest.attributes["Minimum-Jdk-Version"] = obtainJavaVersion()

from(rootProject.projectDir) {
include "LICENSE"
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 12 additions & 12 deletions docs/src/v2/jt-808/guide/quick-start/building-from-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ icon: code

因为 `jt-808-server-spring-boot-starter` 模块是为 `spring-boot-3.x` 提供的,`spring-boot-3.x` 必须使用 `JDK17+`

其他模块虽然也用了 `JDK17`,但是编译级别是 `JDK11`
其他模块虽然也用了 `JDK17`,但是编译级别是 `JDK8`

:::

Expand All @@ -38,7 +38,7 @@ icon: code
虽然源码要求的 `JDK` 版本必须在 `17` 以上,但是实际上:

- 只有 `jt-808-server-spring-boot-starter` 模块必须使用 `JDK-17`,编译后的 `.class` 文件版本为 `61` (`JDK-17`)
- 其余模块编译后的 `.class` 文件版本依然是 `55` (`JDK-11`);也就是说使用 `JDK17` 编译输出了 `JDK11` 对应的 `.class`
- 其余模块编译后的 `.class` 文件版本依然是 `52` (`JDK-11`);也就是说使用 `JDK17` 编译输出了 `JDK8` 对应的 `.class`

:::

Expand All @@ -47,10 +47,10 @@ icon: code
| Module | JDK | CompileLevel | .class |
|-----------------------------------------|-----|--------------|-------------|
| jt-808-server-spring-boot-starter | 17 | _**JDK-17**_ | 61 (JDK-17) |
| jt-808-server-spring-boot-starter-boot2 | 17 | JDK-11 | 55 (JDK-11) |
| jt-808-server-spring-boot-autoconfigure | 17 | JDK-11 | 55 (JDK-11) |
| jt-808-server-support | 17 | JDK-11 | 55 (JDK-11) |
| jt-808-server-core | 17 | JDK-11 | 55 (JDK-11) |
| jt-808-server-spring-boot-starter-boot2 | 17 | JDK-8 | 52 (JDK-8) |
| jt-808-server-spring-boot-autoconfigure | 17 | JDK-8 | 52 (JDK-8) |
| jt-808-server-support | 17 | JDK-8 | 52 (JDK-8) |
| jt-808-server-core | 17 | JDK-8 | 52 (JDK-8) |

`gradle.properties` 配置文件里有两个 `JDK` 版本的配置:

Expand All @@ -59,15 +59,15 @@ icon: code

```properties
# spring-boot-2.x
defaultJavaVersion=11
defaultJavaVersion=8
# spring-boot-3.x
maximumJavaVersion=17
```

::: warning

- 如果没有特殊需求,不建议对 `defaultJavaVersion` 降级(改为比 **11** 更低的版本)
- 因为当前源码的最低要求是 `JDK11`
- 如果没有特殊需求,不建议对 `defaultJavaVersion` 降级(改为比 **8** 更低的版本)
- 因为当前源码的最低要求是 `JDK8`
- 降级之后可能有一些 `Java` 语法不兼容
- `maximumJavaVersion` 这个配置项必须 `>= 17`, 因为这个是给 `spring-boot-3.x` 用的
- 但是你可以将 `defaultJavaVersion` 或 / 和 `maximumJavaVersion` 升级(改为高版本)
Expand All @@ -83,16 +83,16 @@ maximumJavaVersion=17

```properties
# spring-boot-2.x
defaultSpringBootBomVersion=2.6.14
defaultSpringBootBomVersion=2.7.18
# spring-boot-3.x
maximumSpringBootBomVersion=3.0.2
maximumSpringBootBomVersion=3.3.0
```

::: info

如果没有特殊需求,也没必要修改源码中的 `spring-boot` 版本。

- `defaultSpringBootBomVersion` 可取值为 `[2.2.x, 2.6.x]`
- `defaultSpringBootBomVersion` 可取值为 `[2.2.x, 2.7.18]`
- `maximumSpringBootBomVersion` 可取值为 `[3.0.0, ...)`

:::
Expand Down
Loading

0 comments on commit 94d2a4e

Please sign in to comment.