Skip to content

Commit efe1ba1

Browse files
feat!: bump to spring 4 and jackson 3
1 parent b44f242 commit efe1ba1

3 files changed

Lines changed: 29 additions & 18 deletions

File tree

build.gradle

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
22

33
plugins {
4-
id "com.github.mxenabled.coppuccino" version "7.+"
4+
id "com.github.mxenabled.coppuccino" version "7.0.2-SNAPSHOT"
55
id "groovy"
66
id "java-gradle-plugin"
77
id "maven-publish"
88
id "org.jetbrains.kotlin.jvm" version "2.1.0"
99
}
1010

1111
group "com.mx.vogue"
12-
version "4.0.1" // x-release-please-version
12+
version "4.0.2-SNAPSHOT" // x-release-please-version
1313

1414
java {
1515
toolchain {
@@ -41,8 +41,9 @@ repositories {
4141

4242
dependencies {
4343
implementation "com.google.code.gson:gson:[2.0,3.0)"
44-
implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:[2.21.0,2.22.0)"
45-
implementation "com.github.ben-manes.versions:com.github.ben-manes.versions.gradle.plugin:0.53.0"
44+
// implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:[2.21.0,2.22.0)"
45+
implementation "tools.jackson.dataformat:jackson-dataformat-yaml:[3.1.4,4.0.0)"
46+
implementation "com.github.ben-manes.versions:com.github.ben-manes.versions.gradle.plugin:0.54.0"
4647

4748
testImplementation "org.mockito:mockito-core:[5.0,6.0)"
4849
testImplementation "org.spockframework:spock-core:2.4-M6-groovy-3.0"

gradle.lockfile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,8 @@
22
# Manual edits can break the build and are not advised.
33
# This file is expected to be part of source control.
44
com.fasterxml.jackson.core:jackson-annotations:2.21=compileClasspath,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
5-
com.fasterxml.jackson.core:jackson-core:2.21.4=compileClasspath,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
6-
com.fasterxml.jackson.core:jackson-databind:2.21.4=compileClasspath,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
7-
com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.21.4=compileClasspath,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
8-
com.fasterxml.jackson:jackson-bom:2.21.4=compileClasspath,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
9-
com.github.ben-manes.versions:com.github.ben-manes.versions.gradle.plugin:0.53.0=compileClasspath,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
10-
com.github.ben-manes:gradle-versions-plugin:0.53.0=compileClasspath,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
5+
com.github.ben-manes.versions:com.github.ben-manes.versions.gradle.plugin:0.54.0=compileClasspath,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
6+
com.github.ben-manes:gradle-versions-plugin:0.54.0=compileClasspath,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
117
com.github.spotbugs:spotbugs-annotations:4.9.8=annotationProcessor,compileClasspath,compileOnlyDependenciesMetadata,spotbugs,testAnnotationProcessor,testCompileClasspath,testCompileOnlyDependenciesMetadata
128
com.github.spotbugs:spotbugs:4.9.8=spotbugs
139
com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs
@@ -120,8 +116,12 @@ org.ow2.asm:asm:9.9=spotbugs
120116
org.slf4j:slf4j-api:2.0.17=spotbugs,spotbugsSlf4j
121117
org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j
122118
org.snakeyaml:snakeyaml-engine:2.7=detekt
119+
org.snakeyaml:snakeyaml-engine:3.0.1=compileClasspath,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
123120
org.spockframework:spock-bom:2.4-M6-groovy-3.0=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
124121
org.spockframework:spock-core:2.4-M6-groovy-3.0=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
125122
org.xmlresolver:xmlresolver:5.3.3=spotbugs
126-
org.yaml:snakeyaml:2.5=compileClasspath,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
123+
tools.jackson.core:jackson-core:3.1.4=compileClasspath,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
124+
tools.jackson.core:jackson-databind:3.1.4=compileClasspath,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
125+
tools.jackson.dataformat:jackson-dataformat-yaml:3.1.4=compileClasspath,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
126+
tools.jackson:jackson-bom:3.1.4=compileClasspath,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
127127
empty=detektPlugins,intransitiveDependenciesMetadata,kotlinCompilerPluginClasspath,kotlinNativeCompilerPluginClasspath,kotlinScriptDefExtensions,spotbugsPlugins,testApiDependenciesMetadata,testIntransitiveDependenciesMetadata,testKotlinScriptDefExtensions

src/main/kotlin/com/mx/vogue/core/ConfigUtils.kt

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
package com.mx.vogue.core
1717

1818
import com.fasterxml.jackson.annotation.JsonInclude
19-
import com.fasterxml.jackson.databind.ObjectMapper
20-
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory
2119
import com.mx.vogue.core.models.Configuration
2220
import com.mx.vogue.core.models.PackageRule
2321
import com.mx.vogue.core.models.Rules
2422
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings
23+
import tools.jackson.databind.DeserializationFeature
24+
import tools.jackson.dataformat.yaml.YAMLMapper
2525
import java.io.File
2626
import java.io.FileNotFoundException
2727

@@ -32,7 +32,9 @@ fun loadConfiguration(path: String): Configuration? {
3232
return null
3333
}
3434

35-
val mapper = ObjectMapper(YAMLFactory())
35+
val mapper: YAMLMapper = YAMLMapper.builder()
36+
.disable(DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES)
37+
.build()
3638

3739
val contents = file.readText(Charsets.UTF_8)
3840
if (contents.isEmpty()) {
@@ -45,8 +47,12 @@ fun loadConfiguration(path: String): Configuration? {
4547
fun writeConfiguration(path: String, config: Configuration) {
4648
val file = File(path)
4749

48-
val mapper = ObjectMapper(YAMLFactory())
49-
mapper.setSerializationInclusion(JsonInclude.Include.NON_EMPTY)
50+
val mapper = YAMLMapper.builder()
51+
.changeDefaultPropertyInclusion { incl ->
52+
incl.withValueInclusion(JsonInclude.Include.NON_EMPTY)
53+
}
54+
.disable(DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES)
55+
.build()
5056
file.writeBytes(mapper.writeValueAsBytes(config))
5157
}
5258

@@ -55,8 +61,12 @@ fun loadDefaultConfiguration(): Configuration {
5561
val stream = object {}.javaClass.classLoader.getResourceAsStream("default.vogue.yml")
5662
?: throw FileNotFoundException("Default configuration file could not be loaded")
5763

58-
val mapper = ObjectMapper(YAMLFactory())
59-
mapper.setSerializationInclusion(JsonInclude.Include.NON_EMPTY)
64+
val mapper = YAMLMapper.builder()
65+
.changeDefaultPropertyInclusion { incl ->
66+
incl.withValueInclusion(JsonInclude.Include.NON_EMPTY)
67+
}
68+
.disable(DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES)
69+
.build()
6070
return mapper.readValue(stream.readBytes(), Configuration::class.java)
6171
}
6272

0 commit comments

Comments
 (0)