moving maven plugin to use agent-instrumeneter (#378)

* moving maven plugin to use agent-instrumeneter

* Better inclusion of agent jar as resource

* Move plugin declaration

Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>
Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
This commit is contained in:
Jakub Wach 2022-08-08 02:08:42 +02:00 committed by GitHub
parent f3d64a4601
commit d39d7e596c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 4 deletions

View File

@ -1,4 +1,8 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
plugins {
id("com.github.johnrengelman.shadow")
id("otel.java-conventions")
id("otel.publish-conventions")
}
@ -19,6 +23,14 @@ dependencies {
}
tasks {
processResources {
val agentJar = project(":static-instrumenter:agent-instrumenter").tasks.getByName("shadowJar", ShadowJar::class)
dependsOn(agentJar)
from(agentJar.archiveFile) {
rename { "opentelemetry-agent.jar" }
}
}
withType<JavaCompile>().configureEach {
with(options) {
release.set(11)

View File

@ -24,10 +24,9 @@ import org.slf4j.LoggerFactory;
public class InstrumentationAgent {
// TODO: change after the new static-instr capable agent is released
public static final String JAR_FILE_NAME = "opentelemetry-javaagent.jar";
// TODO: change after the new static-instr capable agent is released
public static final String MAIN_CLASS = "io.opentelemetry.javaagent.StaticInstrumenter";
public static final String JAR_FILE_NAME = "opentelemetry-agent.jar";
public static final String MAIN_CLASS =
"io.opentelemetry.contrib.staticinstrumenter.agent.main.Main";
private static final Logger logger = LoggerFactory.getLogger(InstrumentationAgent.class);