我有一些我想与 FindBugs Maven 插件一起使用的自定义 FindBugs 检测器的一个不错的 JAR。有一种方法可以通过<pluginList>配置参数对插件执行此操作,但只接受本地文件、URL 或资源。
我发现这样做的唯一方法是以某种方式将我的 JAR 复制到本地文件(可能通过 Dependency 插件),然后配置 FindBugs 插件,如下所示:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>2.3.1</version>
<configuration>
<pluginList>${project.build.directory}/my-detectors.jar</pluginList>
</configuration>
</plugin>
但这不是很灵活。有没有办法将 Maven 的依赖管理功能与 FindBugs 的插件一起使用?我想使用这样的东西:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<dependencies>
<dependency>
<groupId>com.lptr.findbugs</groupId>
<artifactId>my-detectors</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
</plugin>
...但这只是覆盖了coreFindBugs 检测器。