generated from ministryofjustice/hmpps-template-kotlin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
128 lines (107 loc) · 4.33 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
125
126
127
128
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id("uk.gov.justice.hmpps.gradle-spring-boot") version "6.0.9"
`jvm-test-suite`
kotlin("plugin.spring") version "2.0.21"
kotlin("plugin.jpa") version "2.0.21"
}
configurations {
testImplementation { exclude(group = "org.junit.vintage") }
}
dependencies {
val kotestVersion = "5.9.1"
val springdocVersion = "2.6.0"
val sentryVersion = "7.18.0"
val jsonWebtokenVersion = "0.12.6"
val springSecurityVersion = "6.4.0"
implementation("uk.gov.justice.service.hmpps:hmpps-kotlin-spring-boot-starter:1.0.8")
// Override netty-common version to address https://osv.dev/vulnerability/GHSA-xq3w-v528-46rv
implementation("io.netty:netty-common:4.1.115.Final")
runtimeOnly("org.postgresql:postgresql:42.7.4")
implementation("org.springframework.boot:spring-boot-starter-webflux")
implementation("org.springframework.boot:spring-boot-starter-security")
implementation("org.springframework.boot:spring-boot-starter-oauth2-resource-server")
implementation("org.springframework.boot:spring-boot-starter-oauth2-client")
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-csv")
implementation("com.google.guava:guava:33.3.1-jre")
implementation("io.sentry:sentry-spring-boot-starter-jakarta:$sentryVersion")
implementation("io.sentry:sentry-logback:$sentryVersion")
implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:$springdocVersion")
implementation("uk.gov.justice.service.hmpps:hmpps-sqs-spring-boot-starter:5.1.1")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.9.0")
runtimeOnly("org.flywaydb:flyway-database-postgresql")
testImplementation("com.h2database:h2")
testImplementation("io.kotest:kotest-assertions-core:$kotestVersion")
testImplementation("com.ninja-squad:springmockk:4.0.2")
testImplementation("io.jsonwebtoken:jjwt-api:$jsonWebtokenVersion")
testImplementation("io.jsonwebtoken:jjwt-impl:$jsonWebtokenVersion")
testImplementation("io.jsonwebtoken:jjwt-orgjson:$jsonWebtokenVersion")
testImplementation("au.com.dius.pact.provider:junit5spring:4.6.15")
testImplementation("org.springframework.security:spring-security-test:$springSecurityVersion")
testImplementation("org.wiremock:wiremock-standalone:3.9.2")
testImplementation("org.awaitility:awaitility-kotlin")
testImplementation("org.testcontainers:testcontainers:1.20.4")
testImplementation("org.testcontainers:postgresql:1.20.4")
testImplementation("org.testcontainers:junit-jupiter:1.20.4")
testImplementation("org.jetbrains.kotlin:kotlin-test")
}
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
}
kotlin {
kotlinDaemonJvmArgs = listOf("-Xmx2g")
jvmToolchain(21)
}
testing {
suites {
val test by getting(JvmTestSuite::class) {
useJUnitJupiter()
targets {
all {
testTask.configure {
// Uncomment this next line if you need to debug tests in CI
// testLogging.showStandardStreams = true
maxParallelForks = 1
environment["pact_do_not_track"] = "true"
environment["pact.provider.tag"] = environment["PACT_PROVIDER_TAG"]
environment["pact.provider.version"] = environment["PACT_PROVIDER_VERSION"]
environment["pact.verifier.publishResults"] = environment["PACT_PUBLISH_RESULTS"] ?: "false"
}
}
}
}
}
}
tasks {
withType<KotlinCompile> {
kotlinOptions {
jvmTarget = "21"
}
kotlin.sourceSets["main"].kotlin.srcDir(layout.buildDirectory.dir("generated/src/main/kotlin"))
kotlin.sourceSets["main"].kotlin.srcDir(layout.buildDirectory.dir("generated/src/main/resources"))
}
register("bootRunLocal") {
group = "application"
description = "Runs this project as a Spring Boot application with the local profile"
doFirst {
bootRun.configure {
systemProperty("spring.profiles.active", "local,dev,seed")
}
}
finalizedBy("bootRun")
}
}
ktlint {
filter {
val openApiGeneratedSrcPath = layout.buildDirectory.dir("generated").get().asFile.path
exclude { it.file.startsWith(openApiGeneratedSrcPath) }
}
}
allOpen {
annotations(
"jakarta.persistence.Entity",
"jakarta.persistence.MappedSuperclass",
"jakarta.persistence.Embeddable",
)
}