forked from SuppieRK/spring-boot-multilevel-cache-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
136 lines (105 loc) · 2.97 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
import java.nio.charset.StandardCharsets
plugins {
// IDE
id 'idea'
// Language
id 'java'
id 'java-library'
// Core frameworks
id 'org.springframework.boot' version '3.2.5'
id 'io.spring.dependency-management' version '1.1.4'
// Publishing
id 'com.vanniktech.maven.publish' version '0.28.0'
// Utility
// id 'jacoco'
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
}
}
ext {
set('springCloudVersion', "2023.0.1")
}
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:1.0.3'
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'
}
dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
}
}
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)
}