Findbugs and Source Code Lookup in Eclipse

11:29 AM 0 Comments

One of the first roadblocks that I ran into with Findbugs was how to see the Findbugs source code in Eclipse.

This is actually pretty simple, but I hadn't taken the time to do it, yet.

First, download the Findbugs source code:


wget http://sourceforge.net/projects/findbugs/files/findbugs/1.3.9/findbugs-1.3.9-source.zip/download


Second, unzip.

Third, go to the src/java directory, and jar up the sources:


cd findbugs-1.3.9/src/java
jar cvf findbugs-1.3.9-sources.jar .


Fourth (if you are using Maven), copy into .m2/repository/findbugs/findbugs/1.3.9.

Now, when you try to open one of the classes in Eclipse, it will ask you to attach the source code, which you can by referring to the location of that jar. Wohoo!

Josh Cummings

"I love to teach, as a painter loves to paint, as a singer loves to sing, as a musician loves to play" - William Lyon Phelps

0 comments: