plugins { id 'java' id 'org.springframework.boot' id 'io.spring.dependency-management' id 'com.github.johnrengelman.shadow' id 'maven-publish' // publish lib jar to artifact repository id 'com.diffplug.spotless' // code formatting id 'com.github.spotbugs' // bug linting that can be picked up by IDE } group 'org.onap.portal-ng' version getAppVersion() dependencies { implementation project(':openapi:server') implementation project(':openapi:client-preferences') implementation project(':openapi:client-history') implementation project(':openapi:client-keycloak') implementation 'org.springframework.boot:spring-boot-starter-webflux' implementation 'org.springframework.boot:spring-boot-starter-actuator' implementation 'org.springframework.boot:spring-boot-starter-validation' implementation 'org.springframework.boot:spring-boot-starter-security' implementation 'org.springframework.boot:spring-boot-starter-oauth2-client' implementation 'org.springframework.boot:spring-boot-starter-oauth2-resource-server' implementation "org.zalando:jackson-datatype-problem:$problemVersion" implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml' implementation "org.zalando:problem-spring-webflux:$problemSpringVersion" implementation "org.mapstruct:mapstruct:$mapStructVersion" implementation "org.mapstruct.extensions.spring:mapstruct-spring-annotations:$mapStructExtensionsVersion" implementation "org.mapstruct.extensions.spring:mapstruct-spring-extensions:$mapStructExtensionsVersion" 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") annotationProcessor "org.mapstruct:mapstruct-processor:$mapStructVersion" annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor' compileOnly "org.projectlombok:lombok:$lombokVersion" annotationProcessor "org.projectlombok:lombok:$lombokVersion" testCompileOnly "org.projectlombok:lombok:$lombokVersion" testAnnotationProcessor "org.projectlombok:lombok:$lombokVersion" } bootJar { enabled = false } jar { enabled = true } shadowJar { archiveBaseName.set('bff') dependencies { include(project(':openapi:server')) include(project(':openapi:client-history')) include(project(':openapi:client-preferences')) include(project(':openapi:client-keycloak')) } } publishing { publications { bffLibrary(MavenPublication) { artifactId = rootProject.name groupId = group version = version artifacts = ["build/libs/bff-$version-all.jar"] pom { name = rootProject.name description = 'portal-ng backend-for-frontend service' } } } repositories{ mavenCentral() } } spotless { java { target project.fileTree(project.projectDir) { include '**/*.java' exclude '**/build/**' exclude '**/generated-sources/**' } removeUnusedImports() trimTrailingWhitespace() googleJavaFormat('1.15.0') } } tasks.withType(JavaCompile) { dependsOn 'spotlessApply' } spotbugs { ignoreFailures = false reportLevel = "high" excludeFilter = file("$rootProject.projectDir/spotbugs-exclude.xml") } 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 }