forked from kit-data-manager/metastore2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
210 lines (169 loc) · 6.56 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
plugins {
id "org.springframework.boot" version "2.4.13"
id "io.spring.dependency-management" version "1.0.11.RELEASE"
id "io.freefair.lombok" version "6.1.0"
id "io.freefair.maven-publish-java" version "6.1.0"
id "org.owasp.dependencycheck" version "6.5.0.1"
id 'org.asciidoctor.jvm.convert' version '3.3.2'
id 'net.researchgate.release' version '2.8.1'
id 'java'
id 'jacoco'
}
description = 'General purpose metadata repository and schema registry service'
group = 'edu.kit.datamanager'
ext {
springBootVersion = '2.4.13'
springDocVersion = '1.5.13'
javersVersion = '6.5.3'
keycloakVersion = '15.0.2'
// directory for generated code snippets during tests
snippetsDir = file("build/generated-snippets")
}
println "Running gradle version: $gradle.gradleVersion"
println "Building ${name} version: ${version}"
println "JDK version: ${JavaVersion.current()}"
repositories {
mavenLocal()
mavenCentral()
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
configurations {
all*.exclude module : 'spring-boot-starter-logging'
}
if (System.getProperty('profile') == 'minimal') {
println 'Using minimal profile for building ' + project.getName()
apply from: 'gradle/profile-minimal.gradle'
} else {
println 'Using default profile executing all tests for building ' + project.getName()
apply from: 'gradle/profile-complete.gradle'
}
dependencies {
// Spring
implementation 'org.springframework:spring-messaging:5.3.9'
// Spring Boot
implementation "org.springframework.boot:spring-boot-starter-data-rest"
implementation "org.springframework.boot:spring-boot-starter-amqp"
implementation "org.springframework.boot:spring-boot-starter-web"
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"
// boot starter
implementation "org.springframework.boot:spring-boot-starter-validation"
implementation "org.springframework.boot:spring-boot-starter-mail"
implementation "org.springframework.security:spring-security-web:5.5.2"
implementation "de.codecentric:spring-boot-admin-starter-client:2.1.6"
implementation "org.springframework.security:spring-security-config:5.5.2"
// cloud support
implementation "org.springframework.cloud:spring-cloud-starter-config:3.0.6"
implementation "org.springframework.cloud:spring-cloud-starter-netflix-eureka-client:3.0.5"
// springdoc
implementation "org.springdoc:springdoc-openapi-ui:${springDocVersion}"
implementation "org.springdoc:springdoc-openapi-data-rest:${springDocVersion}"
implementation "org.springdoc:springdoc-openapi-webmvc-core:${springDocVersion}"
//Keycloak
implementation "org.keycloak:keycloak-spring-boot-starter:${keycloakVersion}"
implementation "com.nimbusds:nimbus-jose-jwt:9.15.2"
implementation "io.jsonwebtoken:jjwt-api:0.11.2"
implementation "io.jsonwebtoken:jjwt-impl:0.11.2"
implementation "io.jsonwebtoken:jjwt-jackson:0.11.2"
// apache
implementation "commons-configuration:commons-configuration:1.10"
implementation "org.apache.commons:commons-collections4:4.4"
// includes commons-lang3
implementation "org.apache.commons:commons-text:1.9"
// UI (website)
implementation "org.springframework.boot:spring-boot-starter-thymeleaf"
// javers
implementation "org.javers:javers-spring-boot-starter-sql:${javersVersion}"
// driver for postgres
implementation "org.postgresql:postgresql:42.2.25"
//driver for h2
implementation "com.h2database:h2:1.4.200"
// apache
implementation "commons-io:commons-io:2.11.0"
implementation "org.apache.tika:tika-core:1.27"
implementation "org.javers:javers-core:${javersVersion}"
// JSON validator
implementation "com.networknt:json-schema-validator:1.0.59"
// XML validator // https://mvnrepository.com/artifact/xerces/xercesImpl
implementation 'xerces:xercesImpl:2.12.1'
// datamanager
implementation "edu.kit.datamanager:repo-core:1.0.2"
implementation "edu.kit.datamanager:service-base:1.0.1"
// DOIP SDK
implementation "net.dona.doip:doip-sdk:2.1.0"
runtimeOnly "org.apache.httpcomponents:httpclient:4.5.13"
// Additional libraries for tests
testImplementation "org.springframework.restdocs:spring-restdocs-mockmvc:2.0.5.RELEASE"
testImplementation "org.springframework.boot:spring-boot-starter-test"
testImplementation "org.springframework:spring-test"
testImplementation "org.springframework.security:spring-security-test"
//Java 11 Support
testImplementation "org.mockito:mockito-core:3.12.0"
testImplementation "org.powermock:powermock-module-junit4:2.0.9"
testImplementation "org.powermock:powermock-api-mockito2:2.0.9"
testImplementation "junit:junit:4.13.2"
}
dependencyManagement {
imports { mavenBom("org.springframework.boot:spring-boot-dependencies:${springBootVersion}") }
}
compileJava {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
test {
finalizedBy jacocoTestReport
environment "spring.config.location", "classpath:/test-config/"
maxHeapSize = "8192m"
testLogging {
outputs.upToDateWhen {false}
showStandardStreams = true
}
}
tasks.withType(Test) {
testLogging {
events 'started', 'passed'
}
}
jacoco {
toolVersion = "0.8.7"
}
import java.text.SimpleDateFormat
tasks.register('testForSnippetsDir') {
doFirst {
println 'snippetsDir exists: ' + snippetsDir.exists()
if (!snippetsDir.exists()) {
println 'Create snippets dir...'
println 'WARNING: Don\'t skip tests for building production ready jar file!'
snippetsDir.mkdirs()
}
}
}
asciidoctor {
dependsOn testForSnippetsDir
attributes "snippets": snippetsDir,
"version": jar.archiveVersion,
"date": new SimpleDateFormat("yyyy-MM-dd").format(new Date())
inputs.dir snippetsDir
dependsOn test
sourceDir "docs/"
outputDir "build/docs/html5"
}
bootJar {
println 'Create bootable jar...'
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
manifest {
attributes 'Main-Class': 'org.springframework.boot.loader.PropertiesLauncher'
}
dependsOn asciidoctor
from ("${asciidoctor.outputDir}") {
into 'static/docs'
}
launchScript()
}
// task for printing project name.
task printProjectName {
doLast {
println "${project.name}"
}
}