Skip to content

Commit 8586d3d

Browse files
author
Tatu Saloranta
committed
backport README changes to 2.12 branch
1 parent 67d7e86 commit 8586d3d

File tree

1 file changed

+29
-7
lines changed

1 file changed

+29
-7
lines changed

guava/README.md

+29-7
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,38 @@ To use module on Maven-based projects, use following dependency:
1212
<dependency>
1313
<groupId>com.fasterxml.jackson.datatype</groupId>
1414
<artifactId>jackson-datatype-guava</artifactId>
15-
<version>2.11.1</version>
15+
<version>2.12.1</version>
1616
</dependency>
1717
```
1818

1919
(or whatever version is most up-to-date at the moment)
2020

2121
### Guava compatibility
2222

23-
Jackson 2.x versions up to and including 2.11.x:
23+
Although specific version of this module is built against particular Guava library version,
24+
and similarly defines dependency to just that version, module itself works against wider
25+
range of Guava versions.
2426

25-
* Should work on Guava versions `15.0` and later (currently up to 29.0-jre)
26-
* Require Guava version `20.0` or later to build (some tests depend on newer versions for verification)
27+
Following table shows the tested working ranges for recent module versions.
2728

28-
Minimum supported version is likely to be increased for Jackson 2.12 or later.
29+
| Module version | Min Guava | Default Guava | Max Guava |
30+
| -------------- | --------- | ------------- | --------- |
31+
| 2.12 | 14.0 | 21.0 | 29.0-jre |
32+
| 2.11 | 14.0 | 20.0 | 29.0-jre |
33+
| 2.10 | 14.0 | 20.0 | 29.0-jre |
34+
| 2.9 | 12.0 | 18.0 | 29.0-jre |
35+
36+
Notes:
37+
38+
* At the point of testing, `29.0-jre` was the latest available Guava library
39+
version, so all versions work with the latest Guava
40+
* "Min Guava" means the earliest version that integration tests passed with
41+
* "Default Guava" is the dependency specified in module's `pom.xml`: it is used for build, unit tests
42+
* note: building, unit tests work on a range but typically require higher version than "Min Guava"
2943

3044
### Registering module
3145

32-
Like all standard Jackson modules (libraries that implement Module interface), registration is done as follows:
46+
Like all standard Jackson modules (libraries that implement Module interface), registration is done as follows (Jackson 2.x up to 2.9)
3347

3448
```java
3549
// New (2.10+)
@@ -42,7 +56,15 @@ ObjectMapper mapper = new ObjectMapper()
4256
.registerModule(new GuavaModule());
4357
```
4458

45-
after which functionality is available for all normal Jackson operations.
59+
OR, the new method added in 2.10 (old method will work with 2.x but not 3.x):
60+
61+
```java
62+
ObjectMapper mapper = JsonMapper.builder()
63+
.addModule(new GuavaModule())
64+
.build();
65+
```
66+
67+
after which functionality is available with all normal Jackson operations.
4668

4769
### Configuration
4870

0 commit comments

Comments
 (0)