2022-07-28 16:51:36 +02:00
|
|
|
plugins {
|
2022-08-04 09:41:27 +02:00
|
|
|
id 'java'
|
2022-07-28 16:51:36 +02:00
|
|
|
id 'org.springframework.boot' version '2.7.2'
|
2022-08-08 16:54:35 +02:00
|
|
|
id 'io.openapiprocessor.openapi-processor' version '2021.3'
|
2022-07-28 16:51:36 +02:00
|
|
|
id 'io.spring.dependency-management' version '1.0.12.RELEASE'
|
2022-08-08 10:03:26 +02:00
|
|
|
id 'com.github.jk1.dependency-license-report' version '2.1'
|
2022-08-04 12:24:54 +02:00
|
|
|
id "org.owasp.dependencycheck" version "7.1.1"
|
2022-08-04 09:41:27 +02:00
|
|
|
id "com.diffplug.spotless" version "6.9.0"
|
2022-07-28 16:51:36 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
group = 'net.hostsharing'
|
|
|
|
version = '0.0.1-SNAPSHOT'
|
|
|
|
|
2022-08-04 12:24:54 +02:00
|
|
|
wrapper {
|
|
|
|
distributionType = Wrapper.DistributionType.BIN
|
|
|
|
gradleVersion = '7.5'
|
|
|
|
}
|
|
|
|
|
2022-07-28 16:51:36 +02:00
|
|
|
configurations {
|
|
|
|
compileOnly {
|
|
|
|
extendsFrom annotationProcessor
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
|
|
|
}
|
|
|
|
|
2022-08-05 13:10:11 +02:00
|
|
|
java {
|
|
|
|
toolchain {
|
|
|
|
languageVersion = JavaLanguageVersion.of(17)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-07-28 16:51:36 +02:00
|
|
|
ext {
|
|
|
|
set('testcontainersVersion', "1.17.3")
|
|
|
|
}
|
|
|
|
|
2022-08-04 09:41:27 +02:00
|
|
|
// wrapper
|
|
|
|
|
2022-07-28 16:51:36 +02:00
|
|
|
dependencies {
|
|
|
|
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
|
|
|
|
implementation 'org.springframework.boot:spring-boot-starter-data-rest'
|
|
|
|
implementation 'org.springframework.boot:spring-boot-starter-jdbc'
|
|
|
|
implementation 'org.springframework.boot:spring-boot-starter-web'
|
2022-08-03 09:06:21 +02:00
|
|
|
implementation 'org.springdoc:springdoc-openapi-ui:1.6.9'
|
2022-07-28 16:51:36 +02:00
|
|
|
implementation 'org.liquibase:liquibase-core'
|
2022-07-29 14:24:50 +02:00
|
|
|
implementation 'com.vladmihalcea:hibernate-types-55:2.17.1'
|
2022-08-08 16:54:35 +02:00
|
|
|
implementation 'org.openapitools:jackson-databind-nullable:0.2.3'// https://mvnrepository.com/artifact/org.modelmapper/modelmapper
|
|
|
|
implementation 'org.modelmapper:modelmapper:3.1.0'
|
2022-07-28 16:51:36 +02:00
|
|
|
|
|
|
|
compileOnly 'org.projectlombok:lombok'
|
|
|
|
|
|
|
|
developmentOnly 'org.springframework.boot:spring-boot-devtools'
|
|
|
|
|
|
|
|
runtimeOnly 'org.postgresql:postgresql'
|
|
|
|
|
|
|
|
annotationProcessor 'org.projectlombok:lombok'
|
|
|
|
|
|
|
|
testImplementation 'org.springframework.boot:spring-boot-starter-test'
|
|
|
|
testImplementation 'org.testcontainers:testcontainers'
|
|
|
|
testImplementation 'org.testcontainers:junit-jupiter'
|
|
|
|
testImplementation 'org.testcontainers:postgresql'
|
2022-08-02 15:17:24 +02:00
|
|
|
testImplementation 'com.tngtech.archunit:archunit-junit5:1.0.0-rc1'
|
2022-07-28 16:51:36 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
dependencyManagement {
|
|
|
|
imports {
|
|
|
|
mavenBom "org.testcontainers:testcontainers-bom:${testcontainersVersion}"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-08-05 13:10:11 +02:00
|
|
|
tasks.withType(JavaCompile) {
|
|
|
|
options.compilerArgs += ["-parameters"]
|
|
|
|
}
|
|
|
|
|
2022-07-28 16:51:36 +02:00
|
|
|
tasks.named('test') {
|
|
|
|
useJUnitPlatform()
|
|
|
|
}
|
2022-08-04 09:41:27 +02:00
|
|
|
|
2022-08-08 16:54:35 +02:00
|
|
|
openapiProcessor {
|
|
|
|
spring {
|
|
|
|
processor 'io.openapiprocessor:openapi-processor-spring:2021.4'
|
|
|
|
apiPath "$projectDir/src/main/resources/api-definition.yaml"
|
|
|
|
targetDir "$projectDir/build/generated/sources/openapi"
|
|
|
|
mapping "$projectDir/src/main/resources/api-mappings.yaml"
|
|
|
|
showWarnings true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
sourceSets.main.java.srcDir 'build/generated/sources/openapi'
|
|
|
|
compileJava.dependsOn('processSpring')
|
|
|
|
|
2022-08-04 09:41:27 +02:00
|
|
|
spotless {
|
|
|
|
java {
|
|
|
|
removeUnusedImports()
|
|
|
|
endWithNewline()
|
|
|
|
toggleOffOn()
|
2022-08-08 16:54:35 +02:00
|
|
|
|
|
|
|
// target 'src/main/java**/*.java', 'src/test/java**/*.java' // not generated
|
|
|
|
target project.fileTree(project.rootDir) {
|
|
|
|
include '**/*.java'
|
|
|
|
exclude '**/generated/**/*.java'
|
|
|
|
}
|
2022-08-04 09:41:27 +02:00
|
|
|
}
|
|
|
|
}
|
2022-08-04 12:26:41 +02:00
|
|
|
project.tasks.check.dependsOn(spotlessCheck)
|
|
|
|
|
|
|
|
dependencyCheck {
|
|
|
|
cveValidForHours=4
|
|
|
|
format = 'ALL'
|
|
|
|
suppressionFile = 'etc/owasp-dependency-check-suppression.xml'
|
|
|
|
failOnError = true
|
|
|
|
failBuildOnCVSS = 7
|
|
|
|
}
|
|
|
|
project.tasks.check.dependsOn(dependencyCheckAnalyze)
|
2022-08-08 10:03:26 +02:00
|
|
|
|
|
|
|
licenseReport {
|
|
|
|
excludeBoms = true
|
|
|
|
allowedLicensesFile = new File("$projectDir/etc/allowed-licenses.json")
|
|
|
|
}
|
|
|
|
project.tasks.check.dependsOn(checkLicense)
|