-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.gradle
134 lines (111 loc) · 3.73 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
plugins {
id "java"
id "jacoco"
id "io.spring.dependency-management" version "1.0.11.RELEASE"
}
apply plugin: "java-library"
apply plugin: "maven"
apply plugin: "signing"
ext { springBootVersion = "2.4.4" }
group "com.github.mikesafonov"
version "1.0.0"
sourceCompatibility = 1.8
[compileJava, compileTestJava]*.options*.encoding = "UTF-8"
repositories {
mavenCentral()
}
dependencyManagement {
imports { mavenBom("org.springframework.boot:spring-boot-dependencies:${springBootVersion}") }
}
jar {
enabled = true
}
configurations {
compile.exclude module: "spring-boot-starter-logging"
}
dependencies {
implementation ("org.springframework.boot:spring-boot-starter")
implementation ("org.springframework.boot:spring-boot-starter-web")
compileOnly ("org.springframework.boot:spring-boot-configuration-processor")
implementation("org.slf4j:slf4j-api")
compileOnly ("org.projectlombok:lombok")
annotationProcessor ("org.projectlombok:lombok")
testImplementation ("org.springframework.boot:spring-boot-starter-test")
testImplementation ("org.mockito:mockito-core")
testImplementation ("org.assertj:assertj-core:3.19.0")
}
task sourceJar(type: Jar) {
classifier "sources"
from sourceSets.main.allJava
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier "javadoc"
from javadoc.destinationDir
}
artifacts {
archives sourceJar
archives javadocJar
}
signing {
sign configurations.archives
}
jacoco {
toolVersion = "0.8.3"
}
test {
useJUnitPlatform()
finalizedBy jacocoTestReport
}
jacocoTestReport {
reports {
xml.enabled true
csv.enabled false
}
}
// Build, sign, and upload
uploadArchives {
repositories {
mavenDeployer {
// Sign POM
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
// Destination
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2") {
authentication(userName: sonatypeUsername, password: sonatypePassword)
}
// Add required metadata to POM
pom.project {
name "spring-boot-starter-prometheus-alerts"
packaging "jar"
description "Starter for spring boot application witch catch alerts from Prometheus Alertmanager"
url "https://github.com/MikeSafonov/spring-boot-starter-prometheus-alerts"
organization {
name "com.github.mikesafonov"
url "https://github.com/MikeSafonov"
}
issueManagement {
system "GitHub"
url "https://github.com/MikeSafonov/spring-boot-starter-prometheus-alerts/issues"
}
licenses {
license {
name "MIT"
url "https://github.com/MikeSafonov/spring-boot-starter-prometheus-alerts/blob/master/LICENSE"
distribution "repo"
}
}
scm {
url "https://github.com/MikeSafonov/spring-boot-starter-prometheus-alerts"
connection "scm:git:git://github.com/MikeSafonov/spring-boot-starter-prometheus-alerts.git"
developerConnection "scm:git:ssh://[email protected]:MikeSafonov/spring-boot-starter-prometheus-alerts.git"
}
developers {
developer {
name "Mike Safonov"
organization "com.github.mikesafonov"
organizationUrl "https://github.com/MikeSafonov"
}
}
}
}
}
}