@@ -12,24 +12,38 @@ To use module on Maven-based projects, use following dependency:
12
12
<dependency >
13
13
<groupId >com.fasterxml.jackson.datatype</groupId >
14
14
<artifactId >jackson-datatype-guava</artifactId >
15
- <version >2.11 .1</version >
15
+ <version >2.12 .1</version >
16
16
</dependency >
17
17
```
18
18
19
19
(or whatever version is most up-to-date at the moment)
20
20
21
21
### Guava compatibility
22
22
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.
24
26
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.
27
28
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"
29
43
30
44
### Registering module
31
45
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)
33
47
34
48
``` java
35
49
// New (2.10+)
@@ -42,7 +56,15 @@ ObjectMapper mapper = new ObjectMapper()
42
56
.registerModule(new GuavaModule ());
43
57
```
44
58
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.
46
68
47
69
### Configuration
48
70
0 commit comments