Repository navigation
Expand file tree
/
Copy pathbuild.gradle
More file actions
216 lines (184 loc) · 7.54 KB
/
Copy pathbuild.gradle
File metadata and controls
216 lines (184 loc) · 7.54 KB
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
plugins {
id 'org.springframework.boot' version '3.5.9'
id 'io.spring.dependency-management' version '1.1.7'
id 'org.asciidoctor.jvm.convert' version '4.0.5'
id 'io.freefair.maven-publish-java' version '9.1.0'
id "org.owasp.dependencycheck" version "12.1.9"
id 'net.researchgate.release' version '3.1.0'
id "com.gorylenko.gradle-git-properties" version "2.5.4"
id 'io.freefair.lombok' version '9.1.0'
id 'java'
id 'application'
id 'jacoco'
// plugins for release and publishing to maven repo
id "signing"
id "io.github.gradle-nexus.publish-plugin" version "2.0.0"
id 'maven-publish'
}
description = 'Generic mapping service supporting different mapping implementations.'
group = 'edu.kit.datamanager'
println "Running gradle version: $gradle.gradleVersion"
println "Building ${name} version: ${version}"
println "JDK version: ${JavaVersion.current()}"
configurations {
asciidoctorExt
compileOnly {
extendsFrom annotationProcessor
}
}
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
def buildPofile = project.findProperty("buildProfile") ?: "complete"
if (buildPofile == "minimal") {
println 'Using minimal profile (no tests) for building ' + project.getName()
apply from: 'gradle/profile-minimal.gradle'
} else if (buildPofile == "deploy") {
println 'Using release profile for building ' + project.getName()
apply from: 'gradle/profile-deploy.gradle'
}else {
println 'Using default profile (all tests) for building ' + project.getName()
apply from: 'gradle/profile-default.gradle'
}
repositories {
mavenLocal()
mavenCentral()
}
ext {
set('snippetsDir', file('build/generated-snippets'))
applicationProperties = System.getProperty('applicationProperties', './src/test/resources/test-config/application-test.properties')
pythonExecutable = System.getProperty('pythonExecutable', "file:///usr/bin/python")
userDir = System.getProperty('user.dir')
set('springBootVersion', "3.2.1")
set('springDocVersion', "2.8.15")
set('javersVersion', "7.9.0")
set('keycloakVersion', "19.0.0")
}
dependencies {
implementation 'org.eclipse.jgit:org.eclipse.jgit:7.5.0.202512021534-r'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation "org.springframework.boot:spring-boot-starter-data-rest"
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
// monitoring
implementation 'io.micronaut.micrometer:micronaut-micrometer-registry-prometheus:5.13.2'
implementation 'org.springframework.boot:spring-boot-starter-actuator:3.5.9'
// springdoc
implementation "org.springdoc:springdoc-openapi-starter-webmvc-ui:${springDocVersion}"
implementation "org.springdoc:springdoc-openapi-starter-common:${springDocVersion}"
implementation "org.springdoc:springdoc-openapi-starter-webmvc-api:${springDocVersion}"
// cloud support
//implementation "org.springframework.cloud:spring-cloud-starter-config:4.1.3"
//implementation "org.springframework.cloud:spring-cloud-starter-netflix-eureka-client:4.1.3"
//implementation "org.springframework.cloud:spring-cloud-gateway-mvc:4.1.5"
implementation "org.javers:javers-spring-boot-starter-sql:${javersVersion}"
implementation 'org.apache.httpcomponents:httpclient:4.5.14'
implementation 'org.apache.commons:commons-collections4:4.5.0'
implementation 'org.apache.maven:maven-artifact:3.9.12'
implementation 'org.json:json:20250517'
implementation 'com.github.jknack:handlebars:4.5.0'
implementation 'com.google.guava:guava:33.5.0-jre'
implementation 'commons-io:commons-io:2.21.0'
implementation 'javax.validation:validation-api:2.0.1.Final'
implementation ('edu.kit.datamanager:service-base:1.3.6'){
//exclude dependency as spring boot includes
//org.glassfish.jaxb:jaxb-core:4.0.5 which leads to a duplication conflict
exclude group: "com.sun.xml.bind"
}
// apache
implementation "org.apache.tika:tika-core:3.2.3"
// JoltPlugin
implementation "com.bazaarvoice.jolt:jolt-core:0.1.8"
// JsonataPlugin
implementation "com.dashjoin:jsonata:0.9.9"
testImplementation platform('org.junit:junit-bom')
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'org.junit.jupiter:junit-jupiter-migrationsupport'
testImplementation 'org.junit.vintage:junit-vintage-engine'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.security:spring-security-test'
//testImplementation 'org.springframework:spring-test'
testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc:3.0.5'
testImplementation 'org.mockito:mockito-core:5.21.0'
testImplementation 'org.powermock:powermock-module-junit4:2.0.9'
testImplementation 'org.powermock:powermock-api-mockito2:2.0.9'
testImplementation 'net.bytebuddy:byte-buddy:1.18.3'
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
runtimeOnly 'com.h2database:h2:2.4.240'
runtimeOnly 'org.postgresql:postgresql:42.7.8'
runtimeOnly 'org.apache.httpcomponents:httpclient:4.5.14'
asciidoctorExt 'org.springframework.restdocs:spring-restdocs-asciidoctor:4.0.0'
}
//customization of java compile task
tasks.withType(JavaCompile) {
options.compilerArgs += ['-Xlint:unchecked']
}
//test configuration
test {
outputs.dir snippetsDir
finalizedBy jacocoTestReport
println("Running tests with configuration: ${applicationProperties}")
println("Running tests with python: ${pythonExecutable}")
println("Running tests in directory: ${userDir}")
environment 'spring.config.location', applicationProperties
environment 'pythonExecutable', pythonExecutable
useJUnitPlatform()
testLogging.showStandardStreams = true
}
//jacoco configuration
jacoco {
toolVersion = "0.8.14"
}
//asciidoctor configuration, i.e., snippet dir
asciidoctor {
inputs.dir snippetsDir
configurations 'asciidoctorExt'
dependsOn test
}
//generation task of boot jar
bootJar {
dependsOn asciidoctor
//dependsOn 'buildPluginJar'
from ("${asciidoctor.outputDir}/html5") {
into 'static/docs'
}
archiveFileName = "${archiveBaseName.get()}.${archiveExtension.get()}"
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
manifest {
attributes 'Main-Class': 'org.springframework.boot.loader.launch.PropertiesLauncher'
}
launchScript()
}
//add build info into manifest
springBoot {
buildInfo()
}
//properties made available for bootRun task execution
bootRun {
systemProperty "spring.config.location", "file:$projectDir/"
systemProperty "pythonLocation", pythonExecutable
}
//define how a new version is tagged and where version information may come from
release {
tagTemplate = 'v${version}'
versionPropertyFile = 'gradle.properties'
versionProperties = ['version', 'mainversion']
}
//Do not generate entire project jar
tasks.named("jar") {
enabled = false
}
// Disable generation of Gradle module metadata (.module file)
tasks.withType(GenerateModuleMetadata).configureEach {
enabled = false
}
// task for printing project name.
// should be the last task inside file
task printProjectName {
doLast {
println "${project.name}"
}
}