apache / apache/linkis

[Feature][Linkis] Upgrade to JDK 21 and Spring Framework

Open
#5,304 1 comment 0 reactions 0 assignees View on GitHub
feature
Dominant language
Java
Stars
3.4k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

### Linkis Component

linkis-dist

### What happened

**English:**

Linkis currently runs on JDK 8 with older Spring Framework versions. To leverage latest features, performance improvements, and security updates, an upgrade to JDK 21 and the latest Spring Framework is needed.

**Motivation:**
- JDK 21 is a Long-Term Support (LTS) release with significant performance and language improvements
- Modern Spring Framework versions provide better security, performance, and developer experience
- Staying current with technology stack ensures long-term maintainability

---

**中文:**

Linkis目前运行在JDK 8和较旧的Spring Framework版本上。为了利用最新功能、性能改进和安全更新,需要升级到JDK 21和最新的Spring Framework。

**动机:**
- JDK 21是长期支持(LTS)版本,具有显著的性能和语言改进
- 现代Spring Framework版本提供更好的安全性、性能和开发体验
- 保持技术栈的更新确保长期可维护性

### What you expected to happen

**English:**

Successfully upgrade Linkis to run on JDK 21 with latest compatible Spring Framework:
1. All Linkis services run successfully on JDK 21
2. Upgrade Spring Framework to compatible version (Spring 5.x or 6.x)
3. Maintain backward compatibility where possible
4. Update dependencies to JDK 21 compatible versions
5. Performance improvements from new JDK features

---

**中文:**

成功将Linkis升级到JDK 21和最新兼容的Spring Framework:
1. 所有Linkis服务在JDK 21上成功运行
2. 将Spring Framework升级到兼容版本(Spring 5.x或6.x)
3. 尽可能保持向后兼容性
4. 将依赖项更新到JDK 21兼容版本
5. 从新JDK功能获得性能改进

### How to reproduce

Current situation:
- Linkis runs on JDK 8
- Uses older Spring Framework versions
- May have deprecated API usage

### Anything else

**English:**

**Upgrade Path:**
1. **JDK Upgrade**: JDK 8 → JDK 11 → JDK 17 → JDK 21 (incremental testing recommended)
2. **Spring Upgrade**: Current → Spring 5.3.x → Spring 6.x (if compatible)

**Key Changes Required:**
1. **Code Changes:**
- Replace deprecated JDK APIs
- Update Java language level (enable records, pattern matching, etc.)
- Handle removed APIs (e.g., Nashorn JavaScript engine)

2. **Dependency Updates:**
- Update all dependencies to JDK 21 compatible versions
- Resolve Maven/Gradle plugin compatibility
- Update build toolchain

3. **Spring Framework Changes:**
- Jakarta EE namespace migration (javax.* → jakarta.*)
- Spring 6.x requires JDK 17+ as minimum
- Update Spring Boot if applicable

4. **Testing Strategy:**
- Comprehensive regression testing
- Performance benchmarking (JDK 8 vs JDK 21)
- Load testing under production-like conditions

**Benefits:**
- Modern GC algorithms (ZGC, Shenandoah)
- Virtual threads (Project Loom) for better concurrency
- Pattern matching and records for cleaner code
- Better JVM introspection and diagnostics
- Security improvements

**Compatibility Matrix:**
| Component | Current | Target |
|-----------|---------|--------|
| JDK | 8 | 21 |
| Spring Framework | 5.x | 5.3.x/6.x |
| Jakarta EE | javax.* | jakarta.* |

---

**中文:**

**升级路径:**
1. **JDK升级**: JDK 8 → JDK 11 → JDK 17 → JDK 21(建议增量测试)
2. **Spring升级**: 当前版本 → Spring 5.3.x → Spring 6.x(如果兼容)

**关键变更:**
1. **代码更改:**
- 替换已弃用的JDK API
- 更新Java语言级别(启用records、pattern matching等)
- 处理已删除的API(如Nashorn JavaScript引擎)

2. **依赖更新:**
- 将所有依赖更新到JDK 21兼容版本
- 解决Maven/Gradle插件兼容性
- 更新构建工具链

3. **Spring Framework更改:**
- Jakarta EE命名空间迁移(javax.* → jakarta.*)
- Spring 6.x最低要求JDK 17+
- 如适用,更新Spring Boot

4. **测试策略:**
- 全面回归测试
- 性能基准测试(JDK 8 vs JDK 21)
- 类生产环境下的负载测试

**收益:**
- 现代GC算法(ZGC、Shenandoah)
- 虚拟线程(Project Loom)以获得更好的并发性
- Pattern matching和records使代码更简洁
- 更好的JVM自省和诊断
- 安全性改进

**兼容性矩阵:**
| 组件 | 当前 | 目标 |
|-----------|---------|--------|
| JDK | 8 | 21 |
| Spring Framework | 5.x | 5.3.x/6.x |
| Jakarta EE | javax.* | jakarta.* |

### Are you willing to submit a PR?

- [ ] Yes I am willing to submit a PR!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.