-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
124 lines (104 loc) · 4.09 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
115
116
117
118
119
120
121
122
123
124
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jooq.meta.jaxb.Property
plugins {
id("org.springframework.boot") version "3.1.0"
id("io.spring.dependency-management") version "1.1.0"
kotlin("jvm") version "1.9.23"
kotlin("plugin.spring") version "1.9.23"
id("nu.studer.jooq") version "8.2.1"
}
group = "de.trusteq"
version = "0.0.1-SNAPSHOT"
java.sourceCompatibility = JavaVersion.VERSION_21
val postgresVersion = "42.6.0"
val flywayVersion = "8.5.11"
val jooqVersion = "3.18.4"
val mockkVersion = "1.13.5"
val springmockkVersion = "4.0.2"
val testcontainersVersion = "1.19.3"
repositories {
mavenCentral()
}
dependencies {
// webflux
implementation("org.springframework.boot:spring-boot-starter-webflux")
// kotlin and coroutines support
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
implementation("io.projectreactor.kotlin:reactor-kotlin-extensions")
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-reactor")
// r2dbc and postgresql
implementation("org.springframework.boot:spring-boot-starter-data-r2dbc")
runtimeOnly("org.postgresql:postgresql:$postgresVersion")
runtimeOnly("org.postgresql:r2dbc-postgresql")
// flyway
implementation("org.flywaydb:flyway-core:$flywayVersion")
// jooq
implementation("org.springframework.boot:spring-boot-starter-jooq")
implementation("org.jooq:jooq-kotlin:$jooqVersion")
jooqGenerator("org.jooq:jooq-meta-extensions:$jooqVersion")
// test dependencies
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("io.projectreactor:reactor-test")
testImplementation("io.mockk:mockk:$mockkVersion")
testImplementation("com.ninja-squad:springmockk:$springmockkVersion")
// testcontainers
testImplementation("org.testcontainers:testcontainers:$testcontainersVersion")
testImplementation("org.testcontainers:junit-jupiter:$testcontainersVersion")
testImplementation("org.testcontainers:postgresql:$testcontainersVersion")
// monitoring
implementation("org.springframework.boot:spring-boot-starter-actuator")
runtimeOnly("io.micrometer:micrometer-registry-prometheus")
}
tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs += "-Xjsr305=strict"
jvmTarget = "21"
}
}
tasks.withType<Test> {
useJUnitPlatform()
}
jooq {
configurations {
create("main") {
jooqConfiguration.apply {
logging = org.jooq.meta.jaxb.Logging.WARN
jdbc = null
generator.apply {
database.apply {
name = "org.jooq.codegen.KotlinGenerator"
name = "org.jooq.meta.extensions.ddl.DDLDatabase"
properties.addAll(
listOf(
Property().apply {
key = "scripts"
value = "src/main/resources/db/migration"
},
Property().apply {
key = "sort"
value = "flyway"
},
Property().apply {
key = "defaultNameCase"
value = "lower"
},
),
)
}
generate.apply {
isPojosAsKotlinDataClasses = true // use data classes
isKotlinNotNullPojoAttributes = true
}
target.apply {
packageName = "de.trusteq.usermanager.jooq"
}
strategy.name = "org.jooq.codegen.DefaultGeneratorStrategy"
}
}
}
}
}
tasks.withType<org.springframework.boot.gradle.tasks.bundling.BootJar> {
archiveFileName.set("server.jar")
}