-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
172 lines (153 loc) · 5.62 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
plugins {
id 'java'
id 'org.springframework.boot' version '3.3.4'
id 'io.spring.dependency-management' version '1.1.6'
id 'org.sonarqube' version '5.1.0.4882'
id 'jacoco'
id 'checkstyle'
id 'org.owasp.dependencycheck' version '10.0.4'
id 'com.github.ben-manes.versions' version "0.51.0"
id 'se.patrikerdes.use-latest-versions' version '0.2.18'
}
group = 'es.in2'
version = '1.4.0'
java {
sourceCompatibility = '17'
}
checkstyle {
configFile = file("${rootDir}/config/checkstyle/checkstyle.xml")
}
checkstyleMain {
source = 'src/main/java'
}
checkstyleTest {
source = 'src/test/java'
}
sonar {
properties {
property 'sonar.projectName', 'IN2 Wallet API'
property 'sonar.projectKey', 'in2workspace_in2-wallet-api'
property 'sonar.organization', 'in2workspace'
property 'sonar.host.url', 'https://sonarcloud.io'
property 'sonar.coverage.exclusions',
"src/main/java/es/in2/wallet/WalletApiApplication.java"
}
}
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
// Apply dependency resolution rules to force specific versions
configurations.configureEach {
resolutionStrategy {
eachDependency { DependencyResolveDetails details ->
if (details.requested.group.startsWith('com.fasterxml.jackson')) {
details.useVersion '2.17.0'
}
}
}
}
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
dependencies {
// Spring Boot Starters
implementation 'org.springframework.boot:spring-boot-starter-webflux'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-oauth2-resource-server'
// CBOR Dependencies
implementation 'com.upokecenter:cbor:4.5.1'
implementation 'io.github.ehn-digital-green-development:base45:0.0.3'
implementation 'com.augustcellars.cose:cose-java:1.1.0'
implementation 'org.apache.commons:commons-compress:1.27.1'
// JSON
implementation 'com.fasterxml.jackson.core:jackson-databind:2.17.0'
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.17.2'
implementation 'org.json:json:20240303'
// Persistence
implementation 'org.springframework.boot:spring-boot-starter-data-r2dbc'
implementation 'org.springframework:spring-jdbc'
runtimeOnly 'org.postgresql:r2dbc-postgresql'
runtimeOnly 'org.postgresql:postgresql'
implementation 'org.flywaydb:flyway-database-postgresql:11.2.0'
// Resilience
implementation 'org.springframework.cloud:spring-cloud-starter-circuitbreaker-reactor-resilience4j:3.1.2'
// Key Vault
testImplementation 'org.springframework.data:spring-data-keyvalue:3.3.4'
implementation 'org.springframework.vault:spring-vault-core:3.1.2'
// Bounty Castle
implementation 'org.bouncycastle:bcprov-jdk18on:1.78'
implementation 'com.github.multiformats:java-multibase:1.1.1'
implementation 'com.github.sthagen:erdtman-java-json-canonicalization:1.1'
// Azure
implementation 'com.azure.spring:spring-cloud-azure-starter-appconfiguration:5.16.0'
implementation 'com.azure.spring:spring-cloud-azure-starter-keyvault-secrets:5.16.0'
// DevTools
implementation 'com.google.code.findbugs:jsr305:3.0.2'
compileOnly 'org.projectlombok:lombok:1.18.34'
annotationProcessor 'org.projectlombok:lombok:1.18.34'
// Documentation
implementation 'org.springdoc:springdoc-openapi-starter-webflux-ui:2.6.0'
// Logging
implementation 'net.logstash.logback:logstash-logback-encoder:8.0'
// Monitoring
implementation 'io.micrometer:micrometer-tracing-bridge-brave:1.3.4'
implementation 'io.zipkin.reporter2:zipkin-reporter-brave:3.4.2'
runtimeOnly 'io.micrometer:micrometer-registry-prometheus:1.13.4'
// Metrics
implementation 'org.springframework.boot:spring-boot-starter-actuator:3.3.4'
// Unit Testing
testImplementation 'org.springframework.boot:spring-boot-starter-test:3.3.4'
testImplementation 'org.springframework.security:spring-security-test:6.3.3'
testImplementation 'io.projectreactor:reactor-test:3.6.10'
// Test
testImplementation 'org.springframework.boot:spring-boot-testcontainers:3.3.4'
testImplementation 'org.testcontainers:junit-jupiter:1.20.1'
testImplementation 'org.testcontainers:vault:1.20.1'
testImplementation 'com.squareup.okhttp3:mockwebserver:4.12.0'
}
tasks.named('compileJava') {
inputs.files(tasks.named('processResources'))
}
tasks.named('test') {
useJUnitPlatform()
finalizedBy(tasks.jacocoTestReport)
}
tasks.jacocoTestReport {
dependsOn(tasks.test)
reports {
xml.required.set(true)
csv.required.set(false)
html.outputLocation.set(layout.buildDirectory.dir('jacocoHtml'))
}
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it, exclude: [
"src/main/java/es/in2/wallet/WalletApiApplication.java"
])
}))
}
}
def isNonStable = { String version ->
def stableKeyword = ['RELEASE', 'FINAL', 'GA'].any { it -> version.toUpperCase().contains(it) }
def regex = /^[0-9,.v-]+(-r)?$/
return !stableKeyword && !(version ==~ regex)
}
tasks.named("dependencyUpdates").configure {
rejectVersionIf {
isNonStable(it.candidate.version)
}
}
tasks.register('printVersion') {
doLast {
println version
}
}
tasks.register('printProjectName') {
doLast {
println rootProject.name
}
}