forked from open-telemetry/opentelemetry-java-examples
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
42 lines (31 loc) · 1.11 KB
/
build.gradle.kts
File metadata and controls
42 lines (31 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import org.springframework.boot.gradle.plugin.SpringBootPlugin
import org.springframework.boot.gradle.tasks.bundling.BootJar
plugins {
id("java")
id("org.springframework.boot") version "3.5.7"
}
description = "OpenTelemetry Example for Java Agent"
val moduleName by extra { "io.opentelemetry.examples.javagent" }
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}
val agent = configurations.create("agent")
dependencies {
implementation(platform(SpringBootPlugin.BOM_COORDINATES))
implementation("io.opentelemetry:opentelemetry-api")
//spring modules
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springframework.boot:spring-boot-starter-actuator")
agent("io.opentelemetry.javaagent:opentelemetry-javaagent:2.21.0")
}
val copyAgent = tasks.register<Copy>("copyAgent") {
from(agent.singleFile)
into(layout.buildDirectory.dir("agent"))
rename("opentelemetry-javaagent-.*\\.jar", "opentelemetry-javaagent.jar")
}
tasks.named<BootJar>("bootJar") {
dependsOn(copyAgent)
archiveFileName = "app.jar"
}