From: Eric P. <de...@us...> - 2004-07-29 18:09:57
|
dep4b 04/07/29 11:09:51 Modified: findbugs plugin.jelly findbugs/src/plugin-test maven.xml project.xml findbugs/xdocs changes.xml navigation.xml Added: findbugs/src/plugin-resources findbugs.jsl Log: Support new xdoc format and pretty "pmd" style report of results Revision Changes Path 1.6 +13 -19 maven-plugins/findbugs/plugin.jelly Index: plugin.jelly =================================================================== RCS file: /cvsroot/maven-plugins/maven-plugins/findbugs/plugin.jelly,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- plugin.jelly 29 Jul 2004 16:31:22 -0000 1.5 +++ plugin.jelly 29 Jul 2004 18:09:50 -0000 1.6 @@ -87,8 +87,8 @@ <findbugs classpathref="findbugs.classpath" pluginlistref="findbugs.pluginlist" reportLevel="${maven.findbugs.detail}" - output="xml" - outputFile="${maven.build.dir}/findbugs-raw-report.txt"> + output="xdocs" + outputFile="${maven.build.dir}/findbugs-raw-report.xml"> <j:forEach var="lib" items="${pom.artifacts}"> <auxClasspath path="${lib.path}"/> @@ -111,24 +111,18 @@ <class location="${maven.build.dest}" /> </findbugs> - - <j:set var="genDocs" value="${maven.gen.docs}" /> - <mkdir dir="${genDocs}"/> - <doc:text-xdoc - preamble=" - The following document contains the results of - FindBugs - http://findbugs.sourceforge.net/. - - This isn't formatted like a pretty CheckStyle / JDepend sheet as the FindBugs XML - output is very terse and does not describe what each error type is. We have no desire - to hardcode messages against FindBugs, so we'll wait until FindBugs XML output can be modified - to produce easy to use messages. - " - title="FindBugs Report" - section="FindBugs Results" - output="${genDocs}/findbugs-report.xml" - inputFile="${maven.build.dir}/findbugs-raw-report.txt"/> + <!-- Run JSL to transform the report into XDOC --> + + <echo>Converting the FindBugs report to xdoc ...</echo> + <doc:jsl + input="${maven.build.dir}/findbugs-raw-report.xml" + output="findbugs-report.xml" + stylesheet="${plugin.resources}/findbugs.jsl" + outputMode="xml" + prettyPrint="true" + /> + </goal> <!-- 1.3 +2 -2 maven-plugins/findbugs/src/plugin-test/maven.xml Index: maven.xml =================================================================== RCS file: /cvsroot/maven-plugins/maven-plugins/findbugs/src/plugin-test/maven.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- maven.xml 29 Jul 2004 16:31:23 -0000 1.2 +++ maven.xml 29 Jul 2004 18:09:50 -0000 1.3 @@ -16,7 +16,7 @@ </goal> <goal name="test-findbugs"> - <j:set var="expectedFile" value="${maven.build.dir}/findbugs-raw-report.txt"/> + <j:set var="expectedFile" value="${maven.build.dir}/findbugs-raw-report.xml"/> <attainGoal name="findbugs"/> <util:file var="rawReport" name="${maven.build.dir}/test-reports/TEST-net.sf.mavenplugins.findbugs.MockUnitTest.txt" /> @@ -26,7 +26,7 @@ <util:file var="rawReport" name="${expectedFile}" /> <j:if test="${!(rawReport.exists())}"> - <fail>findbugs-raw-report.txt not generated</fail> + <fail>findbugs-raw-report.xml not generated</fail> </j:if> <delete file="${expectedFile}"/> </goal> 1.3 +1 -0 maven-plugins/findbugs/src/plugin-test/project.xml Index: project.xml =================================================================== RCS file: /cvsroot/maven-plugins/maven-plugins/findbugs/src/plugin-test/project.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- project.xml 29 Jul 2004 16:31:23 -0000 1.2 +++ project.xml 29 Jul 2004 18:09:50 -0000 1.3 @@ -28,5 +28,6 @@ <reports> <report>maven-findbugs-plugin</report> <report>maven-pmd-plugin</report> + <report>maven-jxr-plugin</report> </reports> </project> 1.8 +3 -0 maven-plugins/findbugs/xdocs/changes.xml Index: changes.xml =================================================================== RCS file: /cvsroot/maven-plugins/maven-plugins/findbugs/xdocs/changes.xml,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- changes.xml 29 Jul 2004 16:31:23 -0000 1.7 +++ changes.xml 29 Jul 2004 18:09:50 -0000 1.8 @@ -8,6 +8,9 @@ <body> <release version="0.8.2" date="29-JULY-2004"> <action dev="epugh" type="add"> + Switch to maven friendly raw report format. Add new "pmd" style report. + </action> + <action dev="epugh" type="add"> add maven.findbugs.detail which can be low, medium, or high to control which errors are displayed. </action> <action dev="epugh" type="add"> 1.4 +2 -0 maven-plugins/findbugs/xdocs/navigation.xml Index: navigation.xml =================================================================== RCS file: /cvsroot/maven-plugins/maven-plugins/findbugs/xdocs/navigation.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- navigation.xml 19 Apr 2004 14:08:42 -0000 1.3 +++ navigation.xml 29 Jul 2004 18:09:50 -0000 1.4 @@ -15,8 +15,10 @@ <item name="Tasks" href="/tasks.html"/> </menu> <menu name="Downloads"> + <item name="0.8.2" href="http://maven-plugins.sourceforge.net/maven/plugins/maven-findbugs-plugin-0.8.2.jar"/> <item name="0.7.2" href="http://maven-plugins.sourceforge.net/maven/plugins/maven-findbugs-plugin-0.7.2.jar"/> <item name="0.7.1" href="http://maven-plugins.sourceforge.net/maven/plugins/maven-findbugs-plugin-0.7.1.jar"/> + </menu> </body> 1.1 maven-plugins/findbugs/src/plugin-resources/findbugs.jsl Index: findbugs.jsl =================================================================== <?xml version="1.0"?> <jsl:stylesheet select="$doc" xmlns:j="jelly:core" xmlns:jsl="jelly:jsl" xmlns:util="jelly:util" xmlns:x="jelly:xml" xmlns:doc="doc" xmlns="dummy" trim="false"> <!-- This needs to be instantiated here to be available in the template matches --> <j:useBean var="mavenTool" class="org.apache.maven.util.MavenTool"/> <j:useBean var="htmlescape" class="org.apache.velocity.anakia.Escape"/> <j:useBean var="fileutil" class="org.apache.velocity.texen.util.FileUtil"/> <j:useBean var="pathtool" class="org.apache.maven.util.DVSLPathTool"/> <jsl:template match="BugCollection"> <document> <properties> <title>FindBugs Results</title> </properties> <body> <section name="FindBugs Results"> <p> The following document contains the results of <a href="http://findbugs.sourceforge.net/">FindBugs</a>. </p> </section> <section name="Summary"> <j:set var="fileCount"><x:expr select="count(file)"/></j:set> <j:set var="errorCount"><x:expr select="count(file/BugInstance)"/></j:set> <table> <tr> <th>Files</th> <th>Errors</th> </tr> <tr> <td><doc:formatAsNumber string="${fileCount}" pattern="0"/></td> <td><doc:formatAsNumber string="${errorCount}" pattern="0"/></td> </tr> </table> </section> <section name="Files"> <table> <tr> <th>Files</th> <th>Violations</th> </tr> <x:set var="files" select="file"/> <!-- x:forEach is busted --> <j:forEach var="file" items="${files}"> <j:set var="name" value="${file.attribute('classname').getValue()}"/> <!--- +1 is for the trailing slash above --> <j:set var="errorCount"><x:expr select="count($file/BugInstance)"/></j:set> <j:if test="${errorCount != 0}"> <tr> <td> <a href="#${name}">${name}</a> </td> <td><doc:formatAsNumber string="${errorCount}" pattern="0"/></td> </tr> </j:if> </j:forEach> </table> <j:forEach var="file" items="${files}"> <x:set var="errorCount" select="count($file/BugInstance)"/> <j:if test="${errorCount != 0}"> <j:set var="name" value="${file.attribute('classname').getValue()}"/> <subsection name="${name}"> <table> <tr> <th>Violation</th> <th>Line</th> </tr> <x:set var="errors" select="$file/BugInstance"/> <j:forEach var="error" items="${errors}"> <tr> <td> <j:set var="errorMessage" value="${error.attribute('message').getValue()}"/> ${htmlescape.getText(errorMessage)} </td> <td> <j:set var="line" value="${error.attribute('line').getValue()}"/> <util:replace var="jxrName" value="${name}" oldChar="." newChar="/"/> <a href="xref/${jxrName}.html#${line}">${line}</a> </td> </tr> </j:forEach> </table> </subsection> </j:if> </j:forEach> </section> </body> </document> </jsl:template> </jsl:stylesheet> |