Skip to content

Commit 7a900a5

Browse files
authored
Support a SpotBugs exclude filter file for Maven multi-module projects (#631)
1 parent efa3aff commit 7a900a5

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

pom.xml

+7-4
Original file line numberDiff line numberDiff line change
@@ -692,8 +692,11 @@
692692
</goals>
693693
<phase>verify</phase>
694694
<configuration>
695-
<!-- Do not define excludeFilterFile here as it will force a plugin to provide a file -->
696-
<!-- Instead we configure this in a profile -->
695+
<!--
696+
Do not define "excludeFilterFile" here, as it will force consumers to provide a file.
697+
Instead, we configure this below in a profile conditionally activated based on the
698+
presence of this file.
699+
-->
697700
<xmlOutput>true</xmlOutput>
698701
<spotbugsXmlOutput>false</spotbugsXmlOutput>
699702
</configuration>
@@ -1139,7 +1142,7 @@
11391142
<id>spotbugs-exclusion-file</id>
11401143
<activation>
11411144
<file>
1142-
<exists>${basedir}/src/spotbugs/excludesFilter.xml</exists>
1145+
<exists>${maven.multiModuleProjectDirectory}/src/spotbugs/excludesFilter.xml</exists>
11431146
</file>
11441147
</activation>
11451148
<build>
@@ -1151,7 +1154,7 @@
11511154
<execution>
11521155
<id>spotbugs</id>
11531156
<configuration>
1154-
<excludeFilterFile>${project.basedir}/src/spotbugs/excludesFilter.xml</excludeFilterFile>
1157+
<excludeFilterFile>${maven.multiModuleProjectDirectory}/src/spotbugs/excludesFilter.xml</excludeFilterFile>
11551158
</configuration>
11561159
</execution>
11571160
</executions>

0 commit comments

Comments
 (0)