Findbugs

Findbugs

1. findbugs
eclipse plugin URL:
http://findbugs.cs.umd.edu/eclipse
http://findbugs.cs.umd.edu/eclipse-daily

error information:
Cannot complete the install because one or more required items could not be found.
  Software currently installed: Groovy-Eclipse Feature 2.1.0.20110222-1500-e35-release
(org.codehaus.groovy.eclipse.feature.feature.group 2.1.0.20110222-1500-e35-release)
  Missing requirement: JDT Core patch for Groovy-Eclipse plugin 2.1.0.20110222-1500-e35-release
(org.codehaus.groovy.jdt.patch.feature.group 2.1.0.20110222-1500-e35-release)
requires 'org.eclipse.jdt.core [3.5.2.20110222-1500-e35-release]' but it could not be found
  Cannot satisfy dependency:
    From:
Groovy-Eclipse Feature 2.1.0.20110222-1500-e35-release
(org.codehaus.groovy.eclipse.feature.feature.group 2.1.0.20110222-1500-e35-release)
    To: org.codehaus.groovy.jdt.patch.feature.group [2.1.0.20110222-1500-e35-release]

I just uninstall groovy plugin and reinstall again. Success.

Eclipse -----Windows ----> Preferences ----> FindBugs ,you can select what do you want to check.

right click the project, [FindBugs] ------ [Find Bug], add Bug Explorer to our windows


Hudson plugin
[Manage Hudson] ------> [Manage Plugins]------>[Avaiable]
select the [findbugs plugin], click [Install]

configure your findbugs plugin in your build job.
choose your job and click [Configure].
click [Post-build Actions] -----[Publish Findbugs analysis results]
FindBugs results:

error informations:
No report files were found. Configuration error?

2. I will try to using ant to call findbug task
download the latest packages from this URL:
http://findbugs.sourceforge.net/downloads.html

unzip the file to my directory
>tar zxvf findbugs-1.3.9.tar.gz
> mv findbugs-1.3.9 ../tools/

copy the jar tools to ant lib
>sudo cp findbugs-1.3.9/lib/findbugs-ant.jar /usr/share/ant/lib/

Change the configurate of the project:
[Build] ----> [Invoke Ant] ----> [Ant Version]: APACHE_ANT
[Targets] : all

I will change the build.xml, add findbugs task.
related changes in build.properties:
findbugs.home=/home/luohua/tools/findbugs-1.3.9

related changes in build.xml:
<property name="findbugs.home" value="${findbugs.home}" />
<property name="findbugs.report.dir" value="${build.dir}/report/findbugs" />

<path id="findbugs.path" > 
<fileset  dir ="${findbugs.home}"> 
<include  name ="**/*.jar"/> 
</fileset> 
</path> 

<delete dir="${findbugs.report.dir}" />
<mkdir dir="${findbugs.report.dir}" />

<!-- findbugs part start  -->
<taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" classpathref ="findbugs.path" /> 
<target name="findbugs" depends="compile">
<findbugs home="${findbugs.home}" output="xml" outputFile="${findbugs.report.dir}/findbugs.xml" reportLevel="medium" jvmargs="-Xmx512m">
<class location ="${build.dir}/WEB-INF/classes/"/>
</findbugs>
</target>
<!-- findbugs part end -->

after that, once I build in hudson, I get this error message in hudson console output:
BUILD FAILED
/var/lib/hudson/jobs/easystatemachine/workspace/build.xml:83:
/home/luohua/tools/jboss-5.1.0-clean/client not found

I really made a stupid mistake. I realize that maybe the hudson does not use a proper user account to
execute the ant command. So I just simply make all the users can access the directory.
>chmod -R 777 /some/fucking/dir

It really solve the problem. I can see the findbugs report on my screen in hudson now.

references:
http://cb.esast.com/cb/wiki/22929
http://hanqunfeng.iteye.com/?page=2
http://findbugs.sourceforge.net/downloads.html
http://hi.baidu.com/_yys/blog/item/7fa914014f05d6047bec2ce1.html

你可能感兴趣的:(eclipse,ant,jboss,ITeye,groovy)