Skip to content

Commit

Permalink
Define a standard SpotBugs exclude filter file (#337)
Browse files Browse the repository at this point in the history
  • Loading branch information
basil authored Nov 3, 2022
1 parent 394c4e5 commit d22dded
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,11 @@
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<configuration>
<!--
Do not define "excludeFilterFile" here, as it will force consumers to provide a file.
Instead, we configure this below in a profile conditionally activated based on the
presence of this file.
-->
<xmlOutput>true</xmlOutput>
<spotbugsXmlOutput>false</spotbugsXmlOutput>
<plugins>
Expand Down Expand Up @@ -818,6 +823,30 @@
</plugins>
</build>
</profile>
<profile>
<id>spotbugs-exclusion-file</id>
<activation>
<file>
<exists>${maven.multiModuleProjectDirectory}/src/spotbugs/excludesFilter.xml</exists>
</file>
</activation>
<build>
<plugins>
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<executions>
<execution>
<id>spotbugs</id>
<configuration>
<excludeFilterFile>${maven.multiModuleProjectDirectory}/src/spotbugs/excludesFilter.xml</excludeFilterFile>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>all-tests</id>
<activation>
Expand Down

0 comments on commit d22dded

Please sign in to comment.