|
| 1 | +plugins { |
| 2 | + application |
| 3 | + id("com.github.johnrengelman.shadow") |
| 4 | + |
| 5 | + id("otel.groovy-conventions") |
| 6 | + id("otel.publish-conventions") |
| 7 | +} |
| 8 | + |
| 9 | +description = "JMX metrics gathering Groovy script runner" |
| 10 | + |
| 11 | +application.mainClass.set("io.opentelemetry.contrib.jmxmetrics.JmxMetrics") |
| 12 | + |
| 13 | +repositories { |
| 14 | + mavenCentral() |
| 15 | + maven { |
| 16 | + setUrl("https://repo.terracotta.org/maven2") |
| 17 | + content { |
| 18 | + includeGroupByRegex("""org\.terracotta.*""") |
| 19 | + } |
| 20 | + } |
| 21 | + mavenLocal() |
| 22 | +} |
| 23 | + |
| 24 | +val groovyVersion = "2.5.11" |
| 25 | + |
| 26 | +dependencies { |
| 27 | + api(platform("org.codehaus.groovy:groovy-bom:${groovyVersion}")) |
| 28 | + |
| 29 | + implementation("io.grpc:grpc-netty-shaded") |
| 30 | + implementation("org.codehaus.groovy:groovy-jmx") |
| 31 | + implementation("org.codehaus.groovy:groovy") |
| 32 | + implementation("io.prometheus:simpleclient") |
| 33 | + implementation("io.prometheus:simpleclient_httpserver") |
| 34 | + implementation("io.opentelemetry:opentelemetry-api") |
| 35 | + implementation("io.opentelemetry:opentelemetry-api-metrics") |
| 36 | + implementation("io.opentelemetry:opentelemetry-sdk") |
| 37 | + implementation("io.opentelemetry:opentelemetry-sdk-metrics") |
| 38 | + implementation("io.opentelemetry:opentelemetry-sdk-extension-autoconfigure") |
| 39 | + implementation("io.opentelemetry:opentelemetry-sdk-testing") |
| 40 | + implementation("io.opentelemetry:opentelemetry-exporter-logging") |
| 41 | + implementation("io.opentelemetry:opentelemetry-exporter-otlp-metrics") |
| 42 | + implementation("io.opentelemetry:opentelemetry-exporter-prometheus") |
| 43 | + implementation("org.slf4j:slf4j-api") |
| 44 | + implementation("org.slf4j:slf4j-simple") |
| 45 | + |
| 46 | + runtimeOnly("org.terracotta:jmxremote_optional-tc:1.0.8") |
| 47 | + |
| 48 | + testImplementation("io.grpc:grpc-api") |
| 49 | + testImplementation("io.grpc:grpc-protobuf") |
| 50 | + testImplementation("io.grpc:grpc-stub") |
| 51 | + testImplementation("io.grpc:grpc-testing") |
| 52 | + testImplementation("org.codehaus.groovy:groovy-test") |
| 53 | + testImplementation("io.rest-assured:rest-assured:4.2.0") |
| 54 | + testImplementation("org.awaitility:awaitility") |
| 55 | + testImplementation("org.apache.httpcomponents.client5:httpclient5-fluent:5.0.1") |
| 56 | + testImplementation("org.testcontainers:testcontainers") |
| 57 | + testImplementation("io.opentelemetry:opentelemetry-proto") |
| 58 | +} |
| 59 | + |
| 60 | +tasks { |
| 61 | + shadowJar { |
| 62 | + // This should always be standalone, so remove "-all" to prevent unnecessary artifact. |
| 63 | + archiveClassifier.set("") |
| 64 | + } |
| 65 | + |
| 66 | + withType<Test>().configureEach { |
| 67 | + dependsOn(shadowJar) |
| 68 | + systemProperty("shadow.jar.path", shadowJar.get().archiveFile.get().asFile.absolutePath) |
| 69 | + } |
| 70 | +} |
0 commit comments