blob: 7a63ba9a62b4aec69b34d8c22b03ce06da6f4ae2 [file] [log] [blame]
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08001Gerrit2 - Eclipse Setup
2=======================
3
4This document is about installing Gerrit into an Eclipse workspace
5for development and debugging, especially with the GWT hosted
6mode debugger.
7
8You will need to have the GWT (Google Web Toolkit) SDK installed on
9your system. A Java 5 or later SDK is also required to run GWT's
10compiler and runtime.
11
12GWT requires the Sun JDK (or OpenJDK). The GWT "hosted mode"
13environment (Eclipse debugger or "make web-shell") does not work
14under libgcj.
15
16
17User Library
18------------
19
20Create a user library called `GWT`:
21
22* Window > Preferences
23* Java > Build Path > User Libraries
24
25* New
26* Name: `GWT`
27* Add JARs...
28
29* Select `gwt-user.jar` from the $(GWT_SDK) directory.
30* Select `gwt-dev-$(OS).jar` from the $(GWT_SDK) directory.
31
32Maven Plugin
33------------
34
35Install the Maven Integration plugins:
36
37http://m2eclipse.codehaus.org/[m2eclipse]
38
39
Shawn O. Pearcee89544b2009-04-28 07:59:44 -070040Code Formatter Settings
41-----------------------
42
43Import GoogleFormat.xml using Window -> Preferences -> Java ->
44Code Style -> Formatter -> Import...
45
46This will define the 'Google Format' profile, which the project
47settings prefer when formatting source code.
48
49
Shawn O. Pearced2b73db2009-01-09 11:55:47 -080050Import Projects
51---------------
52
Shawn O. Pearce263786e2009-02-02 15:49:26 -080053Import pom.xml using General -> Maven Projects
Shawn O. Pearced2b73db2009-01-09 11:55:47 -080054
Shawn O. Pearceb951af12009-02-06 12:32:18 -080055If you also want source projects for gwtorm, gwtjsonrpc or sshd,
Shawn O. Pearce4555a3b2009-01-26 11:35:02 -080056import their top-level directories the same way. Note that you
Shawn O. Pearce263786e2009-02-02 15:49:26 -080057may need to edit the pom.xml under gerrit to ensure your snapshot
Shawn O. Pearce4555a3b2009-01-26 11:35:02 -080058builds are used.
Shawn O. Pearced2b73db2009-01-09 11:55:47 -080059
Shawn O. Pearce4555a3b2009-01-26 11:35:02 -080060[NOTE]
61If you import gwtorm, you also need to right click on `gwtorm`,
62Maven -> Update Project Configuration to force a compile of
63the generted ANTLR sources. This should fix the compile errors
64identified after import.
65
66If you also want a source project for JGit, import the top level
67jgit directory using General -> Existing Projects, selecting only
68the `org.spearce.jgit` and `org.spearce.jgit.test` projects.
Shawn O. Pearced2b73db2009-01-09 11:55:47 -080069
70
71Configure Database
72------------------
73
74You may have already done this step earlier, based on the
75instructions in link:dev-readme.html[Developer Setup].
76
Shawn O. Pearce10a52b32009-02-09 08:12:54 -080077* Open gerrit/src/main/java
Shawn O. Pearced2b73db2009-01-09 11:55:47 -080078* Copy `GerritServer.properties_example` to `GerritServer.properties`
79* Configure your database for debugging in hosted mode.
80
Shawn O. Pearced2b73db2009-01-09 11:55:47 -080081
82Launch Gerrit
83-------------
84
85Open Run->Debug Configurations...
86
87Under Java Application find `gerrit_debug` (not Mac OS X)
88or `gerrit_macos` (Mac OS X only) to start the GWT hosted
89mode browser and debug through Eclipse.