2017-05-16 19 views
1

JenkinsからfindBugsを実行して、特定のファイルにレポートを生成する必要があります。私はこれを行うための詳細な手順を探しています。JenkinsでfindBugsレポートを生成する

私はジェンキンスにプラグインを追加し、FindBugsのを実行し、レポートを生成する方法のpom.xmlに以下

enter code here 

<plugin> 
      <groupId>org.codehaus.mojo</groupId> 
      <artifactId>findbugs-maven-plugin</artifactId> 
      <version>2.4.0</version> 
      <executions> 
       <execution> 
        <id>findbug</id> 
        <phase>verify</phase> 
        <goals> 
         <goal>check</goal> 
        </goals> 
       </execution> 
      </executions> 
      <configuration> 
       <effort>Max</effort> 
       <threshold>Low</threshold> 
       <findbugsXmlOutputDirectory> 
        ${project.build.directory}/findbugs 
       </findbugsXmlOutputDirectory> 
       <failOnError>false</failOnError> 
      </configuration> 
     </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> 
         <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>install</phase> 
        <goals> 
         <goal>findbugs</goal> 
         <goal>check</goal> 
        </goals> 
        <configuration> 
         <effort>Max</effort> 
         <threshold>Low</threshold> 
         <failOnError>true</failOnError> 
        </configuration> 
       </execution> 
      </executions> 
     </plugin> 

を持っていますか?

答えて

0

あなたはFindBugsの-のmaven-pluginの設定セクションでこれを必要とする:

  <findbugsXmlOutput>true</findbugsXmlOutput> 
      <findbugsXmlWithMessages>true</findbugsXmlWithMessages> 
      <xmlOutput>true</xmlOutput> 

また、あなたはMavenのゴールFindBugsの実行する必要があります:FindBugsのを。詳しくは、プラグインの説明ページの「使い方」のセクションをご覧ください。https://wiki.jenkins-ci.org/display/JENKINS/FindBugs+Plugin

+0

Jenkinsで視覚的なレポートを生成する方法はありますか? – OnePlus

関連する問題