plugins { id "com.github.johnrengelman.shadow" } apply from: "$rootDir/gradle/java.gradle" dependencies { compile deps.opentelemetrySdk } // OpenTelemetry SDK with shaded dependencies so that they do not conflict with other libraries (in particular guava) // when running various instrumentation tests (e.g. datastax-cassandra) // TODO this is not ideal because tests are run using this partially shaded OpenTelemetry SDK, while the agent ends up // running with unshaded OpenTelemetry SDK (because its in isolated class loader at that point) // build auto-tooling-and-instrumentation.isolated and use that in tests, then wouldn't need to shade guava, etc shadowJar { dependencies { exclude(dependency('io.opentelemetry:opentelemetry-api')) } mergeServiceFiles() relocate "com.google", "io.opentelemetry.auto.shaded.com.google" relocate "javax.annotation", "io.opentelemetry.auto.shaded.javax.annotation" relocate "org.checkerframework", "io.opentelemetry.auto.shaded.org.checkerframework" relocate "org.codehaus", "io.opentelemetry.auto.shaded.org.codehaus" // this is brought by OpenTelemetry API exclude "io/grpc/**" exclude 'META-INF/maven/**' exclude 'org/codehaus/mojo/animal_sniffer/**' // this is Java 8 bytecode }