-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
174 lines (142 loc) · 5.79 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
import groovy.time.TimeCategory
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
plugins {
id 'org.springframework.boot' version '2.5.3'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'java'
}
group = 'br.com.kbmg'
version = '1.0.5'
sourceCompatibility = '11'
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
if (details.requested.group == 'org.apache.logging.log4j') {
details.useVersion '2.17.1'
}
}
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-data-jdbc'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation('org.springframework.boot:spring-boot-starter-validation')
implementation 'org.springframework.boot:spring-boot-starter-hateoas'
implementation 'org.springframework.boot:spring-boot-starter-oauth2-client'
implementation 'org.springframework.boot:spring-boot-starter-oauth2-resource-server'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-mail'
// implementation 'org.liquibase:liquibase-core'
compileOnly 'org.projectlombok:lombok'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
runtimeOnly 'com.h2database:h2'
runtimeOnly 'mysql:mysql-connector-java'
runtimeOnly 'org.postgresql:postgresql'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.security:spring-security-test'
implementation "io.springfox:springfox-boot-starter:3.0.0"
// https://mvnrepository.com/artifact/com.google.code.gson/gson
implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.6'
// https://mvnrepository.com/artifact/com.google.guava/guava
implementation group: 'com.google.guava', name: 'guava', version: '30.1.1-jre'
// https://mvnrepository.com/artifact/org.mapstruct/mapstruct
compileOnly group: 'org.mapstruct', name: 'mapstruct', version: '1.3.1.Final'
testCompileOnly group: 'org.mapstruct', name: 'mapstruct', version: '1.3.1.Final'
annotationProcessor group: 'org.mapstruct', name: 'mapstruct-processor', version: '1.3.1.Final'
testAnnotationProcessor group: 'org.mapstruct', name: 'mapstruct-processor', version: '1.3.1.Final'
// https://mvnrepository.com/artifact/io.jsonwebtoken/jjwt
implementation group: 'io.jsonwebtoken', name: 'jjwt', version: '0.9.1'
// https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient
implementation group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.13'
// https://mvnrepository.com/artifact/org.passay/passay
implementation group: 'org.passay', name: 'passay', version: '1.6.1'
// https://mvnrepository.com/artifact/com.fasterxml.jackson.datatype/jackson-datatype-jsr310
implementation group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jsr310'
implementation 'net.sf.biweekly:biweekly:0.6.4'
// https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-freemarker
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-freemarker', version: '2.6.2'
// https://mvnrepository.com/artifact/com.google.code.gson/gson
implementation 'com.google.code.gson:gson:2.9.0'
}
tasks.register("unitTest", Test) {
useJUnitPlatform {
includeTags "unitTest"
}
mustRunAfter check
}
tasks.register("integrationTest", Test) {
useJUnitPlatform {
includeTags "integrationTest"
}
mustRunAfter check
}
test {
useJUnitPlatform()
}
tasks.withType(Test) { testTask ->
doFirst {
def profile = 'h2'
systemProperty 'profile', profile
failFast = project.hasProperty("failFast")
}
testLogging { logging ->
events TestLogEvent.FAILED, TestLogEvent.SKIPPED
exceptionFormat TestExceptionFormat.FULL
showExceptions true
showCauses true
showStackTraces false
showStandardStreams = false
}
def classNameTest = null
def classNameTestActual = null
afterTest { desc, result ->
def className = "${desc.className}"
def duration = TimeCategory.minus(new Date(result.endTime), new Date(result.startTime)).toString()
classNameTestActual = className
if (classNameTest != classNameTestActual) {
classNameTest = classNameTestActual
println('\n\n--> ' + classNameTest)
}
def methodName = "${desc.name}"
def resultOfTest = "${result.resultType}"
def timeOfExecution = "(${duration})"
def mes = String.format("\n\t |%110s | %10s | %18s |", methodName, resultOfTest, timeOfExecution)
if (resultOfTest == "SUCCESS") {
printf(mes)
} else {
println(mes)
}
}
afterSuite { desc, result ->
if (!desc.parent) { // will match the outermost suite
def reportFileName = "Report: file://${testTask.reports.html.entryPoint}"
def output = "Results: ${result.resultType} (${result.testCount} tests, " +
"${result.successfulTestCount} successes, " +
"${result.failedTestCount} failures, " +
"${result.skippedTestCount} skipped): " +
"${TimeCategory.minus(new Date(result.endTime), new Date(result.startTime))}"
def startItem = '| ', endItem = ' |'
def outputLength = startItem.length() + output.length() + endItem.length()
def reportFileNameLength = startItem.length() + reportFileName.length() + endItem.length()
print('\n' + ('-' * outputLength) +
'\n' + startItem + output + endItem +
'\n' + ('-' * outputLength))
println('\n' + ('-' * reportFileNameLength) +
"\n" + startItem + reportFileName + endItem +
'\n' + ('-' * reportFileNameLength))
}
}
}
springBoot {
buildInfo()
}