-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
111 lines (96 loc) · 2.75 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
109
110
111
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id("java-library")
id("org.springframework.boot") version "3.1.0"
id("io.spring.dependency-management") version "1.1.0"
kotlin("jvm") version "1.8.22"
kotlin("plugin.spring") version "1.8.22"
`maven-publish`
signing
}
group = "io.github.buckcri.xclacks"
version = "1.1.0-SNAPSHOT"
java.sourceCompatibility = JavaVersion.VERSION_17
// Spring Boot is only used for testing. Building a boot jar fails because of missing boot application, so we need to disable that task:
tasks.bootJar {
enabled = false
}
tasks.named<Jar>("jar") {
// Unset 'plain' classifier from Spring Boot
archiveClassifier.set("")
}
repositories {
mavenCentral()
}
dependencies {
compileOnly("jakarta.servlet:jakarta.servlet-api:6.0.0")
testImplementation("org.springframework.boot:spring-boot-starter-web")
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("org.springframework.boot:spring-boot-starter-webflux")
testImplementation("org.jetbrains.kotlin:kotlin-test-junit:1.8.22")
}
tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs = listOf("-Xjsr305=strict")
jvmTarget = "17"
}
}
tasks.test {
useJUnitPlatform()
}
java {
withSourcesJar()
withJavadocJar()
}
publishing {
publications {
create<MavenPublication>("maven") {
from(components["java"])
pom {
name.set("XClacks")
description.set("Servlet 3.0 filter adding http header 'X-Clacks-Overhead'")
url.set("https://github.com/buckcri/xclacks")
licenses {
license {
name.set("The MIT License (MIT)")
url.set("https://opensource.org/license/mit/")
}
}
developers {
developer {
id.set("buckcri")
name.set("Christian Buck")
email.set("buckcri@protonmail.com")
}
}
scm {
connection.set("scm:git:git://github.com/buckcri/xclacks.git")
developerConnection.set("scm:git:ssh://github.com/buckcri/xclacks.git")
url.set("https://github.com/buckcri/xclacks/tree/master")
}
repositories {
maven {
val snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
val releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
val ossrhUsername: String? by project
val ossrhPassword: String? by project
name = "OSSRH"
url = uri(if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl)
credentials {
username = ossrhUsername ?: ""
password = ossrhPassword ?: ""
}
}
}
}
}
}
}
signing {
sign(publishing.publications["maven"])
}
tasks.javadoc {
if (JavaVersion.current().isJava9Compatible) {
(options as StandardJavadocDocletOptions).addBooleanOption("html5", true)
}
}