@@ -8,7 +8,7 @@ plugins {
88 id " idea"
99 id " jacoco" // Java Code Coverage plugin
1010 id " com.github.ben-manes.versions" version " 0.42.0"
11- id " com.github.spotbugs" version " 6.0.6 " apply false
11+ id " com.github.spotbugs" version " 6.0.25 " apply false
1212 id " checkstyle"
1313 id " org.openapi.generator" version " 5.3.0"
1414}
@@ -45,6 +45,18 @@ project.ext {
4545 buildVersionFileName = " cruise-control-version.properties"
4646 commitId = project. hasProperty(' commitId' ) ? commitId : null
4747 scalaBinaryVersion = getScalaBinaryVersion(scalaVersion)
48+
49+ defaultTestJvmArgs = []
50+ // "JEP 403: Strongly Encapsulate JDK Internals" causes some tests to fail when they try
51+ // to access internals (often via mocking libraries). We use `--add-opens` as a workaround
52+ if (JavaVersion . current(). isCompatibleWith(JavaVersion . VERSION_16 ))
53+ defaultTestJvmArgs. addAll(
54+ " --add-opens=java.base/java.lang.reflect=ALL-UNNAMED" ,
55+ " --add-opens=java.base/java.lang=ALL-UNNAMED" ,
56+ " --add-opens=java.base/java.time=ALL-UNNAMED" ,
57+ " --add-opens=java.base/java.util.concurrent=ALL-UNNAMED" ,
58+ " --add-opens=java.base/java.util=ALL-UNNAMED"
59+ )
4860}
4961
5062allprojects {
@@ -104,7 +116,7 @@ subprojects {
104116 }
105117
106118 spotbugs {
107- toolVersion = ' 4.7.1 '
119+ toolVersion = ' 4.8.6 '
108120 excludeFilter = file(" $rootDir /gradle/findbugs-exclude.xml" )
109121 ignoreFailures = false
110122 jvmArgs = [ ' -Xms512m' ]
@@ -137,6 +149,8 @@ subprojects {
137149 }
138150
139151 test {
152+ jvmArgs + = defaultTestJvmArgs
153+
140154 useJUnit {}
141155 testLogging {
142156 events " passed" , " failed" , " skipped"
@@ -175,7 +189,7 @@ project(':cruise-control-core') {
175189 implementation " org.apache.logging.log4j:log4j-slf4j-impl:2.17.2"
176190 implementation ' org.apache.commons:commons-math3:3.6.1'
177191 api " org.eclipse.jetty:jetty-servlet:${ jettyVersion} "
178- implementation ' com.google.code.findbugs:jsr305:3.0.2 '
192+ implementation ' com.github.spotbugs:spotbugs-annotations:4.8.6 '
179193
180194 api " io.vertx:vertx-core:${ vertxVersion} "
181195 api " io.vertx:vertx-web:${ vertxVersion} "
@@ -311,7 +325,7 @@ project(':cruise-control') {
311325 testImplementation project(path : ' :cruise-control-core' , configuration : ' testOutput' )
312326 testImplementation " org.scala-lang:scala-library:$scalaVersion "
313327 testImplementation ' junit:junit:4.13.2'
314- testImplementation ' org.easymock:easymock:4.3 '
328+ testImplementation ' org.easymock:easymock:5.5.0 '
315329 testImplementation " org.apache.kafka:kafka_$scalaBinaryVersion :$kafkaVersion :test"
316330 testImplementation " org.apache.kafka:kafka-clients:$kafkaVersion :test"
317331 testImplementation ' commons-io:commons-io:2.11.0'
0 commit comments