Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@ repositories {
/**
* The version of Jackson used by `buildSrc`.
*
* Please keep this value in sync with [io.spine.dependency.lib.Jackson.version].
* It is not a requirement but would be good in terms of consistency.
* This value is deliberately decoupled from [io.spine.dependency.lib.Jackson.version],
* which now points to Jackson 3.x. The `buildSrc` sources still use the Jackson 2.x API
* (`com.fasterxml.jackson.*`), so they must stay on a 2.x version until they are migrated
* to `tools.jackson.*`. Until then, keep this value on the latest 2.x release.
Comment thread
alexander-yevsyukov marked this conversation as resolved.
Outdated
*/
val jacksonVersion = "2.18.3"

Expand Down
70 changes: 51 additions & 19 deletions buildSrc/src/main/kotlin/io/spine/dependency/lib/Jackson.kt
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,24 @@ import io.spine.dependency.Dependency
import io.spine.dependency.DependencyWithBom

// https://github.com/FasterXML/jackson/wiki/Jackson-Releases
//
// Jackson 3.x uses the `tools.jackson` group ID and the matching `tools.jackson.*`
// packages (JSTEP-1). The sole exception is `jackson-annotations`: Jackson 3.x keeps
// consuming the 2.x artifact, so both its coordinates and its
// `com.fasterxml.jackson.annotation` package stay unchanged.
//
// https://github.com/FasterXML/jackson/blob/main/jackson3/MIGRATING_TO_JACKSON_3.md
@Suppress("unused")
object Jackson : DependencyWithBom() {
override val group = "com.fasterxml.jackson"
override val version = "2.22.1"

override val group = "tools.jackson"
override val version = "3.2.1"

/**
* The version of `jackson-annotations`, which Jackson 3.x deliberately keeps
* on the 2.x line.
*
* Must match the `jackson.version.annotations` property declared by the [bom].
*/
// https://github.com/FasterXML/jackson-annotations?tab=readme-ov-file#release-notes
const val annotationsVersion = "2.22"

Expand All @@ -54,19 +67,23 @@ object Jackson : DependencyWithBom() {
val databind = "$coreGroup:jackson-databind"

// https://github.com/FasterXML/jackson-annotations
val annotations = "$coreGroup:jackson-annotations:$annotationsVersion"
val annotations = "com.fasterxml.jackson.core:jackson-annotations:$annotationsVersion"

// https://github.com/FasterXML/jackson-module-kotlin/releases
val moduleKotlin = "$moduleGroup:jackson-module-kotlin"

// https://github.com/FasterXML/jackson-modules-java8
@Deprecated(
"The module was merged into `jackson-databind` in Jackson 3.0" +
" and is no longer published.",
ReplaceWith("databind"),
Comment thread
Copilot marked this conversation as resolved.
Outdated
level = DeprecationLevel.ERROR
)
val moduleParameterNames = "$moduleGroup:jackson-module-parameter-names"

override val modules = listOf(
core,
databind,
moduleKotlin,
moduleParameterNames
moduleKotlin
)

object DataFormat : Dependency() {
Expand All @@ -81,10 +98,13 @@ object Jackson : DependencyWithBom() {
// https://github.com/FasterXML/jackson-dataformats-text/releases
val yaml = "$group:$infix-yaml"

// https://github.com/FasterXML/jackson-dataformats-binary/tree/3.x/protobuf
val protobuf = "$group:$infix-protobuf"

val xmlArtifact = "$xml:$version"
val yamlArtifact = "$yaml:$version"

override val modules = listOf(xml, yaml)
override val modules = listOf(xml, yaml, protobuf)
}

object DataType : Dependency() {
Expand All @@ -93,38 +113,50 @@ object Jackson : DependencyWithBom() {

private const val infix = "jackson-datatype"

// https://github.com/FasterXML/jackson-modules-java8
@Deprecated(
"The module was merged into `jackson-databind` in Jackson 3.0" +
" and is no longer published.",
ReplaceWith("Jackson.databind"),
level = DeprecationLevel.ERROR
)
val jdk8 = "$group:$infix-jdk8"

// https://github.com/FasterXML/jackson-modules-java8/tree/2.19/datetime
@Deprecated(
"The module was merged into `jackson-databind` in Jackson 3.0" +
" and is no longer published.",
ReplaceWith("Jackson.databind"),
level = DeprecationLevel.ERROR
)
val dateTime = "$group:$infix-jsr310"

// https://github.com/FasterXML/jackson-datatypes-collections/blob/2.19/guava
// https://github.com/FasterXML/jackson-datatypes-collections/tree/3.x/guava
val guava = "$group:$infix-guava"

// https://github.com/FasterXML/jackson-dataformats-binary/tree/2.19/protobuf
@Deprecated(
"Protobuf support is a data format, not a data type." +
" The `$infix-protobuf` artifact has never been published.",
ReplaceWith("Jackson.DataFormat.protobuf"),
level = DeprecationLevel.ERROR
)
val protobuf = "$group:$infix-protobuf"

// https://github.com/FasterXML/jackson-datatypes-misc/tree/2.19/javax-money
// https://github.com/FasterXML/jackson-datatypes-misc/tree/3.x/javax-money
val javaXMoney = "$group:$infix-javax-money"

// https://github.com/FasterXML/jackson-datatypes-misc/tree/2.19/moneta
// https://github.com/FasterXML/jackson-datatypes-misc/tree/3.x/moneta
val moneta = "$group:jackson-datatype-moneta"

override val modules = listOf(
jdk8,
dateTime,
guava,
protobuf,
javaXMoney,
moneta
)
}

// https://github.com/FasterXML/jackson-jr
// https://github.com/FasterXML/jackson-jr/tree/3.x
object Junior : Dependency() {
override val version = Jackson.version
override val group = "com.fasterxml.jackson.jr"
override val group = "$groupPrefix.jr"

val objects = "$group:jackson-jr-objects"

Expand Down
Loading
Loading