generated from ministryofjustice/hmpps-template-kotlin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
85 lines (72 loc) · 2.51 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
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.springframework.boot.gradle.tasks.run.BootRun
plugins {
id("uk.gov.justice.hmpps.gradle-spring-boot") version "6.0.4"
kotlin("plugin.spring") version "2.0.20"
id("org.jetbrains.kotlin.kapt") version "2.0.20"
// TODO: re-enable Detekt when it supports Kotlin 2.0
// id("io.gitlab.arturbosch.detekt") version "1.23.6"
id("org.jetbrains.kotlinx.kover") version "0.8.3"
}
configurations {
testImplementation { exclude(group = "org.junit.vintage") }
}
dependencies {
implementation("org.springframework.boot:spring-boot-starter-webflux")
// OAuth dependencies
implementation("org.springframework.boot:spring-boot-starter-security")
implementation("org.springframework.security:spring-security-oauth2-client")
implementation("org.springframework.boot:spring-boot-starter-oauth2-resource-server")
constraints {
implementation("com.nimbusds:nimbus-jose-jwt:9.40") {
because("previous versions have a high vulnerability CVE-2023-52428")
}
}
// Database dependencies
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
implementation("org.postgresql:postgresql:42.7.4")
implementation("org.flywaydb:flyway-core")
runtimeOnly("org.flywaydb:flyway-database-postgresql")
implementation("com.vladmihalcea:hibernate-types-60:2.21.1")
kapt("org.hibernate:hibernate-jpamodelgen-jakarta:5.6.15.Final")
// OpenAPI dependencies
implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:2.6.0")
// Test dependencies
testImplementation("com.h2database:h2")
testImplementation(kotlin("test"))
testImplementation("com.ninja-squad:springmockk:4.0.2")
testImplementation("io.jsonwebtoken:jjwt-impl:0.12.6")
testImplementation("io.jsonwebtoken:jjwt-jackson:0.12.6")
// Dev dependencies
developmentOnly("org.springframework.boot:spring-boot-devtools")
}
kotlin {
jvmToolchain(21)
}
tasks {
withType<KotlinCompile> {
compilerOptions.jvmTarget = JvmTarget.JVM_21
}
withType<BootRun> {
jvmArgs = listOf(
"-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005",
)
}
}
tasks.register<Test>("unitTests") {
useJUnitPlatform {
excludeTags("integration")
}
}
tasks.register<Test>("integrationTests") {
useJUnitPlatform {
includeTags("integration")
}
}
// TODO: re-enable Detekt when it supports Kotlin 2.0
// detekt {
// config.setFrom("detekt.yml")
// baseline = file("detekt-baseline.xml")
// basePath = "./"
// }