From: Jeff J. <jef...@us...> - 2006-08-09 02:13:31
|
jeffjensen 06/08/08 19:13:29 Modified: findbugs plugin.jelly Log: Change plugin jelly from CVS binary to CVS ASCII. Revision Changes Path 1.17 +194 -194 maven-plugins/findbugs/plugin.jelly Index: plugin.jelly =================================================================== RCS file: /cvsroot/maven-plugins/maven-plugins/findbugs/plugin.jelly,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- plugin.jelly 9 Aug 2006 02:12:32 -0000 1.16 +++ plugin.jelly 9 Aug 2006 02:13:29 -0000 1.17 @@ -1,194 +1,194 @@ -<?xml version="1.0"?> - -<!-- - ============================================================================= - FindBugs Plugin. Generate FindBugs reports using the FindBugs framework. - ============================================================================= ---> -<project xmlns:j="jelly:core" xmlns:doc="doc" xmlns:ant="jelly:ant" xmlns:maven="jelly:maven" > - - <!-- - ======================================================================== - Register a FindBugs report. - ======================================================================== - --> - <goal name="maven-findbugs-plugin:register"> - <j:if test="${sourcesPresent}"> - <doc:registerReport - name="FindBugs Report" - pluginName="maven-findbugs-plugin" - description="Verification of coding rules." - link="findbugs-report"/> - </j:if> - </goal> - - <!-- - ======================================================================== - Deregister a FindBugs report. - ======================================================================== - --> - <goal name="maven-findbugs-plugin:deregister"> - <j:if test="${sourcesPresent}"> - <doc:deregisterReport name="FindBugs Report"/> - </j:if> - </goal> - - <!-- - ======================================================================== - Main FindBugs plugin goal. - ======================================================================== - --> - <goal name="findbugs" description="Static Code Analyzer"> - - <!-- Only run FindBugs if it is enabled --> - <j:set var="enable" value="${maven.findbugs.enable}"/> - - <j:if test="${enable == 'true'}"> - <attainGoal name="maven-findbugs-plugin:report"/> - </j:if> - - </goal> - - <!-- - ======================================================================== - Generate the FindBugs report. - ======================================================================== - --> - <goal name="maven-findbugs-plugin:report" prereqs="java:compile" - description="Generate source code report with FindBugs"> - - <!-- Create the dirs if we start from a previously cleaned project --> - <mkdir dir="${maven.build.dir}"/> - <mkdir dir="${maven.docs.dest}"/> - - <!-- Define a FindBugs task with the rulesets and all jars in the - classpath --> - <path id="findbugs.classpath"> - <pathelement location="${plugin.getDependencyPath('findbugs:bcel')}"/> - <pathelement location="${plugin.getDependencyPath('findbugs:coreplugin')}"/> - <pathelement location="${plugin.getDependencyPath('findbugs:findbugs')}"/> - <pathelement location="${plugin.getDependencyPath('findbugs:findbugs-ant')}"/> - <pathelement location="${plugin.getDependencyPath('dom4j:dom4j')}" /> - </path> - - <path id="findbugs.pluginlist"> - <pathelement location="${plugin.getDependencyPath('findbugs:coreplugin')}"/> - <j:if test="${context.getVariable('maven.findbugs.plugins') != null}"> - <pathelement path="${maven.findbugs.plugins}"/> - </j:if> - </path> - - <ant:taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask"> - <classpath refid="findbugs.classpath"/> - </ant:taskdef> - - <!-- Run the FindBugs task - need a way to define the rulesets dynamically --> - <echo>Running the FindBugs task...</echo> - - - <findbugs classpathref="findbugs.classpath" - pluginlistref="findbugs.pluginlist" - reportLevel="${maven.findbugs.detail}" - conserveSpace="${maven.findbugs.conserveSpace}" - debug="${maven.findbugs.debug}" - workHard="${maven.findbugs.workHard}" - output="xdocs" - outputFile="${maven.build.dir}/findbugs-raw-report.xml" - failOnError="${maven.findbugs.failOnError}" - quietErrors="${maven.findbugs.quietErrors}"> - - <j:if test="${context.getVariable('maven.findbugs.jvmargs') != null}"> - <ant:setProperty name="jvmargs" value="${maven.findbugs.jvmargs}" /> - </j:if> - - <j:if test="${context.getVariable('maven.findbugs.excludeFilter') != null}"> - <ant:setProperty name="excludeFilter" value="${maven.findbugs.excludeFilter}" /> - </j:if> - - <j:if test="${context.getVariable('maven.findbugs.includeFilter') != null}"> - <ant:setProperty name="includeFilter" value="${maven.findbugs.includeFilter}" /> - </j:if> - - <j:if test="${context.getVariable('maven.findbugs.timeout') != null}"> - <ant:setProperty name="timeout" value="${maven.findbugs.timeout}" /> - </j:if> - - <j:if test="${context.getVariable('maven.findbugs.visitors') != null}"> - <ant:setProperty name="visitors" value="${maven.findbugs.visitors}" /> - </j:if> - - <j:if test="${context.getVariable('maven.findbugs.omitVisitors') != null}"> - <ant:setProperty name="omitVisitors" value="${maven.findbugs.omitVisitors}" /> - </j:if> - - <j:forEach var="artifact" items="${pom.artifacts}"> - <j:set var="dep" value="${artifact.dependency}"/> - <j:if test="${dep.type =='jar'}"> - <auxClasspath path="${artifact.path}"/> - </j:if> - </j:forEach> - <j:forEach var="lib" items="${pom.artifacts}"> - <j:if test="${lib.dependency.type =='jar'}"> - <auxClasspath path="${lib.path}"/> - </j:if> - </j:forEach> - <sourcePath path="${basedir}/src/java" /> - <j:if test="${sourcesPresent}"> - <j:set var="srcDir" value="${pom.build.sourceDirectory}"/> - <j:if test="${ srcDir.startsWith( basedir ) }"> - - <j:set var="srcDir" value="${srcDir.substring(basedir.length())}"/> - <!-- - cut off also slash or backslash from basedir. - Is there a way to make it in one step in Jelly? - --> - <j:set var="srcDir" value="${srcDir.substring(1)}"/> - </j:if> - <sourcePath path="${srcDir}"/> - </j:if> - <!--class location="${maven.build.dir}/${maven.final.name}.jar" /--> - <class location="${maven.build.dest}" /> - </findbugs> - - <!-- 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> - - <!-- - ======================================================================== - Register the FindBugs report to the "site" plugin. - ======================================================================== - --> - <goal name="maven-findbugs-plugin:register"> - <j:if test="${sourcesPresent == 'true'}"> - <doc:registerReport - name="FindBugs" - pluginName="maven-findbugs-plugin" - link="findbugs" - description="Report on bug patterns found in compiled code."/> - </j:if> - </goal> - - <!-- - ======================================================================== - Deregister the FindBugs report from the "site" plugin. - ======================================================================== - --> - <goal name="maven-findbugs-plugin:deregister"> - <j:if test="${sourcesPresent == 'true'}"> - <doc:deregisterReport name="FindBugs"/> - </j:if> - </goal> - - -</project> +<?xml version="1.0"?> + +<!-- + ============================================================================= + FindBugs Plugin. Generate FindBugs reports using the FindBugs framework. + ============================================================================= +--> +<project xmlns:j="jelly:core" xmlns:doc="doc" xmlns:ant="jelly:ant" xmlns:maven="jelly:maven" > + + <!-- + ======================================================================== + Register a FindBugs report. + ======================================================================== + --> + <goal name="maven-findbugs-plugin:register"> + <j:if test="${sourcesPresent}"> + <doc:registerReport + name="FindBugs Report" + pluginName="maven-findbugs-plugin" + description="Verification of coding rules." + link="findbugs-report"/> + </j:if> + </goal> + + <!-- + ======================================================================== + Deregister a FindBugs report. + ======================================================================== + --> + <goal name="maven-findbugs-plugin:deregister"> + <j:if test="${sourcesPresent}"> + <doc:deregisterReport name="FindBugs Report"/> + </j:if> + </goal> + + <!-- + ======================================================================== + Main FindBugs plugin goal. + ======================================================================== + --> + <goal name="findbugs" description="Static Code Analyzer"> + + <!-- Only run FindBugs if it is enabled --> + <j:set var="enable" value="${maven.findbugs.enable}"/> + + <j:if test="${enable == 'true'}"> + <attainGoal name="maven-findbugs-plugin:report"/> + </j:if> + + </goal> + + <!-- + ======================================================================== + Generate the FindBugs report. + ======================================================================== + --> + <goal name="maven-findbugs-plugin:report" prereqs="java:compile" + description="Generate source code report with FindBugs"> + + <!-- Create the dirs if we start from a previously cleaned project --> + <mkdir dir="${maven.build.dir}"/> + <mkdir dir="${maven.docs.dest}"/> + + <!-- Define a FindBugs task with the rulesets and all jars in the + classpath --> + <path id="findbugs.classpath"> + <pathelement location="${plugin.getDependencyPath('findbugs:bcel')}"/> + <pathelement location="${plugin.getDependencyPath('findbugs:coreplugin')}"/> + <pathelement location="${plugin.getDependencyPath('findbugs:findbugs')}"/> + <pathelement location="${plugin.getDependencyPath('findbugs:findbugs-ant')}"/> + <pathelement location="${plugin.getDependencyPath('dom4j:dom4j')}" /> + </path> + + <path id="findbugs.pluginlist"> + <pathelement location="${plugin.getDependencyPath('findbugs:coreplugin')}"/> + <j:if test="${context.getVariable('maven.findbugs.plugins') != null}"> + <pathelement path="${maven.findbugs.plugins}"/> + </j:if> + </path> + + <ant:taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask"> + <classpath refid="findbugs.classpath"/> + </ant:taskdef> + + <!-- Run the FindBugs task - need a way to define the rulesets dynamically --> + <echo>Running the FindBugs task...</echo> + + + <findbugs classpathref="findbugs.classpath" + pluginlistref="findbugs.pluginlist" + reportLevel="${maven.findbugs.detail}" + conserveSpace="${maven.findbugs.conserveSpace}" + debug="${maven.findbugs.debug}" + workHard="${maven.findbugs.workHard}" + output="xdocs" + outputFile="${maven.build.dir}/findbugs-raw-report.xml" + failOnError="${maven.findbugs.failOnError}" + quietErrors="${maven.findbugs.quietErrors}"> + + <j:if test="${context.getVariable('maven.findbugs.jvmargs') != null}"> + <ant:setProperty name="jvmargs" value="${maven.findbugs.jvmargs}" /> + </j:if> + + <j:if test="${context.getVariable('maven.findbugs.excludeFilter') != null}"> + <ant:setProperty name="excludeFilter" value="${maven.findbugs.excludeFilter}" /> + </j:if> + + <j:if test="${context.getVariable('maven.findbugs.includeFilter') != null}"> + <ant:setProperty name="includeFilter" value="${maven.findbugs.includeFilter}" /> + </j:if> + + <j:if test="${context.getVariable('maven.findbugs.timeout') != null}"> + <ant:setProperty name="timeout" value="${maven.findbugs.timeout}" /> + </j:if> + + <j:if test="${context.getVariable('maven.findbugs.visitors') != null}"> + <ant:setProperty name="visitors" value="${maven.findbugs.visitors}" /> + </j:if> + + <j:if test="${context.getVariable('maven.findbugs.omitVisitors') != null}"> + <ant:setProperty name="omitVisitors" value="${maven.findbugs.omitVisitors}" /> + </j:if> + + <j:forEach var="artifact" items="${pom.artifacts}"> + <j:set var="dep" value="${artifact.dependency}"/> + <j:if test="${dep.type =='jar'}"> + <auxClasspath path="${artifact.path}"/> + </j:if> + </j:forEach> + <j:forEach var="lib" items="${pom.artifacts}"> + <j:if test="${lib.dependency.type =='jar'}"> + <auxClasspath path="${lib.path}"/> + </j:if> + </j:forEach> + <sourcePath path="${basedir}/src/java" /> + <j:if test="${sourcesPresent}"> + <j:set var="srcDir" value="${pom.build.sourceDirectory}"/> + <j:if test="${ srcDir.startsWith( basedir ) }"> + + <j:set var="srcDir" value="${srcDir.substring(basedir.length())}"/> + <!-- + cut off also slash or backslash from basedir. + Is there a way to make it in one step in Jelly? + --> + <j:set var="srcDir" value="${srcDir.substring(1)}"/> + </j:if> + <sourcePath path="${srcDir}"/> + </j:if> + <!--class location="${maven.build.dir}/${maven.final.name}.jar" /--> + <class location="${maven.build.dest}" /> + </findbugs> + + <!-- 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> + + <!-- + ======================================================================== + Register the FindBugs report to the "site" plugin. + ======================================================================== + --> + <goal name="maven-findbugs-plugin:register"> + <j:if test="${sourcesPresent == 'true'}"> + <doc:registerReport + name="FindBugs" + pluginName="maven-findbugs-plugin" + link="findbugs" + description="Report on bug patterns found in compiled code."/> + </j:if> + </goal> + + <!-- + ======================================================================== + Deregister the FindBugs report from the "site" plugin. + ======================================================================== + --> + <goal name="maven-findbugs-plugin:deregister"> + <j:if test="${sourcesPresent == 'true'}"> + <doc:deregisterReport name="FindBugs"/> + </j:if> + </goal> + + +</project> |