Skip to content

Commit d39d7e5

Browse files
kuba-wuanuraagatrask
authored
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 <[email protected]> Co-authored-by: Trask Stalnaker <[email protected]>
1 parent f3d64a4 commit d39d7e5

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

static-instrumenter/maven-plugin/build.gradle.kts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1+
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
2+
13
plugins {
4+
id("com.github.johnrengelman.shadow")
5+
26
id("otel.java-conventions")
37
id("otel.publish-conventions")
48
}
@@ -19,6 +23,14 @@ dependencies {
1923
}
2024

2125
tasks {
26+
processResources {
27+
val agentJar = project(":static-instrumenter:agent-instrumenter").tasks.getByName("shadowJar", ShadowJar::class)
28+
dependsOn(agentJar)
29+
from(agentJar.archiveFile) {
30+
rename { "opentelemetry-agent.jar" }
31+
}
32+
}
33+
2234
withType<JavaCompile>().configureEach {
2335
with(options) {
2436
release.set(11)

static-instrumenter/maven-plugin/src/main/java/io/opentelemetry/contrib/staticinstrumenter/plugin/maven/InstrumentationAgent.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,9 @@
2424

2525
public class InstrumentationAgent {
2626

27-
// TODO: change after the new static-instr capable agent is released
28-
public static final String JAR_FILE_NAME = "opentelemetry-javaagent.jar";
29-
// TODO: change after the new static-instr capable agent is released
30-
public static final String MAIN_CLASS = "io.opentelemetry.javaagent.StaticInstrumenter";
27+
public static final String JAR_FILE_NAME = "opentelemetry-agent.jar";
28+
public static final String MAIN_CLASS =
29+
"io.opentelemetry.contrib.staticinstrumenter.agent.main.Main";
3130

3231
private static final Logger logger = LoggerFactory.getLogger(InstrumentationAgent.class);
3332

Binary file not shown.

0 commit comments

Comments
 (0)