generated from hmcts/spring-boot-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
160 lines (132 loc) · 4.09 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
plugins {
id 'checkstyle'
id 'java-library'
id 'maven-publish'
id 'io.spring.dependency-management' version '1.1.5'
id 'org.springframework.boot' version '3.3.0'
id 'uk.gov.hmcts.java' version '0.12.62'
id 'com.github.ben-manes.versions' version '0.51.0'
}
def versions = [
junit : '5.10.2',
lombok : '1.18.32',
springCloud : '2023.0.2'
]
def buildNumber = System.getenv("RELEASE_VERSION")?.replace("refs/tags/", "") ?: "1.0.0"
group 'uk.gov.hmcts.reform'
version buildNumber
dependencyUpdates.resolutionStrategy = {
componentSelection { rules ->
rules.all { ComponentSelection selection ->
boolean rejected = ['alpha', 'beta', 'rc', 'cr', 'm'].any { qualifier ->
selection.candidate.version ==~ /(?i).*[.-]${qualifier}[.\d-]*/
}
if (rejected) {
selection.reject('Release candidate')
}
}
}
}
allprojects {
sourceCompatibility = '11'
targetCompatibility = '11'
}
compileJava {
options.compilerArgs << '-parameters' << '-Xlint:deprecation'
}
compileTestJava {
options.compilerArgs << '-Xlint:deprecation'
}
repositories {
mavenCentral()
}
jar {
manifest {
attributes 'Implementation-Title': project.name, 'Implementation-Version': project.version
}
}
tasks.register('printVersion') {
doLast {
print project.version
}
}
def pomConfig = {
licenses {
license {
name "MIT License"
url "http://www.opensource.org/licenses/mit-license.php"
distribution "repo"
}
}
scm {
url "https://github.com/hmcts/ccd-case-document-am-client"
}
}
tasks.register('sourcesJar', Jar) {
dependsOn classes
archiveClassifier.set('sources')
from sourceSets.main.allSource
}
tasks.register('javadocJar', Jar) {
dependsOn javadoc
archiveClassifier.set('javadoc')
from javadoc.destinationDir
}
artifacts {
archives sourcesJar
archives javadocJar
}
publishing {
publications {
Main(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
groupId project.group
artifactId 'ccd-case-document-am-client'
version project.version
pom.withXml {
def root = asNode()
root.appendNode('description', 'Client library for communicating with CCD case document am client api')
root.appendNode('name', 'CCD case document am client')
root.appendNode('url', 'https://github.com/hmcts/ccd-case-document-am-client')
root.children().last() + pomConfig
}
}
}
}
dependencyManagement {
applyMavenExclusions = false
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${versions.springCloud}"
}
}
dependencies {
implementation group: 'com.fasterxml.jackson.module', name: 'jackson-module-parameter-names'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-actuator'
implementation group: 'org.springframework.cloud', name: 'spring-cloud-starter-openfeign'
implementation group: 'io.github.openfeign', name: 'feign-httpclient', version: '13.2.1'
implementation group: 'io.github.openfeign', name: 'feign-jackson', version: '13.2.1'
implementation group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jsr310', version: '2.17.1'
compileOnly group: 'org.projectlombok', name: 'lombok', version: versions.lombok
annotationProcessor group: 'org.projectlombok', name: 'lombok', version: versions.lombok
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: versions.junit
testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: versions.junit
testImplementation group: 'org.springframework.boot', name: 'spring-boot-starter-test'
testImplementation group: 'org.springframework.cloud', name: 'spring-cloud-contract-wiremock', {
exclude group: 'com.github.tomakehurst', module: 'wiremock-standalone'
}
testImplementation group: 'com.github.tomakehurst', name: 'wiremock-standalone', version: '3.0.1'
}
wrapper {
distributionType = Wrapper.DistributionType.ALL
}
tasks.withType(Test).configureEach {
useJUnitPlatform()
}
bootJar {
enabled = false
}
jar {
enabled = true
}