Skip to content

Commit f02867c

Browse files
Merge pull request #1250 from commercetools/BMU-2922_sdk_20_jackson_3
feat: support JVM SDK 20 and Jackson 3
2 parents a0fbe1f + beaeaae commit f02867c

95 files changed

Lines changed: 397 additions & 322 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/cd.yml‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ jobs:
2222
steps:
2323
- name: Git Checkout
2424
uses: actions/checkout@v4
25+
- uses: actions/setup-java@v4
26+
with:
27+
java-version: 17
28+
distribution: 'zulu'
2529
- name: Fetch Library version
2630
id: vars
2731
run: echo libVersion=${GITHUB_REF#refs/*/} >> $GITHUB_OUTPUT
@@ -45,7 +49,7 @@ jobs:
4549
- name: Set up Java
4650
uses: actions/setup-java@v4
4751
with:
48-
java-version: 11
52+
java-version: 17
4953
distribution: 'zulu'
5054
- name: status
5155
run: echo Build is tagged. Uploading artifact ${{ steps.vars.outputs.tag }} to maven central.

‎.github/workflows/ci.yml‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ jobs:
99
steps:
1010
- name: Git Checkout
1111
uses: actions/checkout@v4
12+
- uses: actions/setup-java@v4
13+
with:
14+
java-version: 17
15+
distribution: 'zulu'
1216
- name: Generate Dependency Updates Report
1317
run: ./gradlew clean dependencyUpdates
1418
- name: Code formatting
@@ -28,7 +32,7 @@ jobs:
2832
- uses: actions/checkout@v4
2933
- uses: actions/setup-java@v4
3034
with:
31-
java-version: 11
35+
java-version: 17
3236
distribution: 'zulu'
3337
- name: Build with Gradle
3438
run: ./gradlew clean setLibraryVersion test integrationTest jacocoTestCoverageVerification jacocoTestReport
@@ -58,6 +62,10 @@ jobs:
5862
steps:
5963
- name: Git Checkout
6064
uses: actions/checkout@v4
65+
- uses: actions/setup-java@v4
66+
with:
67+
java-version: 17
68+
distribution: 'zulu'
6169
- name: Fetch Library version
6270
id: vars
6371
run: echo libVersion=${GITHUB_REF#refs/*/} >> $GITHUB_OUTPUT

‎README.md‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# commercetools sync java
33
[![CI](https://github.com/commercetools/commercetools-sync-java/workflows/CI/badge.svg)](https://github.com/commercetools/commercetools-sync-java/actions?query=workflow%3ACI)
44
[![codecov](https://codecov.io/gh/commercetools/commercetools-sync-java/branch/master/graph/badge.svg)](https://codecov.io/gh/commercetools/commercetools-sync-java)
5-
[![Javadoc](https://javadoc.io/badge2/com.commercetools/commercetools-sync-java/javadoc.svg?label=Javadoc)](https://commercetools.github.io/commercetools-sync-java/v/10.0.6/)
5+
[![Javadoc](https://javadoc.io/badge2/com.commercetools/commercetools-sync-java/javadoc.svg?label=Javadoc)](https://commercetools.github.io/commercetools-sync-java/v/11.0.0/)
66
[![Known Vulnerabilities](https://snyk.io/test/github/commercetools/commercetools-sync-java/4b2e26113d591bda158217c5dc1cf80a88665646/badge.svg)](https://snyk.io/test/github/commercetools/commercetools-sync-java/4b2e26113d591bda158217c5dc1cf80a88665646)
77

88

@@ -47,8 +47,8 @@ Notes:
4747

4848
### Prerequisites
4949

50-
- Library requires the min JDK version `>= 11`.
51-
> The library tested with each major JDK version (i.e: 11, 12, 13...) as well as some specific updates of LTS versions (i.e: 11.0.3 and above).
50+
- Library requires the min JDK version `>= 17`.
51+
> Version 11.x of the library uses [JVM-SDK-V2](http://commercetools.github.io/commercetools-sdk-java-v2) 20.x, which is based on Jackson 3. If your application uses JVM SDK 19.x or earlier (based on Jackson 2), or runs on JDK 11 to 16, use version 10.x of this library.
5252
- A target commercetools project for syncing your source data to.
5353

5454
### Installation
@@ -62,26 +62,26 @@ Here are the most popular ones:
6262
<dependency>
6363
<groupId>com.commercetools</groupId>
6464
<artifactId>commercetools-sync-java</artifactId>
65-
<version>10.0.7</version>
65+
<version>11.0.0</version>
6666
</dependency>
6767
````
6868

6969
#### Gradle
7070

7171
````groovy
72-
implementation 'com.commercetools:commercetools-sync-java:10.0.7'
72+
implementation 'com.commercetools:commercetools-sync-java:11.0.0'
7373
````
7474

7575
#### SBT
7676

7777
````
78-
libraryDependencies += "com.commercetools" % "commercetools-sync-java" % "10.0.7"
78+
libraryDependencies += "com.commercetools" % "commercetools-sync-java" % "11.0.0"
7979
````
8080

8181
#### Ivy
8282

8383
````xml
84-
<dependency org="com.commercetools" name="commercetools-sync-java" rev="10.0.7"/>
84+
<dependency org="com.commercetools" name="commercetools-sync-java" rev="11.0.0"/>
8585
````
8686

8787
**Note**: To avoid `commercetools JVM SDK` libraries version mismatch between projects.
@@ -111,6 +111,7 @@ For Maven users, remove:
111111

112112
If you want to use a different `commercetools JVM SDK` version than the version used in this project.
113113
, below you will find examples on how to exclude `commercetools JVM SDK` from commercetools-sync-java library. Beware that library might not work with the older `commercetools JVM SDK` versions.
114+
In particular, version 10.x of the library doesn't work with JVM SDK 20.x, and version 11.x doesn't work with JVM SDK 19.x or earlier, because they are based on different major versions of Jackson.
114115

115116
For Gradle:
116117
````groovy

‎build.gradle‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ plugins {
99
}
1010

1111
ext{
12-
commercetoolsJavaSdkV2Version = '19.3.0'
12+
commercetoolsJavaSdkV2Version = '20.2.0'
1313
mockitoJunitJupiterVersion = '5.20.0'
1414
jupiterApiVersion = '5.14.1'
1515
jupiterPlatformVersion = '1.14.1'

‎docs/README.md‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
# commercetools sync
33
[![CI](https://github.com/commercetools/commercetools-sync-java/workflows/CI/badge.svg)](https://github.com/commercetools/commercetools-sync-java/actions?query=workflow%3ACI)
44
[![codecov](https://codecov.io/gh/commercetools/commercetools-sync-java/branch/master/graph/badge.svg)](https://codecov.io/gh/commercetools/commercetools-sync-java)
5-
[![Benchmarks 10.0.7](https://img.shields.io/badge/Benchmarks-10.0.7-orange.svg)](https://commercetools.github.io/commercetools-sync-java/benchmarks/)
6-
[![Download from Maven Central](https://img.shields.io/badge/Maven_Central-10.0.7-blue.svg)](https://search.maven.org/artifact/com.commercetools/commercetools-sync-java/10.0.7/jar)
7-
[![Javadoc](https://javadoc.io/badge2/com.commercetools/commercetools-sync-java/javadoc.svg?label=Javadoc)](https://commercetools.github.io/commercetools-sync-java/v/10.0.7/)
5+
[![Benchmarks 11.0.0](https://img.shields.io/badge/Benchmarks-11.0.0-orange.svg)](https://commercetools.github.io/commercetools-sync-java/benchmarks/)
6+
[![Download from Maven Central](https://img.shields.io/badge/Maven_Central-11.0.0-blue.svg)](https://search.maven.org/artifact/com.commercetools/commercetools-sync-java/11.0.0/jar)
7+
[![Javadoc](https://javadoc.io/badge2/com.commercetools/commercetools-sync-java/javadoc.svg?label=Javadoc)](https://commercetools.github.io/commercetools-sync-java/v/11.0.0/)
88
[![Known Vulnerabilities](https://snyk.io/test/github/commercetools/commercetools-sync-java/4b2e26113d591bda158217c5dc1cf80a88665646/badge.svg)](https://snyk.io/test/github/commercetools/commercetools-sync-java/4b2e26113d591bda158217c5dc1cf80a88665646)
99

1010

@@ -28,8 +28,8 @@ Notes:
2828

2929
### Prerequisites
3030

31-
- Library requires the min JDK version `>= 8`.
32-
> The library tested with each major JDK version (i.e: 8, 9, 10, 11, 12, 13...) as well as some specific updates of LTS versions (i.e: 8.0.192, 11.0.3).
31+
- Library requires the min JDK version `>= 17`.
32+
> Version 11.x of the library uses [JVM-SDK-V2](http://commercetools.github.io/commercetools-sdk-java-v2) 20.x, which is based on Jackson 3. If your application uses JVM SDK 19.x or earlier (based on Jackson 2), or runs on JDK 11 to 16, use version 10.x of this library.
3333
- A target commercetools project for syncing your source data to.
3434

3535
### Installation
@@ -40,18 +40,18 @@ Here are the most popular ones:
4040
<dependency>
4141
<groupId>com.commercetools</groupId>
4242
<artifactId>commercetools-sync-java</artifactId>
43-
<version>10.0.7</version>
43+
<version>11.0.0</version>
4444
</dependency>
4545
````
4646
#### Gradle
4747
````groovy
48-
implementation 'com.commercetools:commercetools-sync-java:10.0.7'
48+
implementation 'com.commercetools:commercetools-sync-java:11.0.0'
4949
````
5050
#### SBT
5151
````
52-
libraryDependencies += "com.commercetools" % "commercetools-sync-java" % "10.0.7"
52+
libraryDependencies += "com.commercetools" % "commercetools-sync-java" % "11.0.0"
5353
````
5454
#### Ivy
5555
````xml
56-
<dependency org="com.commercetools" name="commercetools-sync-java" rev="10.0.7"/>
56+
<dependency org="com.commercetools" name="commercetools-sync-java" rev="11.0.0"/>
5757
````

‎docs/RELEASE_NOTES.md‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,22 @@
2727
7. Add Migration guide section which specifies explicitly if there are breaking changes and how to tackle them.
2828
-->
2929

30+
### 11.0.0 - Oct 19, 2026
31+
[Commits](https://github.com/commercetools/commercetools-sync-java/compare/10.5.0...11.0.0) |
32+
[Javadoc](https://commercetools.github.io/commercetools-sync-java/v/11.0.0/) |
33+
[Jar](https://search.maven.org/artifact/com.commercetools/commercetools-sync-java/11.0.0/jar)
34+
35+
This release makes the library compatible with commercetools JVM SDK 20.x and Jackson 3. Use version 11.x with JVM SDK 20.x, and keep using version 10.x with JVM SDK 19.x or earlier.
36+
Unresolved references that version 10.x stored as custom objects keep working after the upgrade, because their JSON format didn't change.
37+
38+
- 🚧 **Breaking Changes** (4)
39+
- Minimum Java 17 or above is required.
40+
- The library now uses commercetools JVM SDK 20.x, which is based on Jackson 3 (package `tools.jackson`) instead of Jackson 2 (package `com.fasterxml.jackson`). Using version 10.x of the library with JVM SDK 20.x fails at runtime with a `NoSuchMethodError`.
41+
- Public methods that take or return Jackson types now use the Jackson 3 types, for example `tools.jackson.databind.JsonNode` instead of `com.fasterxml.jackson.databind.JsonNode`. This affects `CustomValueConverter`, `AttributeUtils`, `ResourceIdentifierUtils.isReferenceOfType(JsonNode, String)` and the protected helpers of `BaseTransformServiceImpl`. If you call them, update your Jackson imports, see the [Jackson 3 migration guide](https://github.com/FasterXML/jackson/blob/main/jackson3/MIGRATING_TO_JACKSON_3.md).
42+
- Jackson 3 exceptions are unchecked: `JacksonException`, which extends `RuntimeException`, replaces the checked `JsonProcessingException`. Code that catches `JsonProcessingException`, for example around the SDK's `JsonUtils.toJsonString`, no longer compiles. Catch `JacksonException` instead, or remove the `try`/`catch` if it was only there because the exception was checked.
43+
- 🛠️ **Dependency Updates** (1)
44+
- `commercetools-sdk-java-api` and `commercetools-http-client` `19.3.0` -> `20.2.0`
45+
3046
### 10.5.0 - Jan 07, 2026
3147
[Commits](https://github.com/commercetools/commercetools-sync-java/compare/10.4.0...10.5.0) |
3248
[Javadoc](https://commercetools.github.io/commercetools-sync-java/v/10.5.0/) |

‎docs/usage/QUICK_START.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,21 @@
1212
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
1313

1414
### 1. Installation
15-
- Make sure you have `JDK 11` or higher installed.
15+
- Make sure you have `JDK 17` or higher installed.
1616
- Add the following dependency in your application:
1717
- For Maven users:
1818
````xml
1919
<!-- Add commercetools-sync-java dependency. -->
2020
<dependency>
2121
<groupId>com.commercetools</groupId>
2222
<artifactId>commercetools-sync-java</artifactId>
23-
<version>10.0.4</version>
23+
<version>11.0.0</version>
2424
</dependency>
2525
````
2626
- For Gradle users:
2727
````groovy
2828
// Add commercetools-sync-java dependency.
29-
implementation 'com.commercetools:commercetools-sync-java:10.0.4'
29+
implementation 'com.commercetools:commercetools-sync-java:11.0.0'
3030
````
3131

3232
### 2. Setup Syncing Options

‎gradle-scripts/java-compile.gradle‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
sourceCompatibility = 11
2-
targetCompatibility = 11
1+
sourceCompatibility = 17
2+
targetCompatibility = 17
33
tasks.withType(JavaCompile) {
44
options.encoding = 'UTF-8'
55
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"

‎src/benchmark/java/com/commercetools/sync/benchmark/BenchmarkUtils.java‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
import static java.util.Optional.ofNullable;
44

5-
import com.fasterxml.jackson.databind.JsonNode;
6-
import com.fasterxml.jackson.databind.ObjectMapper;
7-
import com.fasterxml.jackson.databind.node.JsonNodeFactory;
8-
import com.fasterxml.jackson.databind.node.ObjectNode;
95
import java.io.IOException;
106
import java.nio.charset.Charset;
117
import java.nio.charset.StandardCharsets;
128
import java.nio.file.Files;
139
import java.nio.file.Paths;
1410
import javax.annotation.Nonnull;
11+
import tools.jackson.databind.JsonNode;
12+
import tools.jackson.databind.ObjectMapper;
13+
import tools.jackson.databind.node.JsonNodeFactory;
14+
import tools.jackson.databind.node.ObjectNode;
1515

1616
final class BenchmarkUtils {
1717
private static final String BENCHMARK_RESULTS_FILE_NAME = "benchmarks.json";

‎src/integration-test/java/com/commercetools/sync/integration/commons/utils/ITUtils.java‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,6 @@
3838
import com.commercetools.api.models.type.Type;
3939
import com.commercetools.api.models.type.TypeDraft;
4040
import com.commercetools.api.models.type.TypeDraftBuilder;
41-
import com.fasterxml.jackson.core.JsonProcessingException;
42-
import com.fasterxml.jackson.databind.ObjectMapper;
43-
import com.fasterxml.jackson.databind.ObjectWriter;
44-
import com.fasterxml.jackson.databind.node.JsonNodeFactory;
45-
import com.fasterxml.jackson.databind.node.ObjectNode;
4641
import io.vrap.rmf.base.client.ApiHttpResponse;
4742
import io.vrap.rmf.base.client.error.BadGatewayException;
4843
import io.vrap.rmf.base.client.error.NotFoundException;
@@ -56,6 +51,11 @@
5651
import java.util.stream.IntStream;
5752
import javax.annotation.Nonnull;
5853
import javax.annotation.Nullable;
54+
import tools.jackson.core.JacksonException;
55+
import tools.jackson.databind.ObjectMapper;
56+
import tools.jackson.databind.ObjectWriter;
57+
import tools.jackson.databind.node.JsonNodeFactory;
58+
import tools.jackson.databind.node.ObjectNode;
5959

6060
/** This class is meant only meant for internal use of the library's integration tests. */
6161
public final class ITUtils {
@@ -534,7 +534,7 @@ private static String getErrorResponseJsonString(Integer errorCode) {
534534
String json;
535535
try {
536536
json = ow.writeValueAsString(errorResponse);
537-
} catch (JsonProcessingException e) {
537+
} catch (JacksonException e) {
538538
// ignore the error
539539
json = null;
540540
}

0 commit comments

Comments
 (0)