2016-11-28 14 views
0

私の目標は、mavenプロジェクトでfindbugsを実行することです - > xmlを生成 - > xmlをhtmlに変換&最終的に、優先度の高いFindBugsの警告があればビルドに失敗します。以下は私の問題は、HTML変換がmaven pom.xmlのFindbugsプラグインの設定

[WARNING] No files found for transformation by stylesheet fancy-hist.xsl 

するのpom.xmlの正しさが&も誰かすることができますを確認することができますことを知らせる起きていないということです私は

<plugin> 
       <groupId>org.codehaus.mojo</groupId> 
       <artifactId>findbugs-maven-plugin</artifactId> 
       <version>3.0.3</version> 
       <executions> 
        <execution> 
         <id>noFailOnError</id> 
         <phase>verify</phase> 
         <goals> 
          <goal>check</goal> 
         </goals> 
         <configuration> 
          <failOnError>false</failOnError> 
          <xmlOutput>true</xmlOutput> 
          <findbugsXmlOutputDirectory>${project.build.directory}/findbugs</findbugsXmlOutputDirectory> 
         </configuration> 
        </execution> 
       </executions> 
      </plugin> 

      <plugin> 
       <groupId>org.codehaus.mojo</groupId> 
       <artifactId>xml-maven-plugin</artifactId> 
       <version>1.0</version> 
       <executions> 
        <execution> 
         <phase>verify</phase> 
         <goals> 
          <goal>transform</goal> 
         </goals> 
        </execution> 
       </executions> 
       <configuration> 
        <transformationSets> 
         <transformationSet> 
          <dir>${project.build.directory}/findbugs</dir> 
          <outputDir>${project.build.directory}/findbugs</outputDir> 
          <stylesheet>fancy-hist.xsl</stylesheet> 
          <!--<stylesheet>default.xsl</stylesheet> --> 
          <!--<stylesheet>plain.xsl</stylesheet> --> 
          <!--<stylesheet>fancy.xsl</stylesheet> --> 
          <!--<stylesheet>summary.xsl</stylesheet> --> 
          <fileMappers> 
           <fileMapper 
            implementation="org.codehaus.plexus.components.io.filemappers.FileExtensionMapper"> 
            <targetExtension>.html</targetExtension> 
           </fileMapper> 
          </fileMappers> 
         </transformationSet> 
        </transformationSets> 
       </configuration> 
       <dependencies> 
        <dependency> 
         <groupId>com.google.code.findbugs</groupId> 
         <artifactId>findbugs</artifactId> 
         <version>2.0.0</version> 
        </dependency> 
       </dependencies> 
      </plugin> 


      <plugin> 
       <groupId>org.codehaus.mojo</groupId> 
       <artifactId>findbugs-maven-plugin</artifactId> 
       <version>3.0.3</version> 
       <executions> 
        <execution> 
         <id>failing-on-high</id> 
         <phase>verify</phase> 
         <goals> 
          <goal>findbugs</goal> 
         </goals> 
         <configuration> 
          <failOnError>true</failOnError> 
         </configuration> 
        </execution> 
       </executions> 
      </plugin> 

を設定しているのpom.xmlでのプラグイン構成設定ですhtmlのtansformationが起こっていない理由について私に助けてください?

答えて

0

上記のプラグイン設定の問題は、フェーズオンではなく、フェーズフェーズで構成されていることです。したがって、検証フェーズでビルドエラーが発生した場合、出力xmlは生成されないため、出力xmlは生成されませんでした。これをインストールするように変更して修正しました

<plugin> 
       <groupId>org.codehaus.mojo</groupId> 
       <artifactId>findbugs-maven-plugin</artifactId> 
       <version>3.0.3</version> 
       <executions> 
        <execution> 
         <id>failing-on-high</id> 
         <phase>install</phase> 
         <goals> 
          <goal>findbugs</goal> 
         </goals> 
         <configuration> 
          <failOnError>true</failOnError> 
         </configuration> 
        </execution> 
       </executions> 
      </plugin> 
関連する問題