plugins {
- id 'application'
- id 'org.springframework.boot'
- id 'io.spring.dependency-management'
- id 'com.gorylenko.gradle-git-properties'
- id 'jacoco'
+ id 'java'
+ id 'org.springframework.boot'
+ id 'io.spring.dependency-management'
+ id 'com.gorylenko.gradle-git-properties' // commit information in actuator
+ id 'jacoco' // code coverage
id 'com.diffplug.spotless'
}
-dependencyManagement {
- imports {
- mavenBom "org.springframework.cloud:spring-cloud-contract-dependencies:$springCloudVersion"
- }
+group = 'org.onap.portalng'
+
+java {
+ sourceCompatibility = JavaVersion.VERSION_17
+}
+
+configurations {
+ compileOnly {
+ extendsFrom annotationProcessor
+ }
}
+// repositories {
+// mavenCentral()
+// }
+
dependencies {
- implementation project(':openapi:server')
- implementation project(':openapi:client-portal-prefs')
+ implementation project(':openapi:server')
implementation project(':openapi:client-portal-history')
+ implementation project(':openapi:client-portal-prefs')
implementation project(':openapi:client-portal-keycloak')
-
- implementation project(':lib')
-
+ implementation project(':lib')
+
+ 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.springframework.boot:spring-boot-starter-webflux'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation "org.mapstruct.extensions.spring:mapstruct-spring-annotations:$mapStructExtensionsVersion"
implementation "org.mapstruct.extensions.spring:mapstruct-spring-extensions:$mapStructExtensionsVersion"
+ implementation "org.springframework.boot:spring-boot-starter-logging"
+ implementation "net.logstash.logback:logstash-logback-encoder:$logbackVersion"
+ compileOnly "org.projectlombok:lombok:$lombokVersion"
+ annotationProcessor "org.projectlombok:lombok:$lombokVersion"
+ testCompileOnly "org.projectlombok:lombok:$lombokVersion"
+ testAnnotationProcessor "org.projectlombok:lombok:$lombokVersion"
+
testImplementation 'io.projectreactor:reactor-test'
- testImplementation 'org.springframework.cloud:spring-cloud-contract-wiremock'
+ testImplementation "org.springframework.cloud:spring-cloud-contract-wiremock:$wiremockVersion"
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'io.rest-assured:rest-assured'
}
-mainClassName = 'org.onap.portalng.bff.Application'
-
-bootJar {
- launchScript()
- enabled = true
- excludes = ['**/application-local.yml', '**/application-development.yml', '**/log4j.xml']
-}
-
-springBoot {
- buildInfo {
- properties {
- artifact = 'org-onap-portalng-bff'
- version = getVersion()
- group = rootProject.group
- name = 'portal-ng backend for frontend'
- }
- }
+tasks.named('test') {
+ useJUnitPlatform()
}
+test.finalizedBy jacocoTestReport
jacocoTestReport {
reports {
xml.required = true
}
}
-test.finalizedBy jacocoTestReport
-
-configurations.implementation.setCanBeResolved(true)
spotless {
java {
googleJavaFormat('1.15.0')
}
}
-
tasks.withType(JavaCompile) {
dependsOn 'spotlessApply'
}
\ No newline at end of file
-import org.springframework.boot.gradle.plugin.SpringBootPlugin
-
-buildscript {
- repositories {
- mavenCentral()
- maven {
- url "https://plugins.gradle.org/m2/"
- }
- }
-
- ext {
- springBootVersion = '2.7.3'
- springCloudVersion = '3.1.3'
- lombokVersion = '1.18.24'
- openapiVersion = '6.6.0'
- redocVersion = '2.0.0-rc.65'
- spotlessVersion = '6.10.0'
- spotbugsVersion = '5.0.10'
- problemVersion = '0.27.1'
- problemSpringVersion = '0.27.0'
- logstashLogbackVersion = '7.2'
- mapStructVersion = '1.5.2.Final'
- mapStructExtensionsVersion = '0.1.2'
- gorylenkoVersion= '2.4.1'
- licenseVersion = '0.16.1'
- shadowVersion = '7.1.2'
- }
-
- dependencies {
- classpath "com.diffplug.spotless:spotless-plugin-gradle:$spotlessVersion"
- classpath "com.github.spotbugs.snom:spotbugs-gradle-plugin:$spotbugsVersion"
- classpath "org.springframework.boot:spring-boot-gradle-plugin:$springBootVersion"
- classpath "org.openapitools:openapi-generator-gradle-plugin:$openapiVersion"
- classpath "com.gorylenko.gradle-git-properties:gradle-git-properties:$gorylenkoVersion"
- classpath "gradle.plugin.com.hierynomus.gradle.plugins:license-gradle-plugin:$licenseVersion"
- classpath "gradle.plugin.com.github.johnrengelman:shadow:$shadowVersion"
- }
-}
-
-group = 'org.onap'
-version = rootProject.file('version').text.trim()
-
allprojects {
- apply plugin: 'java'
- apply plugin: 'idea'
- apply plugin: 'io.spring.dependency-management'
-
-
- sourceCompatibility = 17
- targetCompatibility = 17
-
- dependencyManagement {
- imports {
- mavenBom SpringBootPlugin.BOM_COORDINATES
- }
- }
-
- repositories {
- mavenCentral()
- }
-
- test {
- useJUnitPlatform()
- }
-
- dependencies {
- implementation "org.springframework.boot:spring-boot-starter-logging"
- implementation "net.logstash.logback:logstash-logback-encoder:$logstashLogbackVersion"
+ repositories {
+ mavenCentral()
+ }
+}
- compileOnly "org.projectlombok:lombok:$lombokVersion"
- annotationProcessor "org.projectlombok:lombok:$lombokVersion"
- testCompileOnly "org.projectlombok:lombok:$lombokVersion"
- testAnnotationProcessor "org.projectlombok:lombok:$lombokVersion"
- }
+ext {
+ // app + lib
+ problemVersion = '0.27.1'
+ problemSpringVersion = '0.27.0'
+ mapStructVersion = '1.5.2.Final'
+ mapStructExtensionsVersion = '0.1.2'
+ logbackVersion = '7.2'
+ lombokVersion = '1.18.28'
+
+ // app
+ wiremockVersion = '3.1.3'
}
\ No newline at end of file
plugins {
- id 'com.gorylenko.gradle-git-properties'
- id 'jacoco'
- id 'com.github.johnrengelman.shadow'
- id 'maven-publish'
- id 'java-library'
- id 'com.diffplug.spotless'
- id 'com.github.spotbugs'
+ 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.portalng'
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 {
googleJavaFormat('1.15.0')
}
}
-
tasks.withType(JavaCompile) {
dependsOn 'spotlessApply'
}
spotbugs {
ignoreFailures = false
- effort = "max"
reportLevel = "high"
excludeFilter = file("$rootProject.projectDir/spotbugs-exclude.xml")
}
\ No newline at end of file
--- /dev/null
+plugins {
+ id 'java'
+ id 'io.spring.dependency-management'
+}
+
+dependencies {
+ implementation project('server')
+ implementation project('client-portal-history')
+ implementation project('client-portal-keycloak')
+ implementation project('client-portal-prefs')
+}
+ext {
+ openapiVersion = '7.0.0-beta'
+}
+subprojects {
+ repositories {
+ mavenCentral()
+ }
+}
\ No newline at end of file
plugins {
+ id 'java'
+ id 'idea'
+ id 'org.springframework.boot'
+ id 'io.spring.dependency-management'
id 'org.openapi.generator'
}
dependencies {
- implementation "org.springframework.boot:spring-boot-starter-webflux"
- implementation "org.openapitools:openapi-generator:$openapiVersion"
+ implementation 'org.springframework.boot:spring-boot-starter-webflux'
+ implementation "org.openapitools:openapi-generator:$openapiVersion"
}
-compileJava {
- dependsOn = ['openApiGenerate_history']
-}
-
-sourceSets {
- main {
- java {
- srcDirs += file("$buildDir/openapi/src/main/java")
- }
- }
-}
-
-idea {
- module {
- generatedSourceDirs += file("$buildDir/openapi/src/main/java")
- }
-}
-
-tasks.register('openApiGenerate_history', org.openapitools.generator.gradle.plugin.tasks.GenerateTask) {
+openApiGenerate {
generatorName = "java"
library = "webclient"
inputSpec = "${project.projectDir}/src/portal_history_openapi.yaml"
apiPackage = "org.onap.portalng.bff.openapi.client_portal_history.api"
modelPackage = "org.onap.portalng.bff.openapi.client_portal_history.model"
modelNameSuffix = "PortalHistoryDto"
+}
+
+compileJava {
+ dependsOn tasks.openApiGenerate
+}
+
+sourceSets {
+ main {
+ java {
+ srcDirs += file("$buildDir/openapi/src/main/java")
+ }
+ }
+}
+
+idea {
+ module {
+ generatedSourceDirs += file("$buildDir/openapi/src/main/java")
+ }
+}
+
+bootJar {
+ enabled = false
+}
+
+jar {
+ enabled = true
}
\ No newline at end of file
plugins {
+ id 'java'
+ id 'idea'
+ id 'org.springframework.boot'
+ id 'io.spring.dependency-management'
id 'org.openapi.generator'
}
dependencies {
- implementation "org.springframework.boot:spring-boot-starter-webflux"
- implementation "org.openapitools:openapi-generator:$openapiVersion"
+ implementation 'org.springframework.boot:spring-boot-starter-webflux'
+ implementation "org.openapitools:openapi-generator:$openapiVersion"
}
-compileJava {
- dependsOn = ['openApiGenerate_keycloak']
-}
-
-sourceSets {
- main {
- java {
- srcDirs += file("$buildDir/openapi/src/main/java")
- }
- }
-}
-
-idea {
- module {
- generatedSourceDirs += file("$buildDir/openapi/src/main/java")
- }
-}
-
-tasks.register('openApiGenerate_keycloak', org.openapitools.generator.gradle.plugin.tasks.GenerateTask) {
+openApiGenerate {
generatorName = "java"
library = "webclient"
inputSpec = "${project.projectDir}/src/portal_keycloak_openapi.yaml"
- outputDir = "${buildDir}/openapi"
+ outputDir = "${project.buildDir}/openapi"
configOptions = [
openApiNullable : "false",
dateLibrary : "java8",
apiPackage = "org.onap.portalng.bff.openapi.client_portal_keycloak.api"
modelPackage = "org.onap.portalng.bff.openapi.client_portal_keycloak.model"
modelNameSuffix = "KeycloakDto"
+}
+
+compileJava {
+ dependsOn tasks.openApiGenerate
+}
+
+sourceSets {
+ main {
+ java {
+ srcDirs += file("$buildDir/openapi/src/main/java")
+ }
+ }
+}
+
+idea {
+ module {
+ generatedSourceDirs += file("$buildDir/openapi/src/main/java")
+ }
+}
+
+bootJar {
+ enabled = false
+}
+
+jar {
+ enabled = true
}
\ No newline at end of file
plugins {
+ id 'java'
+ id 'idea'
+ id 'org.springframework.boot'
+ id 'io.spring.dependency-management'
id 'org.openapi.generator'
}
dependencies {
- implementation "org.springframework.boot:spring-boot-starter-webflux"
- implementation "org.openapitools:openapi-generator:$openapiVersion"
+ implementation 'org.springframework.boot:spring-boot-starter-webflux'
+ implementation "org.openapitools:openapi-generator:$openapiVersion"
}
-compileJava {
- dependsOn = ['openApiGenerate_preferences']
-}
-
-sourceSets {
- main {
- java {
- srcDirs += file("$buildDir/openapi/src/main/java")
- }
- }
-}
-
-idea {
- module {
- generatedSourceDirs += file("$buildDir/openapi/src/main/java")
- }
-}
-
-tasks.register('openApiGenerate_preferences', org.openapitools.generator.gradle.plugin.tasks.GenerateTask) {
+openApiGenerate {
generatorName = "java"
library = "webclient"
inputSpec = "${project.projectDir}/src/portal_prefs_openapi.yaml"
apiPackage = "org.onap.portalng.bff.openapi.client_portal_prefs.api"
modelPackage = "org.onap.portalng.bff.openapi.client_portal_prefs.model"
modelNameSuffix = "PortalPrefsDto"
+}
+
+compileJava {
+ dependsOn tasks.openApiGenerate
+}
+
+sourceSets {
+ main {
+ java {
+ srcDirs += file("$buildDir/openapi/src/main/java")
+ }
+ }
+}
+
+idea {
+ module {
+ generatedSourceDirs += file("$buildDir/openapi/src/main/java")
+ }
+}
+
+bootJar {
+ enabled = false
+}
+
+jar {
+ enabled = true
}
\ No newline at end of file
plugins {
+ id 'java'
+ id 'idea'
+ id 'org.springframework.boot'
+ id 'io.spring.dependency-management'
id 'org.openapi.generator'
}
dependencies {
- implementation "org.springframework.boot:spring-boot-starter-webflux"
+ implementation 'org.springframework.boot:spring-boot-starter-webflux'
implementation "org.openapitools:openapi-generator:$openapiVersion"
- implementation "org.webjars:redoc:$redocVersion"
+ // implementation 'jakarta.validation:jakarta.validation-api:3.0.2'
constraints {
implementation('io.swagger.core.v3:swagger-annotations:2.2.5') {
generatedSourceDirs += file("$buildDir/openapi/src/main/java")
}
}
+
+bootJar {
+ enabled = false
+}
+
+jar {
+ enabled = true
+}
\ No newline at end of file
// https://docs.gradle.org/current/userguide/plugins.html#sec:plugin_version_management
plugins {
id 'io.spring.dependency-management' version '1.1.2'
- id 'org.springframework.boot' version '3.1.2'
+ id 'org.springframework.boot' version '2.7.14'
+ id 'org.openapi.generator' version '7.0.0-beta'
+ id 'com.github.johnrengelman.shadow' version '7.1.2'
id 'com.github.hierynomus.license' version '0.16.1'
id 'com.gorylenko.gradle-git-properties' version '2.4.1'
- id 'org.openapi.generator' version '7.0.0-beta'
id 'com.diffplug.spotless' version '6.20.0'
- id 'com.github.johnrengelman.shadow' version '7.1.2'
id 'com.github.spotbugs' version '5.0.14'
}
// https://docs.gradle.org/current/userguide/plugins.html#sec:custom_plugin_repositories