From d771ddd8a95e00a877befa80db731f82f1ae2f81 Mon Sep 17 00:00:00 2001 From: Anuraag Agrawal Date: Wed, 18 May 2022 06:12:36 +0900 Subject: [PATCH] Update dependencies (#6007) * Update dependencies * Add maven to plugin repos * Fix tests that fail with groovy 4.0.2 (#42) Co-authored-by: Lauri Tulmin --- conventions/build.gradle.kts | 2 +- dependencyManagement/build.gradle.kts | 20 +++++++---------- gradle-plugins/build.gradle.kts | 4 ++-- .../src/test/groovy/Netty40ServerTest.groovy | 22 +++++++++++++------ .../src/test/groovy/Netty41ServerTest.groovy | 22 +++++++++++++------ settings.gradle.kts | 5 +++++ 6 files changed, 46 insertions(+), 29 deletions(-) diff --git a/conventions/build.gradle.kts b/conventions/build.gradle.kts index 8e8f933c5b88..48271dced2e7 100644 --- a/conventions/build.gradle.kts +++ b/conventions/build.gradle.kts @@ -49,7 +49,7 @@ dependencies { implementation("org.gradle:test-retry-gradle-plugin:1.3.1") implementation("ru.vyarus:gradle-animalsniffer-plugin:1.5.4") // When updating, also update dependencyManagement/build.gradle.kts - implementation("net.bytebuddy:byte-buddy-gradle-plugin:1.12.9") + implementation("net.bytebuddy:byte-buddy-gradle-plugin:1.12.10") implementation("gradle.plugin.io.morethan.jmhreport:gradle-jmh-report:0.9.0") implementation("me.champeau.jmh:jmh-gradle-plugin:0.6.6") implementation("net.ltgt.gradle:gradle-errorprone-plugin:2.0.2") diff --git a/dependencyManagement/build.gradle.kts b/dependencyManagement/build.gradle.kts index 258a429359f3..b928c4f1302f 100644 --- a/dependencyManagement/build.gradle.kts +++ b/dependencyManagement/build.gradle.kts @@ -15,7 +15,7 @@ val otelVersion = "1.14.0" rootProject.extra["otelVersion"] = otelVersion // Need both BOM and groovy jars -val groovyVersion = "4.0.1" +val groovyVersion = "4.0.2" // We don't force libraries we instrument to new versions since we compile and test against specific // old baseline versions @@ -35,7 +35,8 @@ val DEPENDENCY_BOMS = listOf( "org.apache.groovy:groovy-bom:${groovyVersion}", "io.opentelemetry:opentelemetry-bom:${otelVersion}", "io.opentelemetry:opentelemetry-bom-alpha:${otelVersion}-alpha", - "org.junit:junit-bom:5.8.2" + "org.junit:junit-bom:5.8.2", + "org.testcontainers:testcontainers-bom:1.17.1", ) val DEPENDENCY_SETS = listOf( @@ -57,7 +58,7 @@ val DEPENDENCY_SETS = listOf( DependencySet( "net.bytebuddy", // When updating, also update conventions/build.gradle.kts - "1.12.9", + "1.12.10", listOf("byte-buddy", "byte-buddy-dep", "byte-buddy-agent", "byte-buddy-gradle-plugin") ), DependencySet( @@ -67,7 +68,7 @@ val DEPENDENCY_SETS = listOf( ), DependencySet( "org.mockito", - "4.4.0", + "4.5.1", listOf("mockito-core", "mockito-junit-jupiter", "mockito-inline") ), DependencySet( @@ -75,11 +76,6 @@ val DEPENDENCY_SETS = listOf( "1.7.36", listOf("slf4j-api", "slf4j-simple", "log4j-over-slf4j", "jcl-over-slf4j", "jul-to-slf4j") ), - DependencySet( - "org.testcontainers", - "1.16.3", - listOf("testcontainers", "junit-jupiter", "cassandra", "couchbase", "elasticsearch", "kafka", "localstack", "selenium") - ) ) val DEPENDENCIES = listOf( @@ -87,7 +83,7 @@ val DEPENDENCIES = listOf( "com.github.stefanbirkner:system-lambda:1.2.1", "com.github.stefanbirkner:system-rules:1.19.0", "uk.org.webcompere:system-stubs-jupiter:2.0.1", - "com.uber.nullaway:nullaway:0.9.6", + "com.uber.nullaway:nullaway:0.9.7", "commons-beanutils:commons-beanutils:1.9.4", "commons-cli:commons-cli:1.5.0", "commons-codec:commons-codec:1.15", @@ -99,14 +95,14 @@ val DEPENDENCIES = listOf( "commons-logging:commons-logging:1.2", "commons-validator:commons-validator:1.7", "io.netty:netty:3.10.6.Final", - "io.opentelemetry.proto:opentelemetry-proto:0.16.0-alpha", + "io.opentelemetry.proto:opentelemetry-proto:0.17.0-alpha", "org.assertj:assertj-core:3.22.0", "org.awaitility:awaitility:4.2.0", "com.google.code.findbugs:annotations:3.0.1u2", "com.google.code.findbugs:jsr305:3.0.2", "org.apache.groovy:groovy:${groovyVersion}", "org.apache.groovy:groovy-json:${groovyVersion}", - "org.junit-pioneer:junit-pioneer:1.6.2", + "org.junit-pioneer:junit-pioneer:1.7.0", "org.objenesis:objenesis:3.2", "org.spockframework:spock-core:2.2-M1-groovy-4.0", "org.spockframework:spock-junit4:2.2-M1-groovy-4.0", diff --git a/gradle-plugins/build.gradle.kts b/gradle-plugins/build.gradle.kts index da5617998726..7bfa550fed6a 100644 --- a/gradle-plugins/build.gradle.kts +++ b/gradle-plugins/build.gradle.kts @@ -26,10 +26,10 @@ configurations.named("compileOnly") { dependencies { implementation("com.google.guava:guava:31.1-jre") // we need to use byte buddy variant that does not shade asm - implementation("net.bytebuddy:byte-buddy-gradle-plugin:1.12.9") { + implementation("net.bytebuddy:byte-buddy-gradle-plugin:1.12.10") { exclude(group = "net.bytebuddy", module = "byte-buddy") } - implementation("net.bytebuddy:byte-buddy-dep:1.12.9") + implementation("net.bytebuddy:byte-buddy-dep:1.12.10") implementation("org.eclipse.aether:aether-connector-basic:1.1.0") implementation("org.eclipse.aether:aether-transport-http:1.1.0") diff --git a/instrumentation/netty/netty-4.0/javaagent/src/test/groovy/Netty40ServerTest.groovy b/instrumentation/netty/netty-4.0/javaagent/src/test/groovy/Netty40ServerTest.groovy index 26706f23bdff..af147f5415bd 100644 --- a/instrumentation/netty/netty-4.0/javaagent/src/test/groovy/Netty40ServerTest.groovy +++ b/instrumentation/netty/netty-4.0/javaagent/src/test/groovy/Netty40ServerTest.groovy @@ -61,8 +61,10 @@ class Netty40ServerTest extends HttpServerTest implements AgentT def handlers = [new HttpRequestDecoder(), new HttpResponseEncoder()] handlers.each { pipeline.addLast(it) } - pipeline.addLast([ - channelRead0 : { ctx, msg -> + pipeline.addLast(new SimpleChannelInboundHandler() { + + @Override + protected void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception { if (msg instanceof HttpRequest) { def request = msg as HttpRequest def uri = URI.create(request.uri) @@ -109,16 +111,22 @@ class Netty40ServerTest extends HttpServerTest implements AgentT return response } } - }, - exceptionCaught : { ChannelHandlerContext ctx, Throwable cause -> + } + + @Override + void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { ByteBuf content = Unpooled.copiedBuffer(cause.message, CharsetUtil.UTF_8) FullHttpResponse response = new DefaultFullHttpResponse(HTTP_1_1, INTERNAL_SERVER_ERROR, content) response.headers().set(CONTENT_TYPE, "text/plain") response.headers().set(CONTENT_LENGTH, content.readableBytes()) ctx.write(response) - }, - channelReadComplete: { it.flush() } - ] as SimpleChannelInboundHandler) + } + + @Override + void channelReadComplete(ChannelHandlerContext ctx) throws Exception { + ctx.flush() + } + }) } ] as ChannelInitializer).channel(NioServerSocketChannel) bootstrap.bind(port).sync() diff --git a/instrumentation/netty/netty-4.1/javaagent/src/test/groovy/Netty41ServerTest.groovy b/instrumentation/netty/netty-4.1/javaagent/src/test/groovy/Netty41ServerTest.groovy index 8b1a55a00682..79501b00c611 100644 --- a/instrumentation/netty/netty-4.1/javaagent/src/test/groovy/Netty41ServerTest.groovy +++ b/instrumentation/netty/netty-4.1/javaagent/src/test/groovy/Netty41ServerTest.groovy @@ -60,8 +60,10 @@ class Netty41ServerTest extends HttpServerTest implements AgentT def handlers = [new HttpServerCodec()] handlers.each { pipeline.addLast(it) } - pipeline.addLast([ - channelRead0 : { ctx, msg -> + pipeline.addLast(new SimpleChannelInboundHandler() { + + @Override + protected void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception { if (msg instanceof HttpRequest) { def request = msg as HttpRequest def uri = URI.create(request.uri()) @@ -108,16 +110,22 @@ class Netty41ServerTest extends HttpServerTest implements AgentT return response } } - }, - exceptionCaught : { ChannelHandlerContext ctx, Throwable cause -> + } + + @Override + void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { ByteBuf content = Unpooled.copiedBuffer(cause.message, CharsetUtil.UTF_8) FullHttpResponse response = new DefaultFullHttpResponse(HTTP_1_1, INTERNAL_SERVER_ERROR, content) response.headers().set(CONTENT_TYPE, "text/plain") response.headers().set(CONTENT_LENGTH, content.readableBytes()) ctx.write(response) - }, - channelReadComplete: { it.flush() } - ] as SimpleChannelInboundHandler) + } + + @Override + void channelReadComplete(ChannelHandlerContext ctx) throws Exception { + ctx.flush() + } + }) } ] as ChannelInitializer).channel(NioServerSocketChannel) bootstrap.bind(port).sync() diff --git a/settings.gradle.kts b/settings.gradle.kts index a9f884b13752..10b293d7487c 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -10,6 +10,11 @@ pluginManagement { id("org.unbroken-dome.test-sets") version "4.0.0" id("org.xbib.gradle.plugin.jflex") version "1.6.0" } + + repositories { + gradlePluginPortal() + mavenCentral() + } } plugins {