-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
172 lines (135 loc) · 5.23 KB
/
build.gradle
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
import java.time.LocalDate
plugins {
id("uk.gov.justice.hmpps.gradle-spring-boot") version "6.0.8"
id 'java'
id "au.com.dius.pact" version "4.6.14"
}
repositories {
mavenCentral()
}
apply plugin: 'idea'
project.sourceCompatibility = JavaVersion.VERSION_21
project.targetCompatibility = JavaVersion.VERSION_21
group = 'uk.gov.justice.probation'
def todaysDate = LocalDate.now().format('yyyy-MM-dd')
version = System.getenv('CI') ? "${todaysDate}.${System.getenv('CIRCLE_BUILD_NUM')}" : todaysDate
configurations {
compileOnly {
extendsFrom annotationProcessor
}
agentDeps.transitive = false
}
configurations.all {
resolutionStrategy.eachDependency {
DependencyResolveDetails details ->
if (details.requested.group == 'org.codehaus.groovy') {
details.useVersion "3.0.2"
details.because "needed by rest-assured>=4.3"
}
}
}
bootJar {
manifest = jar.manifest
}
jar {
enabled = false // we use the boot JAR. Including this after Spring boot 2.5.0 caused issues
manifest {
attributes(
'Implementation-Title': rootProject.name, 'Implementation-Version': version
)
}
}
ext {
restAssuredVersion = '5.5.0'
}
dependencies {
implementation("uk.gov.justice.service.hmpps:hmpps-sqs-spring-boot-starter:5.1.1")
annotationProcessor "org.springframework.boot:spring-boot-configuration-processor"
annotationProcessor 'org.projectlombok:lombok'
runtimeOnly 'org.springframework.boot:spring-boot-devtools'
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 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.17.2' //matches the jackson version brought in by uk.gov.justice.hmpps.gradle-spring-boot
api("software.amazon.awssdk:s3")
implementation 'org.projectlombok:lombok:1.18.24'
implementation 'org.springframework.boot:spring-boot-starter-webflux'
implementation 'org.projectreactor:reactor-spring:1.0.1.RELEASE'
implementation 'jakarta.validation:jakarta.validation-api:3.1.0'
testRuntimeOnly("org.junit.jupiter:junit-jupiter")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-params")
testRuntimeOnly("org.junit.platform:junit-platform-launcher") {
because 'allows tests to run from IDEs that bundle older version of launcher'
}
testImplementation 'io.projectreactor:reactor-test'
testImplementation 'net.javacrumbs.json-unit:json-unit-assertj:3.4.1'
testImplementation 'org.awaitility:awaitility:4.2.2'
testImplementation "io.rest-assured:rest-assured:$restAssuredVersion"
testImplementation "io.rest-assured:json-path:$restAssuredVersion"
testImplementation "io.rest-assured:xml-path:$restAssuredVersion"
testImplementation "com.github.tomakehurst:wiremock-jre8-standalone:3.0.1"
testAnnotationProcessor 'org.projectlombok:lombok'
testImplementation 'au.com.dius.pact.consumer:junit5:4.6.15'
testImplementation 'org.apache.httpcomponents:fluent-hc:4.5.13'
}
test {
useJUnitPlatform()
testLogging {
events "started", "passed", "skipped", "failed", "standardError"
exceptionFormat "short"
showStackTraces = true
showExceptions = true
showCauses = true
afterSuite { desc, result ->
if (!desc.parent) { // will match the outermost suite
println "Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} successes, ${result.failedTestCount} failures, ${result.skippedTestCount} skipped)"
}
}
}
filter{
excludeTestsMatching "*IntTest*"
excludeTestsMatching "*PactTest*"
}
}
task pactTest(type: Test) {
useJUnitPlatform()
filter{
includeTestsMatching "*PactTest*"
}
}
task integrationTest(type: Test) {
useJUnitPlatform ()
testLogging {
events "started", "passed", "skipped", "failed", "standardError"
exceptionFormat "short"
showStackTraces = true
showExceptions = true
showCauses = true
afterSuite { desc, result ->
if (!desc.parent) { // will match the outermost suite
println "Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} successes, ${result.failedTestCount} failures, ${result.skippedTestCount} skipped)"
}
}
}
filter {
includeTestsMatching '*IntTest*'
excludeTestsMatching "*PactTest*"
excludeTestsMatching '*WIP*'
}
}
task copyAgentConfig(type: Copy) {
from "applicationinsights.json"
into "$buildDir/libs"
}
pact {
publish {
pactBrokerUrl = System.getenv("PACTBROKER_URL")
pactBrokerUsername = System.getenv("PACTBROKER_AUTH_USERNAME")
pactBrokerPassword = System.getenv("PACTBROKER_AUTH_PASSWORD")
pactDirectory = 'build/pacts'
consumerVersion = System.getenv("PACTCONSUMER_VERSION")
tags = (System.getenv("PACTCONSUMER_TAGS") ?: "main").split(",")
}
}
assemble.dependsOn copyAgent
assemble.dependsOn copyAgentConfig