-
Notifications
You must be signed in to change notification settings - Fork 9
/
build.gradle
157 lines (123 loc) · 3.47 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
import java.nio.charset.StandardCharsets
plugins {
// IDE
id 'idea'
// Language
id 'java'
id 'java-library'
// Core frameworks
id 'org.springframework.boot' version '3.4.0'
id 'io.spring.dependency-management' version '1.1.6'
// Publishing
id 'com.vanniktech.maven.publish' version '0.30.0'
// Utility
id 'jacoco'
id 'org.sonarqube' version '6.0.0.5145'
id 'com.diffplug.spotless' version '6.25.0'
}
// Project properties
group = "$GROUP"
version = "$VERSION_NAME"
description = "$POM_DESCRIPTION"
// Source code properties
java {
sourceCompatibility = '17'
targetCompatibility = '17'
compileJava.options.encoding = 'UTF-8'
}
repositories {
mavenCentral()
}
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
dependencyManagement {
imports {
mavenBom 'org.springframework.cloud:spring-cloud-dependencies:2023.0.3'
}
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-cache'
implementation 'org.springframework.boot:spring-boot-starter-data-redis'
implementation 'org.springframework.boot:spring-boot-actuator'
implementation 'io.micrometer:micrometer-core'
implementation 'com.github.ben-manes.caffeine:caffeine'
implementation 'io.github.resilience4j:resilience4j-circuitbreaker'
// For exception handling utilities
// See https://github.com/SuppieRK/java-throwable-utils
implementation 'io.github.suppierk:java-throwable-utils:2.0.0'
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.awaitility:awaitility'
testImplementation 'org.testcontainers:junit-jupiter'
}
test {
useJUnitPlatform()
}
// Enable Spotless code formatting rules
spotless {
java {
googleJavaFormat()
}
lineEndings = 'UNIX'
}
// Swap build tasks to build library only
bootJar {
enabled = false
}
jar {
enabled = true
archiveClassifier.set('')
}
task sourceJar(type: Jar, dependsOn: classes) {
archiveClassifier.set('sources')
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier.set('javadoc')
from javadoc.destinationDir
}
artifacts {
archives jar
archives javadocJar
archives sourceJar
}
// Configure several tasks additionally for Gradle
tasks.withType(Copy).configureEach {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}
tasks.withType(JavaCompile).configureEach {
options.encoding = StandardCharsets.UTF_8.name()
dependsOn(spotlessJavaCheck)
}
tasks.withType(Copy).configureEach {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}
tasks.withType(JavaCompile).configureEach {
options.encoding = StandardCharsets.UTF_8.name()
dependsOn(spotlessJavaCheck)
}
test {
// Report is always generated after tests run
finalizedBy jacocoTestReport
}
jacocoTestReport {
// Tests are required to run before generating the report
dependsOn test
reports {
html.required = true
xml.required = true
csv.required = false
}
}
sonar {
properties {
property "sonar.projectKey", "SuppieRK_spring-boot-multilevel-cache-starter"
property "sonar.organization", "suppierk"
property "sonar.host.url", "https://sonarcloud.io"
}
}