Skip to content

Commit 95e9b76

Browse files
committed
Merge branch '2.x' into 3.x
2 parents 34bc5d9 + a999e6b commit 95e9b76

File tree

1 file changed

+41
-4
lines changed

1 file changed

+41
-4
lines changed

README.md

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@ set of consistent versions to use.
1212

1313
## Status
1414

15-
[![Build Status](https://travis-ci.org/FasterXML/jackson-bom.svg)](https://travis-ci.org/FasterXML/jackson-bom)
1615
[![Tidelift](https://tidelift.com/badges/package/maven/com.fasterxml.jackson:jackson-bom)](https://tidelift.com/subscription/pkg/maven-com-fasterxml-jackson-jackson-bom?utm_source=maven-com-fasterxml-jackson-jackson-bom&utm_medium=referral&utm_campaign=readme)
1716

1817
## Usage
1918

19+
### Usage (Maven)
20+
2021
There are two ways to use the BOM pom: either as parent pom:
2122

2223
```xml
@@ -49,6 +50,35 @@ Two approaches are same with respect to dependency inclusion; latter ONLY includ
4950
former includes many other settings.
5051
Usually latter is preferable, unless component is very closely coupled with core Jackson components.
5152

53+
### Usage (Gradle)
54+
55+
Newer Gradle versions support "platform" concept (see f.ex [Using a plaform](https://docs.gradle.org/current/userguide/platforms.html#sec:using-platform-to-control-transitive-deps)).
56+
You will need to use "java platform" plugin and then add dependency as follows (in Groovy DSL):
57+
58+
```
59+
plugins {
60+
id 'java'
61+
}
62+
63+
repositories {
64+
mavenCentral()
65+
}
66+
67+
dependencies {
68+
// Import the Jackson BOM — pick the version you want
69+
implementation platform("com.fasterxml.jackson:jackson-bom:2.20.0")
70+
71+
// Now declare Jackson modules WITHOUT versions
72+
implementation "com.fasterxml.jackson.core:jackson-databind"
73+
implementation "com.fasterxml.jackson.core:jackson-annotations"
74+
implementation "com.fasterxml.jackson.core:jackson-core"
75+
76+
// Optional: other Jackson modules
77+
implementation "com.fasterxml.jackson.module:jackson-module-parameter-names"
78+
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310"
79+
}
80+
```
81+
5282
## Jackson Versioning
5383

5484
### Semantic Versioning
@@ -87,13 +117,20 @@ As the specific example, `jackson-databind` `2.12.6.1` was released on March 26,
87117
* Version numbers will sort appropriately: `2.12.6.20220326` comes after both `2.12.6` and hypothetical `2.12.6.1`
88118
* Version number gives an idea of release date, wrt time of hot fix(es) included
89119

120+
### Exception: 'jackson-annotations' has no patch version (2.20+)
121+
122+
One exception to the 3-digit versioning is that starting with [Jackson 2.20](https://github.com/FasterXML/jackson/wiki/Jackson-Release-2.20), [jackson-annotations](https://github.com/FasterXML/jackson-annotations) will use shorter versions consisting of only `major.minor` parts.
123+
124+
So: there will normally only be versions `2.20`, `2.21` and so on; and no patch versions.
125+
There MAY be critical patches, theoretically, if absolutely required, but no planned ones.
126+
This change was prompted by the decision to keep Jackson 3.x non-annotations components (mostly [jackson-databind](https://github.com/FasterXML/jackson-databind)) use and support same annotations as 2.x.
127+
90128
## Secondary: "base" sub-project
91129

92130
Note that this repo ALSO contains `jackson-base` (see under dir `base/`), which is the intended
93131
parent pom for Jackson core components.
94-
It extends `jackson-bom`, augmenting with settings that
95-
are only/mostly relevant for Jackson components, but not to things that depend on Jackson in general.
96-
Use of `jackson-base` is not recommended for libraries that are not meant to be coupled with Jackson
132+
It extends `jackson-bom`, augmenting with settings that are only/mostly relevant for Jackson components, but not to things that depend on Jackson in general.
133+
Use of `jackson-base` is NOT recommended for libraries that are not meant to be coupled with Jackson
97134
release cycle and settings.
98135

99136
## Support

0 commit comments

Comments
 (0)