Skip to content

Commit

Permalink
Enable Jacoco coverage (#172)
Browse files Browse the repository at this point in the history
  • Loading branch information
rashidi authored Dec 21, 2024
1 parent 319b821 commit 0abaeb1
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 6 deletions.
25 changes: 25 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import org.springframework.boot.gradle.plugin.SpringBootPlugin

plugins {
id 'java'
id 'jacoco-report-aggregation'
id 'org.springframework.boot' version '3.4.1' apply false
id 'io.spring.dependency-management' version '1.1.7'
id "org.sonarqube" version '6.0.1.5171'
Expand All @@ -20,16 +21,40 @@ repositories {
mavenCentral()
}

dependencies {
subprojects.forEach { p -> {
implementation project(":${p.name}")
}}
}

dependencyManagement {
imports {
mavenBom SpringBootPlugin.BOM_COORDINATES
}
}

reporting {
reports {
testCodeCoverageReport(JacocoCoverageReport) {
testType = TestSuiteType.UNIT_TEST
}
}
}

sonar {
properties {
property "sonar.projectKey", "rashidi_spring-boot-tutorials"
property "sonar.organization", "rashidi-github"
property "sonar.host.url", "https://sonarcloud.io"
}
}

subprojects {
apply {
plugin('jacoco')
}
}

tasks.named('check') {
dependsOn tasks.named('testCodeCoverageReport', JacocoReport)
}
8 changes: 2 additions & 6 deletions cloud-jdbc-env-repo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ ext {
}

dependencies {
implementation platform("org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}")

implementation 'org.springframework.boot:spring-boot-starter-data-jdbc'
implementation 'org.springframework.cloud:spring-cloud-starter-bootstrap'
implementation 'org.springframework.cloud:spring-cloud-config-server'
Expand All @@ -39,12 +41,6 @@ dependencies {
testImplementation 'org.testcontainers:mysql'
}

dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
}
}

tasks.named('test') {
useJUnitPlatform()
}

0 comments on commit 0abaeb1

Please sign in to comment.