Skip to content

Commit 2504b34

Browse files
committed
Bump spotbugs, and other quality improvements
1 parent 93294cd commit 2504b34

1 file changed

Lines changed: 21 additions & 8 deletions

File tree

build.gradle

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ plugins {
77
id 'java-library'
88
id 'maven-publish'
99
id 'checkstyle'
10-
id 'com.github.spotbugs' version '6.5.9'
11-
id 'com.github.ben-manes.versions' version '0.61.0'
10+
id 'com.github.spotbugs' version '6.5.10'
11+
id 'io.github.ben-manes.versions' version '0.61.0'
1212
}
1313

1414
ext {
@@ -35,7 +35,6 @@ test {
3535
}
3636

3737
checkstyle {
38-
toolVersion = '10.21.1'
3938
maxWarnings = 0
4039
}
4140

@@ -87,15 +86,14 @@ dependencies {
8786
annotationProcessor lombok
8887

8988
compileOnly lombok
89+
compileOnly 'com.github.spotbugs:spotbugs-annotations:4.10.3'
9090

91-
implementation('com.github.spotbugs:spotbugs-annotations:4.10.3') {
92-
exclude group: 'org.junit', module: 'junit-bom'
93-
}
9491
implementation 'com.github.bbottema:emailaddress-rfc2822:2.3.1'
9592

9693
testAnnotationProcessor lombok
9794

9895
testCompileOnly lombok
96+
testCompileOnly 'com.github.spotbugs:spotbugs-annotations:4.10.3'
9997

10098
testImplementation platform('org.junit:junit-bom:5.14.4')
10199
testImplementation 'org.junit.jupiter:junit-jupiter-api'
@@ -106,8 +104,6 @@ dependencies {
106104
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
107105
}
108106

109-
dependencyUpdates.gradleReleaseChannel="current"
110-
111107
// See https://github.com/jeremylong/DependencyCheck/issues/2764#issuecomment-680680558 for an explanation
112108
dependencies {
113109
components {
@@ -119,4 +115,21 @@ class ClearDependencies implements ComponentMetadataRule {
119115
void execute(ComponentMetadataContext context) {
120116
context.details.allVariants { withDependencies { clear() } }
121117
}
118+
}
119+
120+
def isNonStable = { String version ->
121+
def stableKeyword = ['RELEASE', 'FINAL', 'GA'].any { it -> version.toUpperCase().contains(it) }
122+
def regex = /^[0-9,.v-]+(-r|-jre|-android)?$/
123+
return !stableKeyword && !(version ==~ regex)
124+
}
125+
126+
def notJava11 = { selection ->
127+
return selection.group.startsWith("org.junit") && selection.version.startsWith("6.")
128+
}
129+
130+
tasks.named("dependencyUpdates") {
131+
gradleReleaseChannel = "current"
132+
rejectVersionIf {
133+
isNonStable(candidate.version) || notJava11(candidate)
134+
}
122135
}

0 commit comments

Comments
 (0)