-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
173 lines (146 loc) · 5.01 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
173 lines (146 loc) · 5.01 KB
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
plugins {
id("java-library")
id("org.springframework.boot") version "4.1.0" apply false
id("io.spring.dependency-management") version "1.1.7"
id("com.diffplug.spotless") version "8.8.0"
id("checkstyle")
id("jacoco")
id("com.vanniktech.maven.publish") version "0.34.0"
}
group = "io.github.sequelcore"
version = "7.2.1"
val hasSigningConfiguration = providers.gradleProperty("signingInMemoryKey").isPresent
|| providers.gradleProperty("signing.secretKeyRingFile").isPresent
|| providers.environmentVariable("ORG_GRADLE_PROJECT_signingInMemoryKey").isPresent
java {
toolchain {
languageVersion = JavaLanguageVersion.of(25)
}
}
repositories {
mavenCentral()
}
dependencyManagement {
imports {
mavenBom("org.springframework.boot:spring-boot-dependencies:4.1.0")
}
}
dependencies {
// Spring Boot (provided - user brings these)
compileOnly("org.springframework.boot:spring-boot-starter-security")
compileOnly("org.springframework.boot:spring-boot-starter-web")
// Auto-configuration
implementation("org.springframework.boot:spring-boot-autoconfigure")
implementation("org.springframework.boot:spring-boot-jackson")
annotationProcessor("org.springframework.boot:spring-boot-configuration-processor")
// JWT - api scope exposes Claims, JwtException to consumers
api("io.jsonwebtoken:jjwt-api:0.13.0")
runtimeOnly("io.jsonwebtoken:jjwt-impl:0.13.0")
runtimeOnly("io.jsonwebtoken:jjwt-jackson:0.13.0")
// Cache (for token blacklist)
implementation("com.github.ben-manes.caffeine:caffeine:3.2.4")
// Validation
implementation("jakarta.validation:jakarta.validation-api")
// Lombok
compileOnly("org.projectlombok:lombok")
annotationProcessor("org.projectlombok:lombok")
// Testing
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("org.springframework.boot:spring-boot-starter-webmvc-test")
testImplementation("org.springframework.boot:spring-boot-starter-security")
testImplementation("org.springframework.boot:spring-boot-starter-validation")
testImplementation("org.springframework.security:spring-security-test")
testImplementation("org.springframework.boot:spring-boot-starter-restclient")
testImplementation("org.springframework.boot:spring-boot-resttestclient")
testImplementation("org.springframework.boot:spring-boot-starter-web")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
testCompileOnly("org.projectlombok:lombok")
testAnnotationProcessor("org.projectlombok:lombok")
}
// Spotless configuration (Google Java Format)
spotless {
java {
googleJavaFormat("1.28.0")
removeUnusedImports()
trimTrailingWhitespace()
endWithNewline()
}
}
// Checkstyle configuration
checkstyle {
toolVersion = "13.6.0"
configFile = file("${rootDir}/config/checkstyle/checkstyle.xml")
isIgnoreFailures = false
}
// JaCoCo configuration
jacoco {
toolVersion = "0.8.14"
}
tasks.jacocoTestReport {
dependsOn(tasks.test)
reports {
xml.required = true
html.required = true
}
}
tasks.jacocoTestCoverageVerification {
violationRules {
rule {
limit {
minimum = "0.80".toBigDecimal()
}
}
}
}
tasks.withType<Test> {
useJUnitPlatform()
}
tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
options.compilerArgs.add("-parameters")
}
// Quality check task
tasks.register("qualityCheck") {
dependsOn("spotlessCheck", "checkstyleMain", "test", "jacocoTestCoverageVerification")
description = "Runs all quality checks"
group = "verification"
}
// Maven Central Publishing via vanniktech plugin (v0.34.0+)
mavenPublishing {
publishToMavenCentral(automaticRelease = true)
if (hasSigningConfiguration) {
signAllPublications()
}
coordinates(group.toString(), "vigil-spring-boot-starter", version.toString())
pom {
name.set("Vigil")
description.set("Opinionated JWT authentication starter for Spring Boot")
inceptionYear.set("2025")
url.set("https://github.com/sequelcore/vigil")
licenses {
license {
name.set("Apache License, Version 2.0")
url.set("https://www.apache.org/licenses/LICENSE-2.0")
distribution.set("repo")
}
}
developers {
developer {
id.set("sequelcore")
name.set("Sequel")
url.set("https://github.com/sequelcore")
}
}
scm {
url.set("https://github.com/sequelcore/vigil")
connection.set("scm:git:git://github.com/sequelcore/vigil.git")
developerConnection.set("scm:git:ssh://github.com/sequelcore/vigil.git")
}
}
}
tasks.withType<Javadoc> {
options.encoding = "UTF-8"
if (JavaVersion.current().isJava9Compatible) {
(options as StandardJavadocDocletOptions).addBooleanOption("html5", true)
}
}