-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
175 lines (147 loc) · 6.05 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
/*
* Copyright 2021 Karlsruhe Institute of Technology.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
plugins {
id "io.freefair.lombok" version "8.11"
id "io.freefair.maven-publish-java" version "8.11"
id "io.spring.dependency-management" version "1.1.7"
id "org.owasp.dependencycheck" version "12.0.0"
id "java"
id "jacoco"
// plugins for release and publishing to maven repo
id "signing"
id "net.researchgate.release" version "3.1.0"
id "io.github.gradle-nexus.publish-plugin" version "2.0.0"
id 'maven-publish'
}
ext {
springBootVersion = '3.4.1'
springDocVersion = '1.8.0'
}
description = "Base service module containing entities, interfaces and helpers."
group = "edu.kit.datamanager"
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
jar {
archivesBaseName = 'service-base'
}
println "Building ${name} version: ${version}"
println "Running gradle version: $gradle.gradleVersion"
println "JDK version: ${JavaVersion.current()}"
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
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"
implementation "org.springframework.cloud:spring-cloud-gateway-mvc:4.2.0"
implementation "org.springdoc:springdoc-openapi-ui:${springDocVersion}"
implementation "org.springdoc:springdoc-openapi-data-rest:${springDocVersion}"
implementation "org.springdoc:springdoc-openapi-webmvc-core:${springDocVersion}"
implementation "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:2.18.2"
implementation "com.fasterxml.jackson.module:jackson-module-afterburner:2.18.2"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.18.2"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:2.18.2"
implementation "com.github.dozermapper:dozer-core:7.0.0"
//keycloak
implementation "com.nimbusds:nimbus-jose-jwt:10.0.1"
implementation "io.jsonwebtoken:jjwt-api:0.12.6"
implementation "io.jsonwebtoken:jjwt-impl:0.12.6"
implementation "io.jsonwebtoken:jjwt-jackson:0.12.6"
implementation "com.github.java-json-tools:json-patch:1.13"
implementation "org.apache.commons:commons-lang3:3.17.0"
implementation "commons-validator:commons-validator:1.9.0"
implementation "commons-io:commons-io:2.18.0"
// http client uses commons-codec
implementation 'org.apache.httpcomponents:httpclient:4.5.14'
implementation "org.apache.commons:commons-collections4:4.4"
// due to problems in dependencies check
implementation "com.fasterxml.jackson.core:jackson-core:2.18.2"
implementation "com.fasterxml.jackson.core:jackson-databind:2.18.2"
//Java 11 Support
implementation 'javax.xml.bind:jaxb-api:2.3.1'
implementation 'com.sun.xml.bind:jaxb-core:4.0.5'
implementation 'com.sun.xml.bind:jaxb-impl:4.0.5'
implementation 'javax.activation:activation:1.1.1'
implementation 'org.javassist:javassist:3.30.2-GA'
//test
testImplementation "org.springframework.boot:spring-boot-starter-test"
testImplementation "junit:junit:4.13.2"
testImplementation "org.mockito:mockito-inline:5.2.0"
}
def signingTasks = tasks.withType(Sign)
tasks.withType(AbstractPublishToMaven).configureEach{
mustRunAfter(signingTasks)
}
if (project.hasProperty('release')) {
println 'Using \'release\' profile for building ' + project.getName()
apply from: 'gradle/profile-deploy.gradle'
}
jacoco {
toolVersion = "0.8.12"
}
tasks.withType(Test) {
// Allow access to internal methods used by powerMockito
// Will fail with Java17
if (!JavaVersion.current().isJava8()) {
jvmArgs '--illegal-access=permit'
}
testLogging {
events 'started', 'passed'
}
}
jacocoTestReport {
reports {
xml.required = true
html.required = true
}
afterEvaluate {
//exclude some classes/package from code coverage report
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it, exclude: [\
//pure entity package currently not needed
'org/datacite/**', \
'org/purl/**', \
//performance tests
'edu/kit/datamanager/perf/**', \
//remove AuthenticationHelper tests due to mocking -> code coverage cannot be determined
//'edu/kit/datamanager/util/AuthenticationHelper*',
//deprecated stuff
'edu/kit/datamanager/util/DCTransformationHelper*',
'edu/kit/datamanager/dao/ByExampleSpecification*',
'edu/kit/datamanager/controller/hateoas/**',
//exceptions
'edu/kit/datamanager/exceptions/**',
'edu/kit/datamanager/service/impl/RabbitMQMessagingService*',
'edu/kit/datamanager/configuration/**',
'edu/kit/datamanager/service/IGenericService*'
])
}))
}
}
dependencyManagement {
imports { mavenBom("org.springframework.boot:spring-boot-dependencies:${springBootVersion}") }
}
if (JavaVersion.current().isJava8Compatible()) {
allprojects {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
}