-
Notifications
You must be signed in to change notification settings - Fork 39
/
build.gradle
221 lines (191 loc) · 6.71 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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
plugins {
id 'org.springframework.boot' version '3.3.5'
id 'io.spring.dependency-management' version '1.1.6'
id 'org.owasp.dependencycheck' version '11.1.0'
id 'com.diffplug.spotless' version '6.25.0'
id 'eclipse'
id 'jacoco'
id 'idea'
id 'java'
id 'pmd'
}
group = 'com.developersboard'
version = '0.0.1-SNAPSHOT'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
// You can uncomment this to include javadoc jar generation
// withJavadocJar()
// You can comment this line to exclude source jar
withSourcesJar()
}
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
mavenCentral()
}
ext {
set('jjwtVersion', '0.12.6')
set('springDocVersion', '2.6.0')
set('javadocScribeVersion', '0.15.0')
set('mapstructVersion', '1.6.2')
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-mail'
implementation 'org.thymeleaf.extras:thymeleaf-extras-springsecurity6'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation 'org.springframework.boot:spring-boot-starter-data-rest'
implementation 'org.springframework.boot:spring-boot-starter-validation'
// Dev Tools
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
implementation 'org.ehcache:ehcache'
implementation 'org.hibernate.orm:hibernate-jcache'
implementation 'org.ehcache:ehcache-transactions:3.10.8'
// Utilities
implementation 'org.jsoup:jsoup:1.18.1'
implementation "io.jsonwebtoken:jjwt-api:${jjwtVersion}"
runtimeOnly "io.jsonwebtoken:jjwt-impl:${jjwtVersion}"
runtimeOnly "io.jsonwebtoken:jjwt-jackson:${jjwtVersion}"
implementation 'commons-io:commons-io:2.17.0'
implementation 'net.datafaker:datafaker:2.4.0'
implementation 'com.google.code.gson:gson:2.11.0'
implementation 'commons-validator:commons-validator:1.9.0'
implementation 'com.github.darrachequesne:spring-data-jpa-datatables:6.0.4'
// Documentation and API Tools
implementation "org.springdoc:springdoc-openapi-starter-webmvc-ui:${springDocVersion}"
implementation "org.springdoc:springdoc-openapi-starter-common:${springDocVersion}"
annotationProcessor "com.github.therapi:therapi-runtime-javadoc-scribe:${javadocScribeVersion}"
runtimeOnly "com.github.therapi:therapi-runtime-javadoc:${javadocScribeVersion}"
// Database and File Storage Tools
implementation 'com.h2database:h2'
runtimeOnly 'org.postgresql:postgresql'
implementation 'org.liquibase:liquibase-core'
implementation 'org.hibernate.orm:hibernate-envers'
implementation 'com.amazonaws:aws-java-sdk-s3:1.12.765'
implementation files('libs/hypersistence-optimizer-2.6.3-jakarta.jar')
// MapStruct for Object Mapping
implementation "org.mapstruct:mapstruct:${mapstructVersion}"
annotationProcessor "org.mapstruct:mapstruct-processor:${mapstructVersion}"
// Webjars
implementation 'org.webjars:jquery:3.7.1'
implementation 'org.webjars:bootstrap:5.3.3'
implementation 'org.webjars:popper.js:2.11.7'
implementation 'org.webjars:jquery-ui:1.14.0'
implementation 'org.webjars:datatables:2.0.3'
implementation 'org.webjars:font-awesome:6.5.2'
implementation 'org.webjars:webjars-locator:0.52'
}
testing {
//noinspection GroovyAssignabilityCheck
suites {
configureEach {
useJUnitJupiter()
dependencies {
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
implementation 'org.mockito:mockito-core:5.14.2'
implementation 'io.findify:s3mock_2.13:0.2.6'
implementation 'com.icegreen:greenmail-junit5:2.1.0'
implementation 'com.jparams:to-string-verifier:1.4.8'
implementation 'nl.jqno.equalsverifier:equalsverifier:3.17.3'
implementation 'org.springframework.security:spring-security-test'
implementation 'org.springframework.boot:spring-boot-starter-test'
}
}
//noinspection GroovyAssignabilityCheck
integrationTest(JvmTestSuite) {
sources.java.srcDirs = ['src/integrationTest/java']
sources.resources.srcDirs = ['src/integrationTest/resources']
dependencies {
implementation project()
implementation sourceSets.test.output
implementation 'org.springframework.boot:spring-boot-testcontainers'
implementation 'com.amazonaws:aws-java-sdk-core:1.12.778'
implementation 'org.testcontainers:junit-jupiter'
implementation 'org.testcontainers:postgresql'
}
targets {
configureEach {
testTask.configure {
shouldRunAfter(test)
finalizedBy 'jacocoTestReport'
// Fail the 'test' task on the first test failure
failFast = true
// If no active profile is set, use integration-test is the active profile
environment 'SPRING_PROFILES_ACTIVE', System.getenv("SPRING_PROFILES_ACTIVE") ?: "integration-test"
}
}
}
}
}
}
configurations {
integrationTestImplementation.extendsFrom testImplementation
}
tasks.named('check') {
dependsOn(testing.suites.integrationTest)
}
tasks.named('bootBuildImage') {
builder = 'paketobuildpacks/builder-jammy-base:latest'
}
tasks.withType(JavaCompile).configureEach {
options.compilerArgs += ['-Xlint:deprecation']
dependsOn 'spotlessApply'
}
jacocoTestReport {
executionData(fileTree(layout.buildDirectory).include("jacoco/*.exec"))
reports {
xml.required = true
html.required = true
csv.required = true
}
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it, exclude: [
"**/exception/*",
"**/enums/*",
"**/constant/*",
"**/config/*",
"**/backend/bootstrap/*",
"**/Mock*.class",
"**/*DtoMapperImpl.class",
])
}))
}
}
spotless {
format 'misc', {
// define the files to apply `misc` to
target '*.gradle', '*.md', '.gitignore'
// define the steps to apply to those files
trimTrailingWhitespace()
indentWithSpaces()
endWithNewline()
}
java {
// define the steps to apply to those files
trimTrailingWhitespace()
indentWithSpaces()
endWithNewline()
removeUnusedImports()
googleJavaFormat()
}
}
pmd {
consoleOutput = true
ruleSetFiles = files("${project.rootDir}/config/pmd-ruleset.xml")
ruleSets = []
}
jacoco {
toolVersion = "0.8.12"
}