blob: 44e85b5f6c0902cbf9c8a8c8dc783f9a22e2a9c8 [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
Shawn O. Pearced15fe292009-07-21 09:52:09 -07008You will need to have the GWT (Google Web Toolkit) 1.7 SDK installed
Shawn O. Pearcefa0c7532009-05-12 17:22:08 -07009on your system. A Java 6 or later SDK is also required to run
10GWT's compiler and runtime.
Shawn O. Pearced2b73db2009-01-09 11:55:47 -080011
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
Shawn O. Pearced15fe292009-07-21 09:52:09 -070020Create a user library called `GWT_17`:
Shawn O. Pearced2b73db2009-01-09 11:55:47 -080021
22* Window > Preferences
23* Java > Build Path > User Libraries
24
25* New
Shawn O. Pearced15fe292009-07-21 09:52:09 -070026* Name: `GWT_17`
Shawn O. Pearced2b73db2009-01-09 11:55:47 -080027* 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
Shawn O. Pearce44671f52009-11-07 12:55:26 -080043Import `tools/GoogleFormat.xml` using Window -> Preferences ->
44Java -> Code Style -> Formatter -> Import...
Shawn O. Pearcee89544b2009-04-28 07:59:44 -070045
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]
Brad Larsonc2461af2009-09-09 11:47:09 -050061Some of the source code is generated with ANTLR sources. To
Shawn O. Pearce44671f52009-11-07 12:55:26 -080062build these files, you need to right click on the imported projects,
Brad Larsonc2461af2009-09-09 11:47:09 -050063Maven -> Update Project Configuration. This should fix the compile
64errors identified after import.
Shawn O. Pearce4555a3b2009-01-26 11:35:02 -080065
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. Pearce44671f52009-11-07 12:55:26 -080077* Navigate to gerrit-war/src/main/webapp/WEB-INF/extra/
78* Copy `GerritServer.properties_example` to `gerrit-parent/GerritServer.properties`
Shawn O. Pearced2b73db2009-01-09 11:55:47 -080079* Configure your database for debugging in hosted mode.
80
Shawn O. Pearce8d2f1842009-05-13 07:59:04 -070081Production Compile
82------------------
83
84*Always* use
85
86----
87 mvn clean package
88----
89
Shawn O. Pearce44671f52009-11-07 12:55:26 -080090to create a production build.
Shawn O. Pearced2b73db2009-01-09 11:55:47 -080091
92Launch Gerrit
93-------------
94
Shawn O. Pearced6078462009-11-02 10:37:01 -080095Open Run->Debug Configurations...
Shawn O. Pearced2b73db2009-01-09 11:55:47 -080096
Shawn O. Pearce44671f52009-11-07 12:55:26 -080097Under Java Application find `gwtui_any` (not Mac OS X)
98or `gwtui_mac` (Mac OS X only) to start the GWT hosted
Shawn O. Pearced2b73db2009-01-09 11:55:47 -080099mode browser and debug through Eclipse.
Shawn O. Pearce06b48c32009-05-10 16:21:05 -0700100
Shawn O. Pearce06b48c32009-05-10 16:21:05 -0700101Final Setup
102-----------
103
104Since you are creating a Gerrit instance for testing, you need to
105also follow the other steps outlined under "Initialize the Schema"
106in the Installation Guide. Note that the database has already been
107created if you launched Gerrit at least once.
108
109Note that Bouncy Castle Crypto is automatically installed in the
110classpath when debugging with hosted mode, so you will need to
111create SSH keys with `ssh-keygen`.
112
113* link:install.html[Installation Guide]
114* link:project-setup.html[Project Setup]
Shawn O. Pearce5500e692009-05-28 15:55:01 -0700115
116GERRIT
117------
118Part of link:index.html[Gerrit Code Review]