aboutsummaryrefslogtreecommitdiffstats
path: root/app/build.gradle
blob: 934edf7542685979829aba1729cb5fd766206fcf (plain)
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
plugins {
    id 'org.onap.portalng.history.java-application-conventions'
    id 'io.spring.dependency-management'
    id 'org.springframework.boot'
    id 'jacoco'
    id 'com.github.hierynomus.license'
    id 'com.gorylenko.gradle-git-properties'
}
apply from: "${rootDir}/gradle/verify-licenses.gradle"

def appVersion = getAppVersion()
sourceCompatibility = '17'
targetCompatibility = '17'

springBoot {
    buildInfo {
        properties {
            artifact = "org-onap-portalng-history"
            version = appVersion
            group = "org.onap.portalng"
            name = "History service that saves user actions"
        }
    }
}

configurations {
    compileOnly {
        extendsFrom annotationProcessor
    }
}

ext {
        problemVersion = '0.27.1'
        problemSpringVersion = '0.27.0'
        logbackVersion = '1.4.11'
        logstashLogbackVersion = '7.4'
        embedMongoVersion = '4.7.0'
        embedMongoIntegrationVersion = '4.7.0'
        springCloudWiremockVersion = '4.0.3'
        micrometerVersion = '1.0.0'
}

dependencies {
    implementation project(':openapi')
    implementation 'org.springframework.boot:spring-boot-starter-actuator'
    implementation 'org.springframework.boot:spring-boot-starter-data-mongodb-reactive'
    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-webflux'
    implementation 'org.springframework.boot:spring-boot-starter-validation'
    implementation "org.zalando:problem:$problemVersion"
    implementation "org.zalando:jackson-datatype-problem:$problemVersion"
    implementation "org.zalando:problem-spring-webflux:$problemSpringVersion"
    implementation "ch.qos.logback:logback-classic:$logbackVersion"
    implementation "ch.qos.logback:logback-core:$logbackVersion"
    implementation "net.logstash.logback:logstash-logback-encoder:$logstashLogbackVersion"

    implementation(platform("io.micrometer:micrometer-tracing-bom:$micrometerVersion"))
    implementation("io.micrometer:micrometer-tracing")
    implementation("io.micrometer:micrometer-tracing-bridge-otel")
    implementation("io.opentelemetry:opentelemetry-exporter-zipkin")

    compileOnly 'org.projectlombok:lombok'

    developmentOnly 'org.springframework.boot:spring-boot-devtools'

    annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
    annotationProcessor 'org.projectlombok:lombok'

    testImplementation 'org.springframework.boot:spring-boot-starter-test'
    testImplementation 'io.projectreactor:reactor-test'
    testImplementation 'io.rest-assured:rest-assured'
    testImplementation "org.springframework.cloud:spring-cloud-contract-wiremock:$springCloudWiremockVersion"
    testImplementation "de.flapdoodle.embed:de.flapdoodle.embed.mongo:$embedMongoVersion"
    testImplementation "de.flapdoodle.embed:de.flapdoodle.embed.mongo.spring30x:$embedMongoIntegrationVersion"
    testCompileOnly 'org.projectlombok:lombok'
    testAnnotationProcessor 'org.projectlombok:lombok'
}

test {
    useJUnitPlatform()
    finalizedBy(jacocoTestReport)
}

jacocoTestReport {
    reports {
        xml.required = true
    }
}

application {
    // Define the main class for the application.
    mainClass = 'org.onap.portalng.history.HistoryApplication'
}

sourceCompatibility = '17'
targetCompatibility = '17'

downloadLicenses {
    dependencyConfiguration = 'implementation'
    includeProjectDependencies = false
}

license {
    ignoreFailures = true
    header = project.file('LICENSE_HEADER')
    includes(["**/*.java"])
    ext.year = Calendar.getInstance().get(Calendar.YEAR)
}
configurations.implementation.setCanBeResolved(true)

def String getAppVersion() {
	Properties versionProperties = getVersionProperties()
	String major = versionProperties.getProperty('major')
	String minor = versionProperties.getProperty('minor')
	String patch = versionProperties.getProperty('patch')
	return major + '.' + minor + '.' + patch
}
def Properties getVersionProperties() {
	def versionProperties = new Properties()
	rootProject.file('version.properties').withInputStream {
		versionProperties.load(it)
	}
	return versionProperties
}