3

私はいくつかのことに頭を悩ませようとしています。

私の中にこれがある場合masterpom

<reporting>
 <plugins>
  <plugin>
   <groupId>org.codehaus.mojo</groupId>
   <artifactId>findbugs-maven-plugin</artifactId>
   <version>2.5.2</version>
   <configuration>
      <failOnError>false</failOnError>
      <threshold>High</threshold>
      <effort>Default</effort>
      <xmlOutput>true</xmlOutput>
      <skip>${skipFindBugs}</skip>
      <xmlOutputDirectory>target/reports/findbugs</xmlOutputDirectory>
      <excludeFilterFile>
          src/main/resources/findbugs-exclude-filters.xml
      </excludeFilterFile>
   </configuration>
  </plugin>
 </plugins>
</reporting>

findbugs-exclude-filters.xmlはこのように見えます:

<?xml version="1.0" encoding="UTF-8"?>
<FindBugsFilter>
     <Match>
        <Bug category="I18N" />
     </Match>
</FindBugsFilter>

質問

なぜclean verify site2 つの警告が報告されるのに、 clean verify findbugs:check14 のバグが返されるのですか? 違いがわかりません。

siteレポートで警告が表示されるのはなぜですかI18N:DM_DEFAULT_ENCODING

4

1 に答える 1

3

プラグインは、セクションとセクションの両方findbugs-maven-pluginで構成する必要があります。これをあらゆる種類の方法で実験しましたが、それを機能させることができた唯一の方法は、構成を複製することです。<reporting><plugins/></reporting><build><plugins/></build>findbugs-maven-plugin

したがって、pom.xml に次のようなものを追加してみてください。

<build>
 <plugins>
  <plugin>
   <groupId>org.codehaus.mojo</groupId>
   <artifactId>findbugs-maven-plugin</artifactId>
   <version>2.5.2</version>
   <configuration>
      <failOnError>false</failOnError>
      <threshold>High</threshold>
      <effort>Default</effort>
      <xmlOutput>true</xmlOutput>
      <skip>${skipFindBugs}</skip>
      <xmlOutputDirectory>target/reports/findbugs</xmlOutputDirectory>
      <excludeFilterFile>
          src/main/resources/findbugs-exclude-filters.xml
      </excludeFilterFile>
   </configuration>
  </plugin>
 </plugins>
</build>

<reporting/>ブロック内に投稿したものをカット アンド ペーストしたものであることに注意してください。私は上記をテストしていません。ここでは、一般的な考え方をお伝えしたいと思います。

POM リファレンスのレポート セクションには、次のように記載されています。

微妙な違いは、レポート要素の下のプラグイン構成がビルド プラグイン構成として機能することですが、逆は真ではありません (ビルド プラグイン構成はレポート プラグインに影響しません)。

Maven 3.0.5でこれを機能させることができました。3.1.0 ではまだ試していません。

于 2013-09-10T10:26:04.300 に答える