Ramiro Aparicio Gallardo
01/30/2025, 12:30 PMconstraints {
// This works as expected
api("com.fasterxml.jackson.core:jackson-core") {
version {
require(libs.versions.jackson.get())
}
}
// This is does not work at all
api(libs.jackson.core.get())
}
Ramiro Aparicio Gallardo
01/30/2025, 12:31 PMVampire
01/30/2025, 1:52 PMget()
there?
Does it work if you remove the get()
?
If not, what do you mean by "fail silently", how does the "fail" manifest?
Can you share a build --scan
URL that shows the problem?Ramiro Aparicio Gallardo
01/30/2025, 3:08 PMRamiro Aparicio Gallardo
01/30/2025, 3:10 PMVampire
01/30/2025, 3:25 PMRamiro Aparicio Gallardo
01/30/2025, 3:40 PM[versions]
apache-commons-csv = "1.8"
clikt = "5.0.1"
coroutines = "1.9.0"
dropwizard = "3.0.12"
google-libphonenumber = "8.13.52"
jackson = "2.18.2" # Use the same version as dropwizard
jetty = "10.0.24" # Use the same version as dropwizard
json-json = "20240205"
kotlinx-serialization = "1.6.3"
opencsv = "5.8"
# AWS
aws = "1.12.773"
kinesis = "0.15.11"
# grpc
armeria = "1.31.3"
grpc = "1.68.1" # Should match the version used in armeria to avoid problems
grpc-kotlin = "1.4.1"
protovalidate = "0.2.1"
protobuf = "3.25.5" # Should match the version used in armeria to avoid problems
# Testing
hamcrest = "3.0"
jersey-grizzly2 = "2.46"
mockk = "1.13.13"
shazamcrest = "0.11"
testcontainers = "1.20.2"
[libraries]
# apache commons
apache-commons-csv = { group = "org.apache.commons", name="commons-csv", version.ref = "apache-commons-csv" }
# armeria
armeria = { group = "com.linecorp.armeria", name="armeria", version.ref = "armeria" }
armeria-grpc = { group = "com.linecorp.armeria", name="armeria-grpc", version.ref = "armeria" }
armeria-kotlin = { group = "com.linecorp.armeria", name="armeria-kotlin", version.ref = "armeria" }
# AWS
amazon-kinesis-producer = { group = "com.amazonaws", name="amazon-kinesis-producer", version.ref = "kinesis" }
aws-java-sdk-bom = { group = "com.amazonaws", name="aws-java-sdk-bom", version.ref = "aws" }
aws-java-sdk-core = { group = "com.amazonaws", name="aws-java-sdk-core", version.ref = "aws" }
aws-java-sdk-kinesis = { group = "com.amazonaws", name="aws-java-sdk-kinesis", version.ref = "aws" }
aws-java-sdk-s3 = { group = "com.amazonaws", name="aws-java-sdk-s3", version.ref = "aws" }
aws-java-sdk-secretsmanager = { group = "com.amazonaws", name="aws-java-sdk-secretsmanager", version.ref = "aws" }
aws-java-sdk-ses = { group = "com.amazonaws", name="aws-java-sdk-ses", version.ref = "aws" }
clikt = { group = "com.github.ajalt.clikt", name = "clikt", version.ref = "clikt" }
# Coroutines
coroutines-core = { group = "org.jetbrains.kotlinx", name="kotlinx-coroutines-core", version.ref = "coroutines"}
coroutines-debug = { group = "org.jetbrains.kotlinx", name="kotlinx-coroutines-debug", version.ref = "coroutines"}
coroutines-slf4j = { group = "org.jetbrains.kotlinx", name="kotlinx-coroutines-slf4j", version.ref = "coroutines"}
google-libphonenumber = { group = "com.googlecode.libphonenumber", name="libphonenumber", version.ref = "google-libphonenumber"}
# Dropwizard
dropwizard-auth = { group = "io.dropwizard", name="dropwizard-auth", version.ref = "dropwizard"}
dropwizard-testing = { group = "io.dropwizard", name="dropwizard-testing", version.ref = "dropwizard"}
dropwizard-forms = { group = "io.dropwizard", name="dropwizard-forms", version.ref = "dropwizard"}
dropwizard-core = { group = "io.dropwizard", name="dropwizard-core", version.ref = "dropwizard"}
dropwizard-assets = { group = "io.dropwizard", name="dropwizard-assets", version.ref = "dropwizard"}
# gRPC
grpc-bom = { group = "io.grpc", name="grpc-bom", version.ref = "grpc" }
grpc-api = { group = "io.grpc", name="grpc-api", version.ref = "grpc" }
grpc-util = { group = "io.grpc", name="grpc-util", version.ref = "grpc" }
grpc-services = { group = "io.grpc", name="grpc-services", version.ref = "grpc" }
grpc-netty = { group = "io.grpc", name="grpc-netty", version.ref = "grpc" }
grpc-testing = { group = "io.grpc", name="grpc-testing", version.ref = "grpc" }
grpc-inprocess = { group = "io.grpc", name="grpc-inprocess", version.ref = "grpc" }
grpc-kotlin = { group = "io.grpc", name="grpc-kotlin-stub", version.ref = "grpc-kotlin" }
protovalidate = { group = "build.buf", name="protovalidate", version.ref = "protovalidate" }
protobuf-util = { group = "com.google.protobuf", name="protobuf-java-util", version.ref = "protobuf" }
protobuf = { group = "com.google.protobuf", name="protobuf-java", version.ref = "protobuf" }
# Jackson
jackson-core = { group = "com.fasterxml.jackson.module", name="jackson-module-kotlin", version.ref = "jackson"}
jackson-kotlin = { group = "com.fasterxml.jackson.module", name="jackson-module-kotlin", version.ref = "jackson"}
jackson-databind = { group = "com.fasterxml.jackson.core", name="jackson-databind", version.ref = "jackson"}
jackson-annotations = { group = "com.fasterxml.jackson.core", name="jackson-annotations", version.ref = "jackson"}
jackson-csv = { group = "com.fasterxml.jackson.dataformat", name="jackson-dataformat-csv", version.ref = "jackson"}
jackson-xml = { group = "com.fasterxml.jackson.dataformat", name="jackson-dataformat-xml", version.ref = "jackson"}
jackson-yaml = { group = "com.fasterxml.jackson.dataformat", name="jackson-dataformat-yaml", version.ref = "jackson"}
jackson-jsr310 = { group = "com.fasterxml.jackson.datatype", name="jackson-datatype-jsr310", version.ref = "jackson"}
# Jetty
jetty-server = { group = "org.eclipse.jetty", name="jetty-server", version.ref = "jetty"}
jetty-unixsocket = { group = "org.eclipse.jetty", name="jetty-unixsocket-server", version.ref = "jetty"}
jetty-util = { group = "org.eclipse.jetty", name="jetty-util", version.ref = "jetty"}
jetty-http2 = { group = "org.eclipse.jetty.http2", name="http2-server", version.ref = "jetty"}
json-json = { group = "org.json", name="json", version.ref = "json-json"}
# Kotlin
kotlinx-serialization-core = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-core", version.ref = "kotlinx-serialization"}
kotlinx-serialization-json = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version.ref = "kotlinx-serialization"}
opencsv = { group = "com.opencsv", name = "opencsv", version.ref = "opencsv"}
# Testing
coroutines-test = { group = "org.jetbrains.kotlinx", name="kotlinx-coroutines-test", version.ref = "coroutines"}
hamcrest = { group = "org.hamcrest", name="hamcrest", version.ref = "hamcrest"}
jersey-grizzly2 = { group = "org.glassfish.jersey.test-framework.providers", name="jersey-test-framework-provider-grizzly2", version.ref = "jersey-grizzly2"}
mockk = { group = "io.mockk", name = "mockk", version.ref = "mockk" }
shazamcrest = { group = "com.shazam", name="shazamcrest", version.ref = "shazamcrest"}
testcontainers-junit = { group = "org.testcontainers", name = "junit-jupiter", version.ref = "testcontainers" }
testcontainers = { group = "org.testcontainers", name = "testcontainers", version.ref = "testcontainers" }
Ramiro Aparicio Gallardo
01/30/2025, 3:42 PMVampire
01/30/2025, 4:02 PMjackson-core = { group = "com.fasterxml.jackson.module", name="jackson-module-kotlin", version.ref = "jackson"}Have a closer look 😉
Ramiro Aparicio Gallardo
01/30/2025, 4:03 PMVampire
01/30/2025, 4:03 PMRamiro Aparicio Gallardo
01/30/2025, 4:03 PMRamiro Aparicio Gallardo
01/30/2025, 4:03 PMVampire
01/30/2025, 4:03 PMRamiro Aparicio Gallardo
01/30/2025, 4:04 PMRamiro Aparicio Gallardo
01/30/2025, 4:12 PMconstraints {
api(libs.jackson.core).because("Require at least the same version of the catalog")
}
It fails with:
"You shouldn't use a dependency constraint created via a Provider directly"
but this construct works fine:
constraints {
api(libs.jackson.core) {
because("Require at least the same version of the catalog")
}
}