Skip to content

Commit

Permalink
Make sarifOutputDirectory and sarifOutputFilename configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
jwgmeligmeyling committed Nov 3, 2022
1 parent f01a7f6 commit c89881e
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/main/groovy/org/codehaus/mojo/spotbugs/SpotBugsMojo.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,23 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait {
@Parameter(defaultValue = "false", property = "spotbugs.sarifFullPath", required = true)
boolean sarifFullPath

/**
* Specifies the directory where the sarif output will be generated.
*
* @since 4.7.2.2
*/
@Parameter(defaultValue = '${project.build.directory}', property = "spotbugs.sarifOutputDirectory", required = true)
File sarifOutputDirectory


/**
* Set the name of the output SARIF file produced
*
* @since 4.7.2.2
*/
@Parameter(property = "spotbugs.sarifOutputFilename", defaultValue = "spotbugsSarif.json", required = true)
String sarifOutputFilename

/**
* Specifies the directory where the xml output will be generated.
*
Expand Down Expand Up @@ -1122,7 +1139,7 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait {

File xmlTempFile = new File("${project.build.directory}/spotbugsTemp.xml")
File sarifTempFile = new File("${project.build.directory}/spotbugsTempSarif.json")
File sarifFinalFile = new File("${project.build.directory}/spotbugsSarif.json")
File sarifFinalFile = new File(sarifOutputDirectory, sarifOutputFilename)

if (xmlOutput || !sarifOutput) {
forceFileCreation(xmlTempFile)
Expand Down

0 comments on commit c89881e

Please sign in to comment.