apply from: "$rootDir/gradle/instrumentation.gradle" muzzle { pass { group = "io.netty" module = "netty-codec-http" versions = "[4.0.0.Final,4.1.0.Final)" assertInverse = true } pass { group = "io.netty" module = "netty-all" versions = "[4.0.0.Final,4.1.0.Final)" excludeDependency 'io.netty:netty-tcnative' assertInverse = true } fail { group = "io.netty" module = "netty" versions = "[,]" } } dependencies { library "io.netty:netty-codec-http:4.0.0.Final" implementation project(':instrumentation:netty:netty-4-common:javaagent') latestDepTestLibrary "io.netty:netty-codec-http:4.0.56.Final" } // We need to force the dependency to the earliest supported version because other libraries declare newer versions. if (!testLatestDeps) { configurations.each { it.resolutionStrategy { eachDependency { DependencyResolveDetails details -> //specifying a fixed version for all libraries with io.netty' group if (details.requested.group == 'io.netty' && details.requested.name != "netty-bom") { details.useVersion "4.0.0.Final" } } } } }