11plugins {
2- id ' java'
3- id ' com.adarshr.test-logger' version ' 4.0.0'
42 id ' checkstyle'
3+ id ' com.adarshr.test-logger' version ' 4.0.0'
4+ id " com.github.spotbugs" version " 6.0.23"
55 id ' idea' // optional (to generate IntelliJ IDEA project files)
6+ id ' java'
67}
78
89group = ' com.example'
910version = ' 1.0-SNAPSHOT'
1011
1112java {
12- sourceCompatibility = JavaVersion . VERSION_18
13+ sourceCompatibility = JavaVersion . VERSION_21
14+ targetCompatibility = JavaVersion . VERSION_21
1315}
1416
1517repositories {
@@ -18,36 +20,33 @@ repositories {
1820}
1921
2022dependencies {
21- testImplementation(platform(' org.junit:junit-bom:5.11.2' ))
22- testImplementation(' org.junit.jupiter:junit-jupiter' )
23- testImplementation (' org.junit.jupiter:junit-jupiter-params' )
24- testRuntimeOnly(' org.junit.platform:junit-platform-launcher' )
23+ testImplementation platform(' org.junit:junit-bom:5.11.2' )
24+ testImplementation ' org.junit.jupiter:junit-jupiter'
25+ testImplementation ' org.junit.jupiter:junit-jupiter-params'
26+ testRuntimeOnly ' org.junit.platform:junit-platform-launcher'
27+ compileOnly ' com.github.spotbugs:spotbugs-annotations:4.8.6'
28+ spotbugsPlugins ' com.h3xstream.findsecbugs:findsecbugs-plugin:1.12.0'
29+ testCompileOnly ' com.github.spotbugs:spotbugs-annotations:4.8.6'
2530}
2631
2732test {
2833 useJUnitPlatform()
2934}
3035
31- apply plugin : ' checkstyle'
3236checkstyle {
33- toolVersion = ' 10.3' // Specify the Checkstyle version
34- configFile = file(' config/checkstyle/checkstyle.xml' ) // Path to your checkstyle.xml
35-
36- ignoreFailures = false
37- showViolations = true
37+ toolVersion ' 10.18.1'
38+ maxWarnings = 0
3839}
3940
40- checkstyleMain {
41- source = ' src/main/java'
42- }
43-
44- checkstyleTest {
45- source = ' src/test/java'
41+ configurations. checkstyle {
42+ resolutionStrategy. capabilitiesResolution. withCapability(" com.google.collections:google-collections" ) {
43+ select(" com.google.guava:guava:23.0" )
44+ }
4645}
4746
48- tasks. withType(Checkstyle ) {
47+ tasks. withType(Checkstyle ). configureEach {
4948 reports {
50- xml. required. set( false )
51- html. required. set( true ) // Enable HTML report
49+ xml. required = false
50+ html. required = true
5251 }
53- }
52+ }
0 commit comments