My Spring-boot application started failing once Jackson 2.9 was released on 2nd of March. I am using Gradle for building and Spring boot version 1.5.2 which depends on Jackson-core 2.8.7.
In addition I need Opentok SDK which I have added as dependency:
compile group: 'com.tokbox', name: 'opentok-server-sdk', version: '2.3.2'
I suppose the reason is the Opentok SDK dependency definition which allows downloading newer JAR for Jackson which then creates a mismatch of libraries as several versions of Jackson JARs are downloaded:
https://github.com/opentok/Opentok-Java-SDK/blob/master/build.gradle
dependencies {
...
compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '[2.3.1,2.99999)'
How to sort this out?
I am not an expert of Gradle but could I somehow force Opentok to use 2.8.7 version?
I cannot deliver at the moment at all so please help.
I think this should be useful: https://docs.gradle.org/current/userguide/dependency_management.html#sub:version_conflicts
As well as the guide here: https://docs.gradle.org/current/dsl/org.gradle.api.artifacts.dsl.DependencyHandler.html#N1627D
Approaches might differ, but you can set Gradle to force = true for Spring's jackson-databind dependency.
This is how I sorted it out
compile ('com.tokbox:opentok-server-sdk:2.3.2')
{
// Jackson 2.9 is not compatible with Spring boot 1.4.4 - 1.5.2
exclude group: 'com.fasterxml.jackson.core', module: 'jackson-databind'
}
Related
id 'org.springframework.boot' version '3.0.0-SNAPSHOT'
implementation group: 'org.springdoc', name: 'springdoc-openapi-ui', version: '1.6.12'
I want to use springdoc-openapi-ui with springboot 3.0.0-SNAPSHOT. But swagger not working. It works with springboot version 2.7.5
http://localhost:8080/user/swagger-ui/index.html#/ - swagger url
Bump the version of your org.springdoc to version: 2.0.2.
And instead of using springdoc-openapi-ui use springdoc-openapi-starter-webmvc-ui.
For detailed changes in Springdoc v2, refer to the documentation at https://springdoc.org/v2/#features
I've faced same issue and solved it by adding webflux dependency as well
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.2'
implementation 'org.springdoc:springdoc-openapi-webflux-ui:1.6.14'
I found a security vulnerability during the sonatype library scan in spring-beans and spring-context 5.2.12.Release version. But when I upgraded its parent library spring-webmvc to 5.3.14 to get rid of the vulnerability I got a new runtime error java.lang.NoSuchMethodError: org.springframework.web.cors.CorsConfiguration.addAllowedOriginPattern.
Resolved by upgrading spring-web and restricting it to a specific version
implementation (group: 'org.springframework', name: 'spring-web' ) {
version{
strictly '5.3.20'
}
}
I'm currently working on implementing HTTP3 server using the Gradle version 7.3 on a Ubuntu 20.04 VM. But QUIC codec (0.0.20.Final) and HTTP/3 codec (0.0.11.Final) dependencies produce the following error.
Could not find netty-incubator-codec-native-quic-0.0.25.Final-${os.detected.name}-${os.detected.arch}.jar (io.netty.incubator:netty-incubator-codec-native-quic:0.0.25.Final).
Possible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
Following are the dependencies I used
implementation 'io.netty.incubator:netty-incubator-codec-quic:0.0.20.Final:linux-x86_64'
implementation 'io.netty.incubator:netty-incubator-codec-http3:0.0.11.Final'
As a temporary solution I downloaded the jar of the dependency from here and referenced it in the build.gradle file.
implementation ("io.netty.incubator:netty-incubator-codec-quic:0.0.20.Final:linux-x86_64")
implementation (files("libs/netty-incubator-codec-http3-0.0.11.Final.jar"))
Gradle is struggling to parse the classifier for the quic dependency, which is a property defined in terms of other properties, which are meant to be detected at build-time.
To work around that, exclude the quic dependency from your http3 dependency, and instead pull in quic directly:
implementation ( "io.netty.incubator:netty-incubator-codec-http3:0.0.11.Final" ) {
exclude group: "io.netty.incubator"
}
implementation "io.netty.incubator:netty-incubator-codec-native-quic:0.0.27.Final"
runtimeOnly ( group: "io.netty.incubator", name: "netty-incubator-codec-native-quic", classifier: "osx-x86_64" )
runtimeOnly ( group: "io.netty.incubator", name: "netty-incubator-codec-native-quic", classifier: "linux-x86_64" )
i am using Flink Connector Kafka 1.8.0. (depends on kafka-clients 2.0.1)
https://mvnrepository.com/artifact/org.apache.flink/flink-connector-kafka_2.12/1.8.0
using gradle:
// https://mvnrepository.com/artifact/org.apache.flink/flink-connector-kafka
compile group: 'org.apache.flink', name: 'flink-connector-kafka_2.12', version: '1.8.0'
i wonder if i can force it to use kafka-clients 2.4.0
i wodering if flink supports it, and even so, how it can be configured through
gradle?
can you assist?
Yes, you can configure that by simply explicitly including the dependency with the version that you want
compile group: 'org.apache.flink', name: 'flink-connector-kafka_2.12', version: '1.8.0'
compile group: 'org.apache.kafka', name: 'kafka_2.13', version: '2.4.0'
You can test which version has been chosen with
gradle dependencies
How to specify latest redis client dependency for logback-redis-appender in gradle
https://mvnrepository.com/artifact/com.cwbase/logback-redis-appender/1.1.5
I want to use 2.9.0 dependency of https://mvnrepository.com/artifact/redis.clients/jedis instead of 2.5.2 being used right now.
Add to build.gradle:
compile group: 'redis.clients', name: 'jedis', version: '2.9.0'
or
dependencies {
compile "redis.clients:jedis:2.9.0"
}