-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
114 lines (91 loc) · 3.31 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
112
113
114
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
plugins {
val kotlinVersion = "1.9.10"
id("org.springframework.boot") version "3.1.4"
id("io.spring.dependency-management") version "1.1.3"
kotlin("jvm") version kotlinVersion
kotlin("plugin.spring") version kotlinVersion
}
group = "com.leijendary.spring"
version = "1.0.0"
description = "Spring Boot API Gateway Template for the Microservice Architecture or general purpose"
java {
sourceCompatibility = JavaVersion.VERSION_20
}
kotlin {
compilerOptions {
apiVersion.set(KotlinVersion.KOTLIN_2_0)
freeCompilerArgs.addAll("-Xjsr305=strict", "-Xjvm-default=all", "-Xjvm-enable-preview")
languageVersion.set(KotlinVersion.KOTLIN_2_0)
jvmTarget.set(JvmTarget.JVM_20)
}
}
configurations {
compileOnly {
extendsFrom(configurations.annotationProcessor.get())
}
testImplementation {
exclude(group = "org.junit.vintage", module = "junit-vintage-engine")
}
}
repositories {
mavenCentral()
}
dependencies {
// Kotlin
implementation(kotlin("reflect"))
implementation(kotlin("stdlib-jdk8"))
testImplementation(kotlin("test"))
// Spring Boot Starter
implementation("org.springframework.boot:spring-boot-starter-actuator")
implementation("org.springframework.boot:spring-boot-starter-data-redis-reactive")
// Spring Cloud Starter
implementation("org.springframework.cloud:spring-cloud-starter-gateway")
implementation("org.springframework.cloud:spring-cloud-starter-loadbalancer")
// Spring Test
testImplementation("org.springframework.boot:spring-boot-starter-test")
// Spring Security
implementation("org.springframework.security:spring-security-oauth2-jose")
testImplementation("org.springframework.security:spring-security-test")
// Cache
implementation("com.github.ben-manes.caffeine:caffeine")
// Devtools
developmentOnly("org.springframework.boot:spring-boot-devtools")
annotationProcessor("org.springframework.boot:spring-boot-configuration-processor")
// Jackson
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
// OpenAPI
implementation("org.springdoc:springdoc-openapi-starter-webflux-ui:2.1.0")
// Tracing
implementation("com.github.loki4j:loki-logback-appender:1.4.1")
implementation("io.micrometer:micrometer-registry-prometheus")
implementation("io.micrometer:micrometer-tracing-bridge-otel")
implementation("io.opentelemetry:opentelemetry-exporter-otlp")
// Test
testImplementation("org.mockito.kotlin:mockito-kotlin:4.1.0")
testImplementation("org.mockito:mockito-inline:5.2.0")
// Test Containers
testImplementation("org.testcontainers:junit-jupiter")
}
dependencyManagement {
imports {
mavenBom("io.micrometer:micrometer-tracing-bom:1.1.2")
mavenBom("org.springframework.cloud:spring-cloud-dependencies:2022.0.3")
mavenBom("org.testcontainers:testcontainers-bom:1.18.3")
}
}
tasks {
compileJava {
options.compilerArgs.add("--enable-preview")
}
test {
jvmArgs = listOf("--enable-preview")
useJUnitPlatform()
}
processResources {
filesMatching("application.yaml") {
expand(project.properties)
}
}
}