Reputation: 1260
I am using FindBugs in order to generate some reports for a java project. I used the following command :
./findbugs-3.0.1/bin/findbugs -textui -high -nested:false -sortByClass -html -output h.html -auxclasspath ../LabMetrics/operations/utilJars/junit.jar -auxclasspath ../LabMetrics/operations/utilJars/hamcrest-core-1.3.jar ../LabMetrics/operations/target/classes
It works fine and a html report is generated. Also, when I am using this command:
./findbugs-3.0.1/bin/findbugs -textui -high -nested:false -sortByClass -output h.txt -auxclasspath ../LabMetrics/operations/utilJars/junit.jar -auxclasspath ../LabMetrics/operations/utilJars/hamcrest-core-1.3.jar ../LabMetrics/operations/target/classes
the output will be redirected to h.txt file.
Now, I want to generate a html and a txt report running only a command. This action is time comsumming and I don t want to analyze twice the same code, only for obtaining the same report, but with different format. I searched on FindBugs site, but with no result. I really don`t want to parse html report source in order to build a txt report. There must be a way to get two reports in a single run.
Upvotes: 3
Views: 964
Reputation: 100269
It's better to create an XML first. XML contains all the necessary information and can be translated to whatever you need using some non-trivial command lines.
For example, assuming you have analysisResult.xml to produce txt report use
java -cp findbugs.jar edu.umd.cs.findbugs.PrintingBugReporter -txt analysisResult.xml >output.txt
To produce HTML report use
java -cp findbugs.jar edu.umd.cs.findbugs.PrintingBugReporter -html analysisResult.xml >output.html
Upvotes: 3