This repository has been archived by the owner on Mar 9, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle
57 lines (50 loc) · 1.6 KB
/
build.gradle
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
plugins {
id 'java-library'
id 'com.github.johnrengelman.shadow' version '5.2.0'
id 'maven-publish'
}
repositories {
mavenCentral()
}
dependencies {
implementation 'io.micrometer:micrometer-registry-prometheus:latest.release'
testImplementation 'io.javalin:javalin:latest.release'
testRuntimeOnly 'ch.qos.logback:logback-classic:latest.release'
}
jar {
manifest {
attributes(
'Agent-Class': 'io.micrometer.agent.prometheus.PrometheusAgent',
'Premain-Class': 'io.micrometer.agent.prometheus.PrometheusAgent'
)
}
}
shadowJar {
configurations = [project.configurations.compileClasspath, project.configurations.compileOnly]
archiveClassifier = null
dependencies {
include(dependency('io.micrometer:'))
include(dependency('io.prometheus:'))
}
relocate 'io.micrometer.core', 'io.micrometer.shaded.micrometer.core'
relocate 'io.micrometer.prometheus', 'io.micrometer.shaded.micrometer.prometheus'
relocate 'io.prometheus', 'io.micrometer.shaded.prometheus'
}
jar.enabled = false
jar.dependsOn shadowJar
publishing {
publications {
withType(MavenPublication) {
artifact(shadowJar)
pom.withXml {
asNode()
.dependencies
.dependency
.findAll {
['micromter-registry-prometheus', 'micrometer-core', 'simpleclient_common'].contains(it.artifactId.text())
}
.each { it.parent().remove(it) }
}
}
}
}