-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
108 lines (95 loc) · 3.25 KB
/
build.gradle.kts
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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.springframework.boot.gradle.tasks.bundling.BootJar
plugins {
kotlin("jvm") version "1.7.0"
id("org.springframework.boot") version "2.7.0"
java
`java-library`
`maven-publish`
signing
}
apply(plugin = "io.spring.dependency-management")
group = "com.beautrace"
version = "1.0.2"
java.sourceCompatibility = JavaVersion.VERSION_1_8
publishing {
publications {
// https://docs.gradle.org/current/userguide/publishing_maven.html
// To make maven-plugin work.
// gradle -i publishToMavenLocal
// It really feels like we shouldn't need to do this.
// This is useless boilerplate just to make it go.
// Whatever happened to "convention"!?!?
create<MavenPublication>("maven") {
from(components["java"])
pom {
name.set("beautrace-spring-servlet")
description.set("A library to trace execution of methods per each Spring Servlet's HTTP request.")
url.set("https://github.com/beautrace/beautrace-spring-servlet")
licenses {
license {
name.set("The MIT License")
url.set("https://opensource.org/licenses/MIT")
}
}
developers {
developer {
name.set("Dima Belousov")
email.set("[email protected]")
}
}
scm {
connection.set("scm:git:git://github.com:beautrace/beautrace-spring-servlet.git")
developerConnection.set("scm:git:ssh://github.com:beautrace/beautrace-spring-servlet.git")
url.set("https://github.com/beautrace/beautrace-spring-servlet/tree/main")
}
}
}
}
repositories {
maven {
name = "OSSRH"
setUrl("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
credentials {
username = System.getenv("OSSRH_USER") ?: return@credentials
password = System.getenv("OSSRH_PASSWORD") ?: return@credentials
}
}
}
}
signing {
val key = System.getenv("SIGNING_KEY") ?: return@signing
val password = System.getenv("SIGNING_PASSWORD") ?: return@signing
val publishing: PublishingExtension by project
useInMemoryPgpKeys(key, password)
sign(publishing.publications)
}
configure<JavaPluginExtension> {
withJavadocJar()
withSourcesJar()
}
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springframework.boot:spring-boot-starter-aop")
// Required for @ConfigurationProperties to work
annotationProcessor("org.springframework.boot:spring-boot-autoconfigure-processor")
testImplementation(kotlin("test"))
}
tasks.withType<BootJar> {
enabled = false
}
tasks.jar {
// Remove `plain` postfix from jar file name
// Required for maven builds to work
archiveClassifier.set("")
}
tasks.test {
useJUnitPlatform()
}
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
}