Skip to content

Commit

Permalink
Migrate from Java EE 8 to Jakarta EE 9
Browse files Browse the repository at this point in the history
  • Loading branch information
linghengqian committed Nov 24, 2023
1 parent 309d6f3 commit 949565f
Show file tree
Hide file tree
Showing 436 changed files with 3,344 additions and 3,210 deletions.
12 changes: 6 additions & 6 deletions distribution/proxy-native/src/main/release-docs/LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -337,16 +337,15 @@ The text of each license is also included at licenses/LICENSE-[project].txt.
jts-core 1.19.0: https://github.com/locationtech/jts, EDL 1.0

========================================================================
CDDL licenses
EDL licenses
========================================================================

The following components are provided under the CDDL License. See project link for details.
The following components are provided under the EDL License. See project link for details.
The text of each license is also included at licenses/LICENSE-[project].txt.

javax.activation-api 1.2.0: https://github.com/javaee/javax.annotation, CDDL
jta 1.1: http://jta-spec.java.net, CDDL
jaxb-api 2.3.1: http://www.oracle.com, CDDL
jaxb-runtime 2.3.1 https://javaee.github.io/jaxb-v2/, CDDL
jakarta.activation-api 2.0.1: https://github.com/eclipse-ee4j/jaf, EDL 1.0
jakarta.xml.bind-api 3.0.1: https://github.com/eclipse-ee4j/jaxb-api, EDL 1.0
jaxb-runtime 3.0.2 https://eclipse-ee4j.github.io/jaxb-ri/, EDL 1.0

========================================================================
EPL licenses
Expand All @@ -355,6 +354,7 @@ EPL licenses
The following components are provided under the EPL License. See project link for details.
The text of each license is also included at licenses/LICENSE-[project].txt.

jakarta.transaction-api 2.0.1: https://projects.eclipse.org/projects/ee4j.jta, EPL 2.0
logback-classic 1.2.12: https://github.com/qos-ch/logback, EPL 1.0
logback-core 1.2.12: https://github.com/qos-ch/logback, EPL 1.0
mchange-commons-java 0.2.15: https://github.com/swaldman/mchange-commons-java, EPL 1.0
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

This file was deleted.

12 changes: 6 additions & 6 deletions distribution/proxy/src/main/release-docs/LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -337,16 +337,15 @@ The text of each license is also included at licenses/LICENSE-[project].txt.
jts-core 1.19.0: https://github.com/locationtech/jts, EDL 1.0

========================================================================
CDDL licenses
EDL licenses
========================================================================

The following components are provided under the CDDL License. See project link for details.
The following components are provided under the EDL License. See project link for details.
The text of each license is also included at licenses/LICENSE-[project].txt.

javax.activation-api 1.2.0: https://github.com/javaee/javax.annotation, CDDL
jta 1.1: http://jta-spec.java.net, CDDL
jaxb-api 2.3.1: http://www.oracle.com, CDDL
jaxb-runtime 2.3.1 https://javaee.github.io/jaxb-v2/, CDDL
jakarta.activation-api 2.0.1: https://github.com/eclipse-ee4j/jaf, EDL 1.0
jakarta.xml.bind-api 3.0.1: https://github.com/eclipse-ee4j/jaxb-api, EDL 1.0
jaxb-runtime 3.0.2 https://eclipse-ee4j.github.io/jaxb-ri/, EDL 1.0

========================================================================
EPL licenses
Expand All @@ -355,6 +354,7 @@ EPL licenses
The following components are provided under the EPL License. See project link for details.
The text of each license is also included at licenses/LICENSE-[project].txt.

jakarta.transaction-api 2.0.1: https://projects.eclipse.org/projects/ee4j.jta, EPL 2.0
logback-classic 1.2.12: https://github.com/qos-ch/logback, EPL 1.0
logback-core 1.2.12: https://github.com/qos-ch/logback, EPL 1.0
mchange-commons-java 0.2.15: https://github.com/swaldman/mchange-commons-java, EPL 1.0
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

This file was deleted.

762 changes: 0 additions & 762 deletions distribution/proxy/src/main/release-docs/licenses/LICENSE-jta.txt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ Apache ShardingSphere 提供 XA 事务,集成了 Narayana 的实现。

```xml
<properties>
<narayana.version>5.12.4.Final</narayana.version>
<jboss-transaction-spi.version>7.6.0.Final</jboss-transaction-spi.version>
<jboss-logging.version>3.2.1.Final</jboss-logging.version>
<narayana.version>5.12.7.Final</narayana.version>
<jboss-logging.version>3.4.3.Final</jboss-logging.version>
</properties>

<dependency>
Expand All @@ -38,23 +37,18 @@ Apache ShardingSphere 提供 XA 事务,集成了 Narayana 的实现。
</dependency>
<dependency>
<groupId>org.jboss.narayana.jta</groupId>
<artifactId>jta</artifactId>
<artifactId>narayana-jta-jakarta</artifactId>
<version>${narayana.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.narayana.jts</groupId>
<artifactId>narayana-jts-integration</artifactId>
<version>${narayana.version}</version>
</dependency>
<dependency>
<groupId>org.jboss</groupId>
<artifactId>jboss-transaction-spi</artifactId>
<version>${jboss-transaction-spi.version}</version>
<groupId>org.jboss.narayana.jts</groupId>
<artifactId>narayana-jts-integration-jakarta</artifactId>
<version>${narayana.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging</artifactId>
<version>${jboss-logging.version}</version>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging</artifactId>
<version>${jboss-logging.version}</version>
</dependency>
```
## 操作步骤
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ Introducing Maven dependency

```xml
<properties>
<narayana.version>5.12.4.Final</narayana.version>
<jboss-transaction-spi.version>7.6.0.Final</jboss-transaction-spi.version>
<jboss-logging.version>3.2.1.Final</jboss-logging.version>
<narayana.version>5.12.7.Final</narayana.version>
<jboss-logging.version>3.4.3.Final</jboss-logging.version>
</properties>

<dependency>
Expand All @@ -38,23 +37,18 @@ Introducing Maven dependency
</dependency>
<dependency>
<groupId>org.jboss.narayana.jta</groupId>
<artifactId>jta</artifactId>
<artifactId>narayana-jta-jakarta</artifactId>
<version>${narayana.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.narayana.jts</groupId>
<artifactId>narayana-jts-integration</artifactId>
<version>${narayana.version}</version>
</dependency>
<dependency>
<groupId>org.jboss</groupId>
<artifactId>jboss-transaction-spi</artifactId>
<version>${jboss-transaction-spi.version}</version>
<groupId>org.jboss.narayana.jts</groupId>
<artifactId>narayana-jts-integration-jakarta</artifactId>
<version>${narayana.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging</artifactId>
<version>${jboss-logging.version}</version>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging</artifactId>
<version>${jboss-logging.version}</version>
</dependency>
```
## Procedure
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ spring.datasource.url=jdbc:shardingsphere:classpath:xxx.yaml

直接使用该数据源;或者将 ShardingSphereDataSource 配置在 JPA、Hibernate、MyBatis 等 ORM 框架中配合使用。

## 针对 Spring Boot OSS 3 的特殊处理

Spring Boot OSS 3 对 Jakarta EE 和 Java 17 进行了 “大爆炸” 升级,涉及大量复杂情况。
## 针对低版本的 Spring Boot OSS 2 的特殊处理

ShardingSphere 的所有特性均可在 Spring Boot OSS 3 上使用。

对于正在使用 Java EE 8 API 及其实现的 ShardingSphere JDBC 而言,如果用户希望在 Spring Boot OSS 3 等基于 Jakarta EE 9+ API 的 Web
Framework 上使用 ShardingSphere JDBC,则需要引入 Java EE 8 的 JAXB 的实现。
对于正在使用 Jakarta EE 9 API 及其实现的 ShardingSphere JDBC 而言,如果用户希望在 Spring Boot OSS 2.7 等基于 Java EE 8 API 的 Web
Framework 上使用 ShardingSphere JDBC,则需要引入 Jakarta EE 9 的 JAXB 的实现。

这在 Maven 的 `pom.xml` 体现为如下内容。你也可以使用其他的 JAXB API 的实现。此配置同样适用于其他基于 Jakarta EE 的 Web Framework,如
Quarkus 3,Micronaut Framework 4 和 Helidon 3。
这在 Maven 的 `pom.xml` 体现为如下内容。你也可以使用其他的 JAXB API 的实现。此配置同样适用于其他基于 Java EE 8 的 Web Framework。

```xml
<project>
Expand All @@ -56,26 +56,7 @@ Quarkus 3,Micronaut Framework 4 和 Helidon 3。
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>2.3.1</version>
</dependency>
</dependencies>
</project>
```

此外,ShardingSphere 的 XA 分布式事务尚未在 Spring Boot OSS 3 上就绪。

## 针对低版本的 Spring Boot OSS 2 的特殊处理

ShardingSphere 的所有特性均可在 Spring Boot OSS 2 上使用,但低版本的 Spring Boot OSS 可能需要手动指定 SnakeYAML 的版本为 2.2 。
这在 Maven 的 `pom.xml` 体现为如下内容。

```xml
<project>
<dependencies>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-jdbc-core</artifactId>
<version>${shardingsphere.version}</version>
<version>3.0.2</version>
</dependency>
<dependency>
<groupId>org.yaml</groupId>
Expand All @@ -91,6 +72,7 @@ ShardingSphere 的所有特性均可在 Spring Boot OSS 2 上使用,但低版
```xml
<project>
<properties>
<glassfish-jaxb.version>3.0.2</glassfish-jaxb.version>
<snakeyaml.version>2.2</snakeyaml.version>
</properties>

Expand All @@ -103,3 +85,5 @@ ShardingSphere 的所有特性均可在 Spring Boot OSS 2 上使用,但低版
</dependencies>
</project>
```

此外,ShardingSphere 的 XA 分布式事务在 Spring Boot OSS 2.x 上无法集成于 Spring 自有注解。
Original file line number Diff line number Diff line change
Expand Up @@ -35,74 +35,55 @@ The YAML configuration file in 'spring.datasource.url' currently support in two

Use this data source directly; or configure ShardingSphereDataSource to be used in conjunction with ORM frameworks such as JPA, Hibernate, and MyBatis.

## Special handling for Spring Boot OSS 3

Spring Boot OSS 3 has made a "big bang" upgrade to Jakarta EE and Java 17, with all complications involved.

For ShardingSphere JDBC that is using the Java EE 8 API and its implementation, if you want to use ShardingSphere JDBC
on a Jakarta EE 9+ API-based web framework such as Spring Boot OSS 3, you need to introduce a JAXB implementation of
Java EE 8.

This is reflected in Maven's `pom.xml` as follows. You can also use other JAXB API implementations. This configuration
also applies to other Jakarta EE-based Web Frameworks, such as Quarkus 3, Micronaut Framework 4 and Helidon 3.

```xml
<project>
<dependencies>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-jdbc-core</artifactId>
<version>${shardingsphere.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>2.3.1</version>
</dependency>
</dependencies>
</project>
```
## Special handling for earlier versions of Spring Boot OSS 2

In addition, ShardingSphere's XA distributed transactions are not yet ready on Spring Boot OSS 3.
All features of ShardingSphere are available on Spring Boot OSS 3.

## Special handling for earlier versions of Spring Boot OSS 2
For ShardingSphere JDBC that is using Jakarta EE 9 API and its implementation, if you want to use Java EE 8 API-based Web applications such as
Spring Boot OSS 2.7 Framework, to use ShardingSphere JDBC, you need to introduce the JAXB implementation of Jakarta EE 9.

All features of ShardingSphere are available on Spring Boot OSS 2, but earlier versions of Spring Boot OSS may require
manually specifying version 2.2 for SnakeYAML.
This is reflected in Maven's `pom.xml` as follows.
This is reflected in Maven's `pom.xml` as the following content. You can also use other JAXB API implementations.
This configuration also applies to other Java EE 8-based Web Frameworks.

```xml
<project>
<dependencies>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-jdbc-core</artifactId>
<version>${shardingsphere.version}</version>
</dependency>
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>2.2</version>
</dependency>
</dependencies>
<dependencies>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-jdbc-core</artifactId>
<version>${shardingsphere.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>3.0.2</version>
</dependency>
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>2.2</version>
</dependency>
</dependencies>
</project>
```

If the user created the Spring Boot project from https://start.spring.io/, users can simplify configuration by
following things.
If the user created the Spring Boot project through https://start.spring.io/, the configuration can be simplified through the following content.

```xml
<project>
<properties>
<snakeyaml.version>2.2</snakeyaml.version>
</properties>
<properties>
<glassfish-jaxb.version>3.0.2</glassfish-jaxb.version>
<snakeyaml.version>2.2</snakeyaml.version>
</properties>

<dependencies>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-jdbc-core</artifactId>
<version>${shardingsphere.version}</version>
</dependency>
</dependencies>
<dependencies>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-jdbc-core</artifactId>
<version>${shardingsphere.version}</version>
</dependency>
</dependencies>
</project>
```

In addition, ShardingSphere's XA distributed transactions cannot be integrated with Spring's own annotations on Spring Boot OSS 2.x.
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,16 @@ weight = 2

### jar 文件下载地址

- [arjuna-5.12.4.Final.jar](https://repo1.maven.org/maven2/org/jboss/narayana/arjunacore/arjuna/5.12.4.Final/arjuna-5.12.4.Final.jar)
- [common-5.12.4.Final.jar](https://repo1.maven.org/maven2/org/jboss/narayana/common/5.12.4.Final/common-5.12.4.Final.jar)
- [javax.activation-api-1.2.0.jar](https://repo1.maven.org/maven2/javax/activation/javax.activation-api/1.2.0/javax.activation-api-1.2.0.jar)
- [jaxb-api-2.3.0.jar](https://repo1.maven.org/maven2/javax/xml/bind/jaxb-api/2.3.0/jaxb-api-2.3.0.jar)
- [jaxb-core-2.3.0.jar](https://repo1.maven.org/maven2/com/sun/xml/bind/jaxb-core/2.3.0/jaxb-core-2.3.0.jar)
- [jaxb-impl-2.3.0.jar](https://repo1.maven.org/maven2/com/sun/xml/bind/jaxb-impl/2.3.0/jaxb-impl-2.3.0.jar)
- [jboss-connector-api_1.7_spec-1.0.0.Final.jar](https://repo1.maven.org/maven2/org/jboss/spec/javax/resource/jboss-connector-api_1.7_spec/1.0.0.Final/jboss-connector-api_1.7_spec-1.0.0.Final.jar)
- [jboss-logging-3.2.1.Final.jar](https://repo1.maven.org/maven2/org/jboss/logging/jboss-logging/3.2.1.Final/jboss-logging-3.2.1.Final.jar)
- [jboss-transaction-api_1.2_spec-1.0.0.Alpha3.jar](https://repo1.maven.org/maven2/org/jboss/spec/javax/transaction/jboss-transaction-api_1.2_spec/1.0.0.Alpha3/jboss-transaction-api_1.2_spec-1.0.0.Alpha3.jar)
- [jboss-transaction-spi-7.6.0.Final.jar](https://repo1.maven.org/maven2/org/jboss/jboss-transaction-spi/7.6.0.Final/jboss-transaction-spi-7.6.0.Final.jar)
- [jta-5.12.4.Final.jar](https://repo1.maven.org/maven2/org/jboss/narayana/jta/jta/5.12.4.Final/jta-5.12.4.Final.jar)
- [narayana-jts-integration-5.12.4.Final.jar](https://repo1.maven.org/maven2/org/jboss/narayana/jts/narayana-jts-integration/5.12.4.Final/narayana-jts-integration-5.12.4.Final.jar)
- [istack-commons-runtime:4.0.1.jar](https://repo1.maven.org/maven2/com/sun/istack/istack-commons-runtime/4.0.1/istack-commons-runtime-4.0.1.jar)
- [jakarta.activation-api-2.0.1.jar](https://repo1.maven.org/maven2/jakarta/activation/jakarta.activation-api/2.0.1/jakarta.activation-api-2.0.1.jar)
- [jakarta.xml.bind-api-3.0.1.jar](https://repo1.maven.org/maven2/jakarta/xml/bind/jakarta.xml.bind-api/3.0.1/jakarta.xml.bind-api-3.0.1.jar)
- [jaxb-core-3.0.2.jar](https://repo1.maven.org/maven2/org/glassfish/jaxb/jaxb-core/3.0.2/jaxb-core-3.0.2.jar)
- [jaxb-runtime-3.0.2.jar](https://repo1.maven.org/maven2/org/glassfish/jaxb/jaxb-runtime/3.0.2/jaxb-runtime-3.0.2.jar)
- [jboss-logging-3.4.3.Final.jar](https://repo1.maven.org/maven2/org/jboss/logging/jboss-logging/3.4.3.Final/jboss-logging-3.4.3.Final.jar)
- [jboss-transaction-spi-jakarta-7.6.1.Final.jar](https://repo1.maven.org/maven2/org/jboss/jboss-transaction-spi-jakarta/7.6.1.Final/jboss-transaction-spi-jakarta-7.6.1.Final.jar)
- [narayana-jta-jakarta-5.12.7.Final.jar](https://repo1.maven.org/maven2/org/jboss/narayana/jta/narayana-jta-jakarta/5.12.7.Final/narayana-jta-jakarta-5.12.7.Final.jar)
- [narayana-jts-integration-jakarta-5.12.7.Final.jar](https://repo1.maven.org/maven2/org/jboss/narayana/jts/narayana-jts-integration-jakarta/5.12.7.Final/narayana-jts-integration-jakarta-5.12.7.Final.jar)
- [shardingsphere-transaction-xa-narayana.jar](https://mvnrepository.com/artifact/org.apache.shardingsphere/shardingsphere-transaction-xa-narayana)
- [txw2-3.0.2.jar](https://repo1.maven.org/maven2/org/glassfish/jaxb/txw2/3.0.2/txw2-3.0.2.jar)

请根据 `proxy` 版本下载对应 `shardingsphere-transaction-xa-narayana.jar` 文件。
Loading

0 comments on commit 949565f

Please sign in to comment.