You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: CONTRIBUTING.md
+57-3
Original file line number
Diff line number
Diff line change
@@ -109,8 +109,7 @@ script on Windows in the root of the repository. The examples below show the
109
109
usage on Unix.
110
110
111
111
We support development in IntelliJ versions IntelliJ 2019.2 and
112
-
onwards. We would like to support Eclipse, but few of us use it and has fallen
113
-
into [disrepair][eclipse].
112
+
onwards and Eclipse 2020-3 and onwards.
114
113
115
114
[Docker](https://docs.docker.com/install/) is required for building some Elasticsearch artifacts and executing certain test suites. You can run Elasticsearch without building all the artifacts with:
116
115
@@ -136,6 +135,62 @@ You can import the Elasticsearch project into IntelliJ IDEA via:
136
135
- In the subsequent dialog navigate to the root `build.gradle` file
137
136
- In the subsequent dialog select **Open as Project**
138
137
138
+
### Importing the project into Eclipse
139
+
140
+
Elasticsearch builds using Gradle and Java 13. When importing into Eclipse you
141
+
will either need to use an appropriate JDK to run Eclipse itself (e.g. by
142
+
specifying the VM in [eclipse.ini](https://wiki.eclipse.org/Eclipse.ini) or by
143
+
defining the JDK Gradle uses by setting **Prefercences** > **Gradle** >
144
+
**Advanced Options** > **Java home** to an appropriate version.
145
+
146
+
IMPORTANT: If you have previously imported the project by running `./gradlew eclipse`
147
+
then you must build an entirely new workspace and `git clean -xdf` to
148
+
blow away *everything* that the gradle eclipse plugin made.
149
+
150
+
- Select **File > Import...**
151
+
- Select **Existing Gradle Project**
152
+
- Select **Next** then **Next** again
153
+
- Set the **Project root directory** to the root of your elasticsearch clone
154
+
- Click **Finish**
155
+
156
+
This will spin for a long, long time but you'll see many errors about circular
157
+
dependencies. Fix them:
158
+
159
+
- Select **Window > Preferences**
160
+
- Select **Java > Compiler > Building**
161
+
- Look under **Build Path Problems**
162
+
- Set **Circular dependencies** to **Warning**
163
+
- Apply that and let the build spin away for a while
164
+
165
+
Next you'll want to import our auto-formatter:
166
+
167
+
- Select **Window > Preferences**
168
+
- Select **Java > Code Style > Formater**
169
+
- Click **Import**
170
+
- Import the file at **buildSrc/formatterConfig.xml**
171
+
- Make sure it is the **Active profile**
172
+
173
+
Finally, set up import order:
174
+
175
+
- Select **Window > Preferences**
176
+
- Select **Java > Code Style > Organize Imports**
177
+
- Click **Import...**
178
+
- Import the file at **buildSrc/elastic.importorder**
179
+
- Set the **Number of imports needed for `.*`** to ***9999***
180
+
- Set the **Number of static imports needed for `.*`** to ***9999*** as well
181
+
- Apply that
182
+
183
+
IMPORTANT: There is an option in **Gradle** for **Automatic Project Synchronization**.
184
+
As convenient as it'd be for the projects to always be perfect this
185
+
tends to add many many seconds to every branch change. Instead, you
186
+
should manually right click on a project and
187
+
**Gradle > Refresh Gradle Project** if the configuration is out of
188
+
date.
189
+
190
+
As we add more subprojects you might have to re-import the gradle project (the
191
+
first step) again. There is no need to blow away the existing projects before
192
+
doing that.
193
+
139
194
### REST Endpoint Conventions
140
195
141
196
Elasticsearch typically uses singular nouns rather than plurals in URLs.
@@ -551,4 +606,3 @@ non-documentation contribution. This is mentioned above, but it is worth
551
606
repeating in this section because it has come up in this context.
0 commit comments