@@ -8,7 +8,7 @@ plugins {
8
8
id " idea"
9
9
id " jacoco" // Java Code Coverage plugin
10
10
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
12
12
id " checkstyle"
13
13
id " org.openapi.generator" version " 5.3.0"
14
14
}
@@ -45,6 +45,18 @@ project.ext {
45
45
buildVersionFileName = " cruise-control-version.properties"
46
46
commitId = project. hasProperty(' commitId' ) ? commitId : null
47
47
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
+ )
48
60
}
49
61
50
62
allprojects {
@@ -104,7 +116,7 @@ subprojects {
104
116
}
105
117
106
118
spotbugs {
107
- toolVersion = ' 4.7.1 '
119
+ toolVersion = ' 4.8.6 '
108
120
excludeFilter = file(" $rootDir /gradle/findbugs-exclude.xml" )
109
121
ignoreFailures = false
110
122
jvmArgs = [ ' -Xms512m' ]
@@ -137,6 +149,8 @@ subprojects {
137
149
}
138
150
139
151
test {
152
+ jvmArgs + = defaultTestJvmArgs
153
+
140
154
useJUnit {}
141
155
testLogging {
142
156
events " passed" , " failed" , " skipped"
@@ -175,7 +189,7 @@ project(':cruise-control-core') {
175
189
implementation " org.apache.logging.log4j:log4j-slf4j-impl:2.17.2"
176
190
implementation ' org.apache.commons:commons-math3:3.6.1'
177
191
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 '
179
193
180
194
api " io.vertx:vertx-core:${ vertxVersion} "
181
195
api " io.vertx:vertx-web:${ vertxVersion} "
@@ -311,7 +325,7 @@ project(':cruise-control') {
311
325
testImplementation project(path : ' :cruise-control-core' , configuration : ' testOutput' )
312
326
testImplementation " org.scala-lang:scala-library:$scalaVersion "
313
327
testImplementation ' junit:junit:4.13.2'
314
- testImplementation ' org.easymock:easymock:4.3 '
328
+ testImplementation ' org.easymock:easymock:5.5.0 '
315
329
testImplementation " org.apache.kafka:kafka_$scalaBinaryVersion :$kafkaVersion :test"
316
330
testImplementation " org.apache.kafka:kafka-clients:$kafkaVersion :test"
317
331
testImplementation ' commons-io:commons-io:2.11.0'
0 commit comments