This repository has been archived by the owner on Aug 3, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.gradle.kts
97 lines (81 loc) · 2.87 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
plugins {
id("uk.gov.justice.hmpps.gradle-spring-boot") version "4.2.3"
kotlin("plugin.spring") version "1.6.21"
id("com.google.cloud.tools.jib") version "3.2.1"
}
configurations {
implementation { exclude(module = "tomcat-jdbc") }
implementation { exclude(module = "spring-boot-starter-validation") }
implementation { exclude(module = "spring-boot-graceful-shutdown") }
testImplementation { exclude(group = "org.junit.vintage") }
}
dependencies {
annotationProcessor("org.springframework.boot:spring-boot-configuration-processor")
implementation("org.springframework.boot:spring-boot-starter-webflux")
implementation("org.springframework.boot:spring-boot-starter-security")
implementation("org.springframework.boot:spring-boot-starter-oauth2-client")
implementation("org.springframework.boot:spring-boot-starter-oauth2-resource-server")
implementation("org.springdoc:springdoc-openapi-ui:1.6.9")
implementation("org.springdoc:springdoc-openapi-data-rest:1.6.9")
implementation("org.springdoc:springdoc-openapi-kotlin:1.6.9")
implementation("com.google.code.gson:gson")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
implementation("uk.gov.justice.service.hmpps:hmpps-sqs-spring-boot-starter:1.1.3")
testImplementation("org.awaitility:awaitility-kotlin")
testImplementation("org.springframework.security:spring-security-test")
testImplementation("com.github.tomakehurst:wiremock-standalone:2.27.2")
testImplementation("net.javacrumbs.json-unit:json-unit-assertj:2.35.0")
testImplementation("io.jsonwebtoken:jjwt:0.9.1")
testImplementation("org.testcontainers:localstack:1.17.2")
testImplementation("org.mockito.kotlin:mockito-kotlin:4.0.0")
}
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
}
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<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions {
jvmTarget = "17"
}
}
}
jib {
container {
creationTime = "USE_CURRENT_TIMESTAMP"
jvmFlags = mutableListOf("-Duser.timezone=Europe/London")
mainClass = "uk.gov.justice.digital.hmpps.pollpush.PollPushApplicationKt"
user = "2000:2000"
}
from {
image = "eclipse-temurin:17-jre-alpine"
}
extraDirectories {
paths {
path {
setFrom("${project.buildDir}")
includes.add("agent/agent.jar")
}
path {
setFrom("${project.rootDir}")
includes.add("applicationinsights*.json")
setInto("/agent")
}
}
}
}