1
0
Fork 0
petclinic/backend/build.gradle.kts

87 lines
2.8 KiB
Text
Raw Normal View History

2024-11-21 20:22:38 -05:00
plugins {
java
id("org.springframework.boot") version "3.3.6"
id("io.spring.dependency-management") version "1.1.6"
idea
jacoco
}
group = "org.springframework.samples"
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
repositories {
mavenCentral()
}
dependencies {
implementation("org.springframework.boot:spring-boot-starter-actuator")
implementation("org.springframework.boot:spring-boot-starter-cache")
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
implementation("org.springframework.boot:spring-boot-starter-jdbc")
implementation("org.springframework.boot:spring-boot-starter-security")
implementation("org.springframework.boot:spring-boot-starter-validation")
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springframework.data:spring-data-jdbc-core:1.2.1.RELEASE")
implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:2.6.0")
implementation("org.mapstruct:mapstruct:${project.property("mapstructVersion")}")
2024-11-21 21:42:41 -05:00
implementation(project(":backend-model"))
2024-11-21 20:22:38 -05:00
annotationProcessor("org.mapstruct:mapstruct-processor:${project.property("mapstructVersion")}")
runtimeOnly("org.hsqldb:hsqldb")
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("org.springframework.security:spring-security-test")
testImplementation("com.jayway.jsonpath:json-path")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}
tasks.jacocoTestReport {
dependsOn(tasks.test) // tests are required to run before generating the report
classDirectories.setFrom(
files(classDirectories.files.map {
fileTree(it) {
exclude(
"**/org/springframework/samples/petclinic/rest/dto/**",
"**/org/springframework/samples/petclinic/rest/api/**"
)
}
})
)
}
tasks.jacocoTestCoverageVerification {
violationRules {
rule {
element = "BUNDLE"
limit {
counter = "LINE"
value = "COVEREDRATIO"
minimum = "0.85".toBigDecimal()
}
limit {
counter = "BRANCH"
value = "COVEREDRATIO"
minimum = "0.66".toBigDecimal()
}
}
}
}
tasks.withType<Test> {
useJUnitPlatform()
finalizedBy(tasks.jacocoTestReport) // report is always generated after tests run
configure<JacocoTaskExtension> {
}
}
tasks.withType<JavaCompile> {
options.compilerArgs = listOf(
"-Amapstruct.suppressGeneratorTimestamp=true",
"-Amapstruct.suppressGeneratorVersionInfoComment=true",
"-Amapstruct.defaultComponentModel=spring"
)
}