We’ve recently run into some issues in a Java Gradle project with conflicting netty.io versions. Our project uses gRPC (grpc.io) which brings in a transitive dependency on several netty.io libraries via io.grpc:grpc-netty. We also need io.netty:netty-codec-haproxy, which is not included by grpc-netty. Our recent upgrade to grpc-netty:1.0.3 broke our build, because it updated to 4.1.6.Final of netty.io’s core, but we still had netty-codec-haproxy on 4.1.4.Final.
Dynamic versioning won’t work here, because we don’t need the latest version; we need the one that matches whatever grpc-netty uses. Is there a way to find the version being included via transitive dependency of, say, io.netty:netty-common, and apply that version to netty-codec-haproxy?
grpcVersion = ‘1.0.3’
// Server implementation for gRPC (with native openssl)
// HAProxy protocol support compile group: 'io.netty', name: 'netty-codec-haproxy', version: '4.1.4.Final'