Skip to content

Commit

Permalink
Update maven spotbugs plugin to support Java 14 (SAP#1852)
Browse files Browse the repository at this point in the history
  • Loading branch information
fwilhe authored Jul 28, 2020
1 parent e411324 commit 60796cd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cmd/mavenExecuteStaticCodeChecks.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func getSpotBugsMavenParameters(config *mavenExecuteStaticCodeChecksOptions) *ma

mavenOptions := maven.ExecuteOptions{
// check goal executes spotbugs goal first and fails the build if any bugs were found
Goals: []string{"com.github.spotbugs:spotbugs-maven-plugin:3.1.12:check"},
Goals: []string{"com.github.spotbugs:spotbugs-maven-plugin:4.0.4:check"},
Defines: defines,
}

Expand Down
6 changes: 3 additions & 3 deletions cmd/mavenExecuteStaticCodeChecks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func TestRunMavenStaticCodeChecks(t *testing.T) {
"-Dpmd.failurePriority=2",
"-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn",
"--batch-mode",
"com.github.spotbugs:spotbugs-maven-plugin:3.1.12:check",
"com.github.spotbugs:spotbugs-maven-plugin:4.0.4:check",
"org.apache.maven.plugins:maven-pmd-plugin:3.13.0:check",
},
}
Expand Down Expand Up @@ -109,7 +109,7 @@ func TestGetSpotBugsMavenParameters(t *testing.T) {
SpotBugsMaxAllowedViolations: 123,
}
expected := maven.ExecuteOptions{
Goals: []string{"com.github.spotbugs:spotbugs-maven-plugin:3.1.12:check"},
Goals: []string{"com.github.spotbugs:spotbugs-maven-plugin:4.0.4:check"},
Defines: []string{"-Dspotbugs.includeFilterFile=includeFilter.xml", "-Dspotbugs.excludeFilterFile=excludeFilter.xml", "-Dspotbugs.maxAllowedViolations=123"},
}

Expand All @@ -118,7 +118,7 @@ func TestGetSpotBugsMavenParameters(t *testing.T) {
t.Run("should return maven goal only", func(t *testing.T) {
config := mavenExecuteStaticCodeChecksOptions{}
expected := maven.ExecuteOptions{
Goals: []string{"com.github.spotbugs:spotbugs-maven-plugin:3.1.12:check"}}
Goals: []string{"com.github.spotbugs:spotbugs-maven-plugin:4.0.4:check"}}

assert.Equal(t, &expected, getSpotBugsMavenParameters(&config))
})
Expand Down

0 comments on commit 60796cd

Please sign in to comment.