У меня есть findbugs (и checkstyle), настроенные в моем проекте pom.xml:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>2.3</version>
<configuration>
<xmlOutput>true</xmlOutput>
<threshold>Normal</threshold>
<effort>Max</effort>
<debug>false</debug>
<excludeFilterFile>${basedir}/src/test/config/findbugs-exclude.xml</excludeFilterFile>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.4</version>
<configuration>
<suppressionsLocation>${basedir}/src/test/config/checkstyle-surpressions.xml</suppressionsLocation>
<testFailureIgnore>false</testFailureIgnore>
</configuration>
</plugin>
<!--.......-->
</plugins>
И это работает как шарм. 'mvn site' создает отчет finbugs, который правильно использует указанный excludeFileterFile.
Проблема в том, когда я пытаюсь использовать плагин сонара. ('mvn sonar: sonar')
Сонар не используйте фильтр исключения, указанный выше. (Но он будет правильно использовать файл подавления контрольного стиля).
Информация с консоли при запуске mvn sonar: sonar:
ВНИМАНИЕ: Файл настроек альтернативного пользователя: C: \ Users \ rgi.m2 \ settings.xml недопустим. Используя путь по умолчанию.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
....
[INFO] [findbugs:findbugs {execution: default-cli}]
[INFO] Using source root:
[INFO] <...edit...>\target\classes
[INFO] Using test source root:
[INFO] <...edit...>\target\test-classes
[INFO] Using maximum effort.
[INFO] Adding Source Directory: <...edit...>\src\main\java
[INFO] Using low threshold.
[INFO] Using FindBugs Version: 1.3.8
[INFO] Using low threshold.
[INFO] Using low threshold.
[INFO] Using the xdoc format
[INFO] Using maximum effort.
[INFO] Using low threshold.
[INFO] Using low threshold.
[INFO] Debugging is Off
[INFO] Using bug include filter <...edit...>\target\sonar\findbugs-include.xml
[INFO] Using bug exclude filter <...edit...>\target\sonar\findbugs-exclude.xml
[INFO] Printing Errors
.....
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
И сонар-pom.xml в каталоге target / sonar:
<plugin>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.2</version>
<dependencies>
<dependency>
<groupId>org.codehaus.sonar.runtime.rules-extensions</groupId>
<artifactId>parent</artifactId>
<version>20100210071723</version>
<type>pom</type>
</dependency>
</dependencies>
<configuration>
<suppressionsLocation>{...edit...}/src/test/config/checkstyle-surpressions.xml</suppressionsLocation>
<testFailureIgnore>false</testFailureIgnore>
<outputFileFormat>xml</outputFileFormat>
<consoleOutput>false</consoleOutput>
<enableRSS>false</enableRSS>
<skip>false</skip>
<failsOnError>false</failsOnError>
<configLocation>{...edit...}\target\sonar\checkstyle.xml</configLocation>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>2.0.1</version>
<configuration>
<xmlOutput>true</xmlOutput>
<threshold>Low</threshold>
<effort>Max</effort>
<debug>false</debug>
<excludeFilterFile>{...edit...}\target\sonar\findbugs-exclude.xml</excludeFilterFile>
<classFilesDirectory>{...edit...}\target\classes</classFilesDirectory>
<skip>false</skip>
<includeFilterFile>{...edit...}\target\sonar\findbugs-include.xml</includeFilterFile>
</configuration>
</plugin>
Обратите внимание, что checkstyle в sonar-pom.xml ссылается на файл в конфигурации проекта, но findbugs exclude file представляет собой пустой файл из сонара.
Кто-нибудь знает, как заставить гидролокатор использовать файл исключения finbugs, определенный в проекте pom.xml?
Спасибо заранее
/ Roy