From 62753102dcc3acfc1bd5053b59163859aa2fed00 Mon Sep 17 00:00:00 2001 From: Rob Winch Date: Thu, 17 Mar 2016 10:11:12 -0500 Subject: [PATCH] Ensure a consistent netty version Currently there are clashes between io.netty:netty-common:4.1.0.Beta7 and io.netty:netty-all:4.1.0.CR3 which can cause errors in the build related to "VerifyError: Bad type on operand stack". One solution would be to exclude the jars that duplicate the classes. However, this can be fragile since additional dependencies may be added that bring in the dependency transitively. This commit locks the version for any artifiact with the group "io.nettty" to ensure the correct version of netty is used. --- spring-web-reactive/build.gradle | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/spring-web-reactive/build.gradle b/spring-web-reactive/build.gradle index cffddc1c5e..3d7e230b9a 100644 --- a/spring-web-reactive/build.gradle +++ b/spring-web-reactive/build.gradle @@ -26,17 +26,13 @@ repositories { maven { url 'http://repo.spring.io/snapshot' } // Reactor snapshot } -configurations.all { - // check for updates every build - resolutionStrategy.cacheChangingModulesFor 0, 'seconds' -} - ext { springVersion = '4.2.3.RELEASE' reactorVersion = '2.5.0.M2' reactorNettyVersion = '2.5.0.BUILD-SNAPSHOT' tomcatVersion = '8.0.28' jettyVersion = '9.3.5.v20151012' + nettyVersion = '4.1.0.CR3' javadocLinks = [ "http://docs.oracle.com/javase/8/docs/api/", @@ -46,6 +42,18 @@ ext { ] as String[] } +configurations.all { + // check for updates every build + resolutionStrategy.cacheChangingModulesFor 0, 'seconds' + resolutionStrategy.eachDependency { DependencyResolveDetails details -> + // consistent netty version to avoid issues with clashes in netty-all vs + // netty-common for example + if (details.requested.group == 'io.netty') { + details.useVersion nettyVersion + } + } +} + uploadArchives { repositories { mavenDeployer {