Skip to content

Commit

Permalink
Remove redundant boms from java (#654)
Browse files Browse the repository at this point in the history
  • Loading branch information
jack-berg authored Jul 24, 2024
1 parent 7679396 commit 9534d42
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
8 changes: 6 additions & 2 deletions getting-started-guides/java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,18 @@ configurations {
agent
}

def otelInstrumentationVersion = "2.6.0-alpha";

dependencies {
implementation platform(SpringBootPlugin.BOM_COORDINATES)
implementation 'org.springframework.boot:spring-boot-starter-web'

implementation("io.opentelemetry:opentelemetry-api:1.40.0")
implementation platform("io.opentelemetry.instrumentation:opentelemetry-instrumentation-bom-alpha:${otelInstrumentationVersion}")
implementation("io.opentelemetry:opentelemetry-api")

// Add OpenTelemetry java agent to the "agent" configuration we previously defined
agent("io.opentelemetry.javaagent:opentelemetry-javaagent:2.6.0")
agent(platform("io.opentelemetry.instrumentation:opentelemetry-instrumentation-bom-alpha:${otelInstrumentationVersion}"))
agent("io.opentelemetry.javaagent:opentelemetry-javaagent")
}

tasks.register("copyAgent", Copy) {
Expand Down
6 changes: 2 additions & 4 deletions other-examples/java/agent-nr-config/application/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ configurations {
dependencies {
implementation 'io.opentelemetry:opentelemetry-api'

agent("io.opentelemetry.javaagent:opentelemetry-javaagent:2.6.0")
agent(platform("io.opentelemetry.instrumentation:opentelemetry-instrumentation-bom-alpha:${project.property('otelInstrumentationVersion')}"))
agent("io.opentelemetry.javaagent:opentelemetry-javaagent")

implementation platform(SpringBootPlugin.BOM_COORDINATES)
implementation 'org.springframework.boot:spring-boot-starter-web'
Expand All @@ -42,9 +43,6 @@ bootRun {

def agentPath = project.buildDir.toString() + "/agent/opentelemetry-javaagent.jar"

println(agentPath)
println(extensionPath)

jvmArgs = [
// Set the opentelemetry-java-instrumentation agent as the javaagent
"-javaagent:${agentPath}",
Expand Down
7 changes: 5 additions & 2 deletions other-examples/java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ plugins {
id 'com.diffplug.spotless' apply false
}

def otelInstrumentationVersion = "2.6.0-alpha";

subprojects {
pluginManager.withPlugin('java') {
apply plugin: 'com.diffplug.spotless'
Expand All @@ -28,9 +30,10 @@ subprojects {
useJUnitPlatform()
}

ext.otelInstrumentationVersion = otelInstrumentationVersion;

dependencies {
implementation platform("io.opentelemetry:opentelemetry-bom-alpha:1.40.0-alpha")
implementation platform("io.opentelemetry.instrumentation:opentelemetry-instrumentation-bom-alpha:2.6.0-alpha")
implementation platform("io.opentelemetry.instrumentation:opentelemetry-instrumentation-bom-alpha:${otelInstrumentationVersion}")
}
}
}
2 changes: 1 addition & 1 deletion other-examples/java/micrometer-shim/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ bootRun {
dependencies {
implementation 'io.opentelemetry:opentelemetry-api'
implementation 'io.opentelemetry:opentelemetry-sdk'
implementation 'io.opentelemetry:opentelemetry-exporter-otlp'

//alpha modules
implementation 'io.opentelemetry.instrumentation:opentelemetry-micrometer-1.5'
implementation 'io.opentelemetry:opentelemetry-exporter-otlp'

//spring modules
implementation platform(SpringBootPlugin.BOM_COORDINATES)
Expand Down

0 comments on commit 9534d42

Please sign in to comment.