-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
144 lines (119 loc) · 4.29 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
135
136
137
138
139
140
141
142
143
144
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id "idea"
id "java-library"
id "maven-publish"
id "signing"
id "org.springframework.boot" version "3.3.3"
id "org.jetbrains.kotlin.jvm" version "2.0.20"
id "org.jetbrains.kotlin.kapt" version "2.0.20"
id "io.spring.dependency-management" version "1.1.6"
}
group "io.viascom.devutils"
version "0.0.2"
java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
tasks.bootJar { enabled = false }
tasks.jar { enabled = true }
jar {
// Remove `plain` postfix from jar file name
archiveClassifier.set("")
}
java {
withJavadocJar()
withSourcesJar()
}
springBoot {
buildInfo()
}
repositories {
mavenCentral()
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib"
implementation "org.jetbrains.kotlin:kotlin-reflect"
compileOnly "org.springframework.boot:spring-boot-starter-web"
compileOnly "org.springframework.boot:spring-boot-starter-security"
compileOnly "org.springframework.boot:spring-boot-starter-data-jpa"
kapt "org.springframework.boot:spring-boot-configuration-processor"
testImplementation "org.springframework.boot:spring-boot-starter-test"
testImplementation "org.springframework.boot:spring-boot-starter-web"
testImplementation "org.springframework.boot:spring-boot-starter-security"
developmentOnly "org.springframework.boot:spring-boot-devtools"
}
test {
useJUnitPlatform()
}
tasks.withType(KotlinCompile).configureEach {
kotlinOptions {
freeCompilerArgs += '-Xjsr305=strict'
jvmTarget = '21'
}
}
//Wait for files from processResources and bootBuildInfo
compileKotlin.inputs.files(processResources, bootBuildInfo)
classes {
doLast {
// Copy generated spring-configuration-metadata.json into jar resources
file("build/tmp/kapt3/classes/main/META-INF/spring-configuration-metadata.json").renameTo(file("build/resources/main/META-INF/spring-configuration-metadata.json"))
}
}
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
publishing {
repositories {
maven {
def releaseRepo = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotRepo = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
url = isReleaseVersion ? releaseRepo : snapshotRepo
credentials {
username = findProperty("ossrhUsername") ?: System.getenv("OSSRH_USERNAME")
password = findProperty("ossrhPassword") ?: System.getenv("OSSRH_PASSWORD")
}
}
}
publications {
mavenJava(MavenPublication) {
from components.java
pom {
groupId = 'io.viascom.devutils'
name = 'spring-boot-starter-maintenance'
description = 'Maintenance mode library for spring boot web and security projects.'
url = 'https://github.com/viascom/spring-boot-starter-maintenance'
packaging = 'jar'
licenses {
license {
name = 'The Unlicense'
url = 'https://unlicense.org/'
}
}
scm {
url = 'https://github.com/viascom/spring-boot-starter-maintenance'
connection = 'scm:git://github.com:viascom/spring-boot-starter-maintenance.git'
developerConnection = 'scm:git://github.com:viascom/spring-boot-starter-maintenance.git'
}
developers {
developer {
id = 'nik-sta'
name = 'Nikola Stankovic'
email = '[email protected]'
organizationUrl = 'https://viascom.io/'
}
developer {
id = 'itsmefox'
name = 'Patrick Bösch'
email = '[email protected]'
organizationUrl = 'https://viascom.io/'
}
}
}
}
}
}
signing {
sign publishing.publications.mavenJava
}
tasks.withType(Sign).configureEach {
onlyIf { isReleaseVersion }
}