Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
91 lines (79 sloc) 4.54 KB
Here is how to build the FindBugs Eclipse Plugin:
Install Java 7+
===============
Make sure you are using Java 7 or greater (since version 3.0 FindBugs requires Java 7).
Install Eclipse
================
1) Download and install Eclipse 3.6.+ (minimum supported version).
2) Download and install EGit plugin for Git.
Chose [Help | Software Updates... | Available Software | Add Site...] and use
http://download.eclipse.org/egit/updates as update site url. Select both checkboxes
[Eclipse Git Team Provider] and [JGit]
3) Uncheck "Task focused interface" child element of "Eclipse Git Team Provider".
Uncheck "Contact all update sites..." at the bottom and click [Install..., Next..., OK].
4) Restart Eclipse.
Import the projects
====================
5) Choose [File | Import | Git | Projects from Git | Next]. The Git project import wizard opens.
6) In the wizard, proceed as follows:
a) Choose [Clone URI]. Click [Next]
b) Enter https://github.com/findbugsproject/findbugs.git as uri. Click [Next]
c) Select "master" branch (for latest code).
d) Select local destination directory (default is /home/%username%/git/findbugs). Click [Next]
Source code will be now checked out from Git, so about 150 MB will be transferred from remote.
e) OK to "Import existing projects". Click [Next]
f) Select only the projects below (the rest can be imported later if needed):
+- findbugs
+- findbugsEclipsePlugin
+- findbugsEclipsePlugin-test
+- findbugsTestCases
Click [Finish].
g) Now "findbugs" project will be compiled by Eclipse and should not have any errors,
the rest will have classpath errors due missing libraries/wrong target platform.
Setup target platform/findbugs libraries
========================================
7) Create /home/user/bin/Eclipse36 directory. Create "plugins" link there pointing to the
"plugins" directory located in the root of Eclipse 3.6 installation. The Eclipse 3.6.2 can be fetched from
the official http://archive.eclipse.org/eclipse/downloads/drops/R-3.6.2-201102101200/ page.
8) Set the right target platform in Eclipse. Go to
[Window | Preferences | Plugin Development | Target Platform]
and select the "Eclipse 3.6" target platform definition from the list.
Currently Eclipse 3.6 is still supported, even if Eclipse 4.3 is already released!
Additional target platforms can be setup in the similar way.
Under Windows, replace "/home/user/" path to something like C:\Documents\%user%.
9) We need command line now:
cd /home/%username%/git/findbugs/findbugs
ant
cd ../eclipsePlugin
echo eclipsePlugin.dir=/home/user/bin/Eclipse36 > local.properties
ant
10) In Eclipse, refresh all projects (hit F5 in Explorer view) => now all errors should disappear.
Change the code
================
11) You can immediately work with the source code. In Eclipse, make sure that
[Project | Build Automatically] is enabled (this is default). In this case, after the
first checkout both projects will be compiled. There must be NO compile errors.
Debug Eclipse from Eclipse
===========================
12) Choose [Run | Debug Configurations... | Eclipse Application | FindBugs],
Choose [Debug] button to start plugin debugging. You do not need to build anything, if
[Project | Build Automatically] is enabled. You can change the code during debugging
(hot code replace is supported).
Test Eclipse from Eclipse
==========================
13) Choose [Run | Run Configurations... | JUnit Plugin Test | All FindBugs Plugin Tests | Run],
and all available FindBugs Eclipse plugin tests will be executed. The
checked in version of tests should not fail with the checked in FindBugs plugin code.
Build executable plug-in
=========================
14) Open [Package Explorer] view, expand the project [findBugsEclipsePlugin].
15) Right-click the build.xml file and choose [Run As | Ant Build] from the context menu.
16) You can now watch ANT working in the console view. After a few
seconds, the console view should print "BUILD SUCCESSFUL".
17) Right click on [findBugsEclipsePlugin] to refresh the Eclipse workspace
a) In the [findBugsEclipsePlugin]/bin_build folder you will find the file
edu.umd.cs.findbugs.plugin.eclipse_<version>.<date>.zip which contains zipped plugin.
b) In the [findBugsEclipsePlugin]/dist folder you will find the contents of the
FindBugs Eclipse plugin directory as it should be installed in Eclipse.
18) For information on how to install the compiled plug-ins into Eclipse, please refer
to the document "installing_findbugsplugin.txt".
You can’t perform that action at this time.