generated from telekom/reuse-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
executable file
·124 lines (102 loc) · 3.61 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
// Copyright 2024 Deutsche Telekom IT GmbH
//
// SPDX-License-Identifier: Apache-2.0
import org.springframework.boot.gradle.plugin.SpringBootPlugin
plugins {
id 'org.springframework.boot' version '3.2.3'
id 'io.spring.dependency-management' version '1.1.4'
id 'java'
id "jacoco"
}
def getVersion() {
def version = "0.0.0"
def gitBranch = "develop"
try {
def workingDir = new File("${project.projectDir}")
def result = 'git rev-parse --abbrev-ref HEAD'.execute(null, workingDir)
result.waitFor()
if (result.exitValue() == 0) {
gitBranch = result.text.trim().replace("/", "-")
}
} catch (ignored) {}
if (System.getenv('CI_COMMIT_TAG')) {
version = System.getenv('CI_COMMIT_TAG')
} else if (System.getenv('CI_COMMIT_REF_SLUG')) {
version += ("-" + System.getenv('CI_COMMIT_REF_SLUG'))
} else {
version += ("-" + gitBranch)
}
return version
}
group = 'de.telekom.horizon'
version = getVersion()
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
mavenCentral()
}
ext {
// this is internal, overwrite with your specific implementation if you want
schemalValidationImplDependency = System.getenv('ADDITIONAL_SCHEMASTORE_IMPL') ?: System.getProperty("schemaStoreImplMavenDependency") ?: ""
}
dependencies {
// Spring
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-oauth2-resource-server'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-data-redis'
implementation 'org.springframework.kafka:spring-kafka'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
testImplementation 'org.springframework.boot:spring-boot-starter-webflux'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.kafka:spring-kafka-test'
testImplementation 'org.springframework.security:spring-security-test'
testImplementation 'commons-codec:commons-codec:1.16.1'
// 3rd party
implementation 'com.fasterxml.jackson.core:jackson-databind'
implementation ("com.github.erosb:everit-json-schema:${everitJsonVersion}") {
// fixes logging in test scope
exclude group: 'commons-logging'
}
compileOnly "org.projectlombok:lombok"
testCompileOnly "org.projectlombok:lombok"
annotationProcessor "org.projectlombok:lombok"
testAnnotationProcessor "org.projectlombok:lombok"
// Telekom Integration Platform
implementation "de.telekom.eni:horizon-spring-boot-starter:${horizonParentVersion}"
// optional
if (!schemalValidationImplDependency.allWhitespace) {
//implementation "${schemalValidationImplDependency}"
}
testImplementation 'org.springframework.boot:spring-boot-testcontainers'
testImplementation 'org.testcontainers:junit-jupiter'
}
dependencyManagement {
imports {
mavenBom SpringBootPlugin.BOM_COORDINATES
}
}
java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
test {
useJUnitPlatform()
finalizedBy jacocoTestReport
}
jacocoTestReport {
dependsOn test
reports {
xml.required = true
csv.required = true
html.required = true
}
}
bootJar {
archiveFileName.set("${project.name}.jar")
}