74 lines
2.3 KiB
Groovy
74 lines
2.3 KiB
Groovy
plugins {
|
|
id "java"
|
|
id "jacoco"
|
|
id "org.springframework.boot" version "${springBootVersion}"
|
|
id "org.sonarqube" version "${sonarQubeVersion}"
|
|
}
|
|
|
|
group "${projectGroup}"
|
|
version "${projectVersion}"
|
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
|
targetCompatibility = JavaVersion.VERSION_1_8
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
}
|
|
|
|
dependencies {
|
|
implementation group: "org.springframework.boot", name:"spring-boot-starter-web", version:"${springBootVersion}"
|
|
implementation group: "org.springframework.boot", name:"spring-boot-starter-validation", version:"${springBootVersion}"
|
|
implementation group: "org.springframework.kafka", name: "spring-kafka", version: "${springKafkaVersion}"
|
|
|
|
implementation group: "org.projectlombok", name: "lombok", version: "${lombokVersion}"
|
|
annotationProcessor group: "org.projectlombok", name: "lombok", version: "${lombokVersion}"
|
|
|
|
testImplementation group: "org.springframework.boot", name: "spring-boot-starter-test", version:"${springBootVersion}"
|
|
testImplementation group: "org.springframework.kafka", name: "spring-kafka-test", version:"${springKafkaVersion}"
|
|
testImplementation group: "org.awaitility", name: "awaitility", version: "${awaitilityVersion}"
|
|
}
|
|
|
|
springBoot {
|
|
mainClass.set("${applicationClass}")
|
|
}
|
|
|
|
compileJava {
|
|
options.encoding = "UTF-8"
|
|
}
|
|
|
|
test {
|
|
useJUnitPlatform()
|
|
finalizedBy jacocoTestReport
|
|
}
|
|
|
|
bootBuildImage {
|
|
imageName = "${rootProject.name}:${projectVersion}"
|
|
}
|
|
|
|
bootRun {
|
|
if ( project.hasProperty('jvmArgs') ) {
|
|
jvmArgs project.jvmArgs.split('\\s+')
|
|
}
|
|
}
|
|
|
|
jacocoTestReport {
|
|
reports {
|
|
xml.enabled true
|
|
html.enabled true
|
|
csv.enabled false
|
|
xml.destination file("${buildDir}/jacoco/xml/jacoco.xml")
|
|
html.destination file("${buildDir}/jacoco/html")
|
|
}
|
|
dependsOn test
|
|
}
|
|
|
|
sonarqube {
|
|
properties {
|
|
property "sonar.sourceEncoding", "UTF-8"
|
|
property "sonar.exclusions", "**/Application.java, **/dto/**"
|
|
property "sonar.java.source", "${project.sourceCompatibility}"
|
|
property "sonar.java.target", "${project.targetCompatibility}"
|
|
property "sonar.junit.reportsPath", "${buildDir}/reports/tests"
|
|
property "sonar.coverage.jacoco.xmlReportPaths", "${buildDir}/jacoco/xml/jacoco.xml"
|
|
}
|
|
}
|
|
tasks.sonarqube.dependsOn test |