Skip to content

Instantly share code, notes, and snippets.

@rmsaitam
Created March 11, 2026 19:34
Show Gist options
  • Select an option

  • Save rmsaitam/04c524fae124323b2c7fae6518ac6ccb to your computer and use it in GitHub Desktop.

Select an option

Save rmsaitam/04c524fae124323b2c7fae6518ac6ccb to your computer and use it in GitHub Desktop.
Arquivo Grandle com Spring Framework 7 + Java 21 + JUnit + cobertura mínima de 80%
plugins {
id 'java'
id 'jacoco'
}
group = 'com.exemplo'
version = '1.0.0'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
repositories {
mavenCentral()
}
ext {
springVersion = '7.0.4'
}
dependencies {
implementation "org.springframework:spring-context:${springVersion}"
implementation "org.springframework:spring-web:${springVersion}"
testImplementation 'org.junit.jupiter:junit-jupiter:5.10.2'
}
test {
useJUnitPlatform()
}
jacoco {
toolVersion = "0.8.11"
}
jacocoTestReport {
dependsOn test
}
jacocoTestCoverageVerification {
violationRules {
rule {
limit {
minimum = 0.80
}
}
}
}
check.dependsOn jacocoTestCoverageVerification
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment