Cleanup jackson build tool dependencies (#83164)

- use jackson platform
- use compatible schema validator version
This commit is contained in:
Rene Groeschke 2022-01-27 09:57:47 +01:00 committed by GitHub
parent 5707b65682
commit fd9887e58b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 9 deletions

View File

@ -202,14 +202,9 @@ configurations {
integTestRuntimeOnly.extendsFrom(testRuntimeOnly)
}
dependencies {
constraints {
api("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:${versions.getProperty('jackson')}") {
version {
strictly "${versions.getProperty('jackson')}"
}
because 'We want to use the exact same jackson version we use in production'
}
}
components.all(JacksonAlignmentRule)
// Forcefully downgrade the jackson platform as used in production
api enforcedPlatform("com.fasterxml.jackson:jackson-bom:${versions.getProperty('jackson')}")
api localGroovy()
api gradleApi()
@ -230,7 +225,8 @@ dependencies {
api 'de.thetaphi:forbiddenapis:3.2'
api 'com.avast.gradle:gradle-docker-compose-plugin:0.14.13'
api 'org.apache.maven:maven-model:3.6.2'
api 'com.networknt:json-schema-validator:1.0.65'
// needs to match the jackson minor version in use
api 'com.networknt:json-schema-validator:1.0.49'
api "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:${versions.getProperty('jackson')}"
api 'org.ow2.asm:asm:9.2'
api 'org.ow2.asm:asm-tree:9.2'
@ -298,3 +294,14 @@ tasks.register("bootstrapPerformanceTests", Copy) {
def root = file('..')
filter(ReplaceTokens, tokens: [testGitCommit:GitInfo.gitInfo(root).revision])
}
abstract class JacksonAlignmentRule implements ComponentMetadataRule {
void execute(ComponentMetadataContext ctx) {
ctx.details.with {d ->
if (d.id.group.startsWith("com.fasterxml.jackson")) {
// declare that Jackson modules all belong to the Jackson virtual platform
belongsTo("com.fasterxml.jackson:jackson-bom:${d.id.version}")
}
}
}
}