-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
200 lines (165 loc) · 5.58 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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
import org.gradle.plugins.ide.eclipse.model.SourceFolder
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath "org.owasp:dependency-check-gradle:${owasp_plugin_version}"
}
}
plugins {
id "org.springframework.boot"
id "io.spring.dependency-management"
id "java-library"
id "eclipse"
id "com.gorylenko.gradle-git-properties"
id "com.github.ben-manes.versions"
id "com.diffplug.spotless"
id "org.sonarqube" apply false
}
apply from: "gradle/code-quality.gradle"
if (project.hasProperty("ci")) {
apply from: "gradle/owasp.gradle"
}
group = "com.learning.mfscreener"
version = "0.0.1-SNAPSHOT"
java {
sourceCompatibility = '21'
targetCompatibility = '21'
}
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
mavenCentral()
maven { url 'https://repo.spring.io/milestone' }
}
dependencies {
implementation "org.springframework.boot:spring-boot-starter-actuator"
implementation "org.springframework.boot:spring-boot-starter-validation"
implementation "org.springframework.boot:spring-boot-starter-web"
// caching
implementation 'org.springframework.boot:spring-boot-starter-cache'
implementation 'org.springframework.boot:spring-boot-starter-data-redis'
implementation 'org.apache.commons:commons-pool2'
// Observability
implementation 'io.micrometer:micrometer-tracing-bridge-otel'
implementation 'io.opentelemetry:opentelemetry-exporter-zipkin'
implementation("net.ttddyy.observation:datasource-micrometer-spring-boot:1.0.5")
implementation 'org.decampo:xirr:1.2'
developmentOnly "org.springframework.boot:spring-boot-devtools"
annotationProcessor "org.springframework.boot:spring-boot-configuration-processor"
implementation "org.springframework.boot:spring-boot-starter-data-jpa"
runtimeOnly "com.h2database:h2"
runtimeOnly "org.postgresql:postgresql"
implementation "org.liquibase:liquibase-core"
implementation "org.springdoc:springdoc-openapi-starter-webmvc-ui:${springdoc_openapi_version}"
runtimeOnly "io.micrometer:micrometer-registry-prometheus"
// Scheduler
implementation("org.jobrunr:jobrunr-spring-boot-3-starter:7.3.1")
// Mapstruct
implementation ("org.mapstruct:mapstruct:1.6.2")
implementation ("org.mapstruct.extensions.spring:mapstruct-spring-annotations:1.1.2")
annotationProcessor ("org.mapstruct:mapstruct-processor:1.6.2")
annotationProcessor ("org.mapstruct.extensions.spring:mapstruct-spring-extensions:1.1.2")
testAndDevelopmentOnly 'org.springframework.boot:spring-boot-devtools'
testImplementation "org.springframework.boot:spring-boot-starter-test"
testImplementation "org.springframework.boot:spring-boot-testcontainers"
testImplementation "org.testcontainers:junit-jupiter"
testImplementation "org.testcontainers:postgresql"
testImplementation('com.tngtech.archunit:archunit-junit5:1.3.0')
testImplementation('com.redis:testcontainers-redis:2.2.2')
// If you are using mapstruct in test code
testAnnotationProcessor("org.mapstruct:mapstruct-processor:1.6.2")
testAnnotationProcessor("org.mapstruct.extensions.spring:mapstruct-spring-extensions:1.1.2")
}
tasks.withType(JavaCompile).configureEach {
options.compilerArgs += [
'-Amapstruct.suppressGeneratorTimestamp=true',
'-Amapstruct.suppressGeneratorVersionInfoComment=true',
'-Amapstruct.verbose=true',
'-Amapstruct.defaultComponentModel=spring'
]
}
defaultTasks "bootRun"
springBoot {
buildInfo()
}
bootJar {
//launchScript()
}
bootBuildImage {
imageName = "DOCKER_USERNAME/mfdcreener"
}
compileJava.dependsOn processResources
processResources.dependsOn bootBuildInfo
if (project.hasProperty("local")) {
bootRun {
args = ["--spring.profiles.active=local"]
}
}
gitProperties {
failOnNoGitDirectory = false
keys = [
"git.branch",
"git.commit.id.abbrev",
"git.commit.user.name",
"git.commit.message.full"
]
}
spotless {
java {
importOrder()
removeUnusedImports()
palantirJavaFormat("2.42.0")
formatAnnotations()
}
}
check.dependsOn spotlessCheck
test {
useJUnitPlatform()
exclude "**/*IT*", "**/*IntegrationTest*", "**/*IntTest*"
testLogging {
events = ["PASSED", "FAILED", "SKIPPED"]
showStandardStreams = true
exceptionFormat = "full"
}
}
tasks.register('integrationTest', Test) {
useJUnitPlatform()
include "**/*IT*", "**/*IntegrationTest*", "**/*IntTest*"
shouldRunAfter test
testLogging {
events = ["PASSED", "FAILED", "SKIPPED"]
showStandardStreams = true
exceptionFormat = "full"
}
}
check.dependsOn integrationTest
check.dependsOn jacocoTestReport
tasks.register('testReport', TestReport) {
destinationDirectory = file("$buildFile/reports/tests")
testResults.from(test)
}
tasks.register('integrationTestReport', TestReport) {
destinationDirectory = file("$buildFile/reports/tests")
testResults.from(integrationTest)
}
sourceSets {
main {
java.srcDirs += 'build/generated/sources/annotationProcesor/java'
}
}
//adding task to fix issue with ConversationService not found in VSCode
eclipse {
classpath {
containers 'org.eclipse.buildship.core.gradleclasspathcontainer'
file.whenMerged { cp ->
def entries = cp.entries
def src = new SourceFolder('build/generated/sources/annotationProcessor/java/main/', null)
entries.add(src)
}
}
}