-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle.kts
106 lines (94 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id("uk.gov.justice.hmpps.gradle-spring-boot") version "7.1.3"
kotlin("plugin.spring") version "2.1.10"
id("com.google.cloud.tools.jib") version "3.4.4"
}
configurations {
implementation { exclude(group = "tomcat-jdbc") }
}
dependencies {
annotationProcessor("org.springframework.boot:spring-boot-configuration-processor")
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-webflux")
implementation("org.springframework.data:spring-data-jpa")
implementation("io.jsonwebtoken:jjwt-impl:0.12.6")
implementation("io.jsonwebtoken:jjwt-jackson:0.12.6")
implementation("org.opensearch.client:spring-data-opensearch-starter:1.6.2")
implementation("org.opensearch.client:opensearch-java:2.21.0")
implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:2.8.5")
implementation("io.sentry:sentry-spring-boot-starter-jakarta:8.3.0")
implementation("uk.gov.justice.service.hmpps:hmpps-sqs-spring-boot-starter:5.3.2")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.1")
implementation("io.opentelemetry.instrumentation:opentelemetry-instrumentation-annotations:2.13.3")
implementation("io.opentelemetry:opentelemetry-extension-kotlin")
testImplementation("org.springframework.security:spring-security-test")
testImplementation("com.github.tomakehurst:wiremock-jre8-standalone:3.0.1")
testImplementation("net.javacrumbs.json-unit:json-unit-assertj:4.1.0")
testImplementation("org.awaitility:awaitility-kotlin")
testImplementation("io.rest-assured:json-path")
testImplementation("io.rest-assured:xml-path")
testImplementation("io.rest-assured:spring-mock-mvc")
testImplementation("io.swagger.parser.v3:swagger-parser-v3:2.1.25")
}
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
}
tasks {
val copyAgentJar by registering(Copy::class) {
from("${project.buildDir}/libs")
include("applicationinsights-agent*.jar")
into("${project.buildDir}/agent")
rename("applicationinsights-agent(.+).jar", "agent.jar")
dependsOn("assemble")
}
val jib by getting {
dependsOn += copyAgentJar
}
val jibBuildTar by getting {
dependsOn += copyAgentJar
}
val jibDockerBuild by getting {
dependsOn += copyAgentJar
}
withType<KotlinCompile> {
kotlinOptions {
jvmTarget = "21"
}
}
test {
maxHeapSize = "256m"
}
}
jib {
container {
creationTime.set("USE_CURRENT_TIMESTAMP")
jvmFlags = mutableListOf("-Duser.timezone=Europe/London")
mainClass = "uk.gov.justice.hmpps.probationsearch.OffenderSearchApplicationKt"
user = "2000:2000"
}
from {
image = "eclipse-temurin:21-jre-alpine"
}
extraDirectories {
paths {
path {
setFrom("${project.buildDir}")
includes.add("agent/agent.jar")
}
path {
setFrom("${project.rootDir}")
includes.add("applicationinsights*.json")
into = "/agent"
}
}
}
}
// Disable ktlint in favour of IntelliJ formatting
configure<org.jlleitschuh.gradle.ktlint.KtlintExtension> {
filter {
exclude("**/*")
}
}