Fix compilation failure on main
* Fix compilation failure on main
* Fix muzzle (probably)
* Fix muzzle (probably)
* Fix muzzle (probably)
* Fix muzzle (probably)
* Remove unnecessary dependency
* Revert "Remove unnecessary dependency"
This reverts commit
* spotless + random change in javaagent-tooling
MODIFY
buildSrc/src/main/groovy/MuzzlePlugin.groovy
buildSrc/src/main/groovy/MuzzlePlugin.groovy
@@ -51,6 +51,7 @@ class MuzzlePlugin implements Plugin<Project> {
def compileMuzzle = project.task('compileMuzzle') {
dependsOn(':javaagent-bootstrap:classes')
dependsOn(':javaagent-tooling:classes')
+ dependsOn(':javaagent-extension-api:classes')
dependsOn(project.tasks.classes)
}

MODIFY
gradle/instrumentation.gradle
gradle/instrumentation.gradle
@@ -46,6 +46,11 @@ afterEvaluate {
exclude group: 'io.opentelemetry', module: 'opentelemetry-sdk'
exclude group: 'io.opentelemetry', module: 'opentelemetry-sdk-metrics'
}
+ compileOnly(project(':javaagent-tooling')) {
+ // OpenTelemetry SDK is not needed for compilation
+ exclude group: 'io.opentelemetry', module: 'opentelemetry-sdk'
+ exclude group: 'io.opentelemetry', module: 'opentelemetry-sdk-metrics'
+ }
compileOnly deps.bytebuddy
annotationProcessor deps.autoservice
compileOnly deps.autoservice

MODIFY
instrumentation/external-annotations/javaagent-unit-tests/external-annotations-javaagent-unittests.gradle
instrumentation/external-annotations/javaagent-unit-tests/external-annotations-javaagent-unittests.gradle
@@ -3,6 +3,7 @@ apply from: "$rootDir/gradle/java.gradle"
dependencies {
testImplementation project(':instrumentation-api')
testImplementation project(':javaagent-extension-api')
+ testImplementation project(':javaagent-tooling')
testImplementation deps.bytebuddy
testImplementation project(':instrumentation:external-annotations:javaagent')
}

MODIFY
instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-cxf-3.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jaxrs/v2_0/CxfJaxRsInvokerInstrumentation.java
instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-cxf-3.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jaxrs/v2_0/CxfJaxRsInvokerInstrumentation.java
@@ -11,7 +11,7 @@ import static net.bytebuddy.matcher.ElementMatchers.takesArgument;
import io.opentelemetry.context.Context;
import io.opentelemetry.context.Scope;
-import io.opentelemetry.javaagent.tooling.TypeInstrumentation;
+import io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation;
import java.util.Map;
import net.bytebuddy.asm.Advice;
import net.bytebuddy.description.method.MethodDescription;

MODIFY
instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-jersey-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jaxrs/v2_0/JerseyResourceMethodDispatcherInstrumentation.java
instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-jersey-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jaxrs/v2_0/JerseyResourceMethodDispatcherInstrumentation.java
@@ -9,7 +9,7 @@ import static java.util.Collections.singletonMap;
import static net.bytebuddy.matcher.ElementMatchers.named;
import static net.bytebuddy.matcher.ElementMatchers.takesArgument;
-import io.opentelemetry.javaagent.tooling.TypeInstrumentation;
+import io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation;
import java.util.Map;
import javax.ws.rs.core.Request;
import net.bytebuddy.asm.Advice;

MODIFY
javaagent-extension-api/javaagent-extension-api.gradle
javaagent-extension-api/javaagent-extension-api.gradle
@@ -27,4 +27,6 @@ dependencies {
implementation project(":javaagent-api")
// TODO: ideally this module should not depend on bootstrap, bootstrap should be an internal component
implementation project(":javaagent-bootstrap")
+
+ instrumentationMuzzle sourceSets.main.output
}
\ No newline at end of file

MODIFY
javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/muzzle/matcher/MuzzleGradlePluginUtil.java
javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/muzzle/matcher/MuzzleGradlePluginUtil.java
@@ -82,7 +82,7 @@ public final class MuzzleGradlePluginUtil {
validatedModulesCount++;
}
- // run helper injector on all instrumenters
+ // run helper injector on all instrumentation modules
if (assertPass) {
for (InstrumentationModule instrumentationModule :
ServiceLoader.load(InstrumentationModule.class, agentClassLoader)) {

Fix compilation failure on main (#2926)

* Fix compilation failure on main

* Fix muzzle (probably)

* Fix muzzle (probably)

* Fix muzzle (probably)

* Fix muzzle (probably)

* Remove unnecessary dependency

* Revert "Remove unnecessary dependency"

This reverts commit 3fc1e68c99aa6c4d2ebccbb3dfebd3835e2479d2.

* spotless + random change in javaagent-tooling