Skip to content

Commit b779e8e

Browse files
committed
Add custom Eclipse code formatter
Update Eclipse settings to make use of a custom Spring formatter implementation. Using a custom formatter allows us to fix a couple of issues with the version that shipped with Eclipse Mars.1 (Eclipse bugs The custom formatter also means that it is possible to use Groovy Eclipse despite the fact that it has formatter regressions (see groovy/groovy-eclipse#142). Fixes gh-4136
1 parent 04c2bd9 commit b779e8e

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

CONTRIBUTING.adoc

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -129,17 +129,19 @@ eclipse. If you don't already have m2eclipse installed it is available from the
129129
marketplace".
130130

131131
Spring Boot includes project specific source formatting settings, in order to have these
132-
work with m2eclipse, we provide an additional eclipse plugin that you can install:
133-
134-
* Download `org.eclipse.m2e.maveneclipse.site.zip` from
135-
https://github.com/philwebb/m2eclipse-maveneclipse/releases.
136-
* Select `Install new software` from the `help` menu
137-
* Click `Add...` to add a new repository
138-
* Click the `Archive...` button
139-
* Select the `org.eclipse.m2e.maveneclipse.site.zip` that you previously downloaded
132+
work with m2eclipse, we provide additional Eclipse plugins that you can install:
133+
134+
===== Install the m2eclipse-maveneclipse plugin
135+
* Select "`Help`" -> "`Install New Software`".
136+
* Add `https://dl.bintray.com/philwebb/m2eclipse-maveneclipse` as a site.
140137
* Install "Maven Integration for the maven-eclipse-plugin"
141138

142-
NOTE: This plugin is optional. Projects can be imported without the plugin, your code
139+
===== Install the Spring Formatter plugin
140+
* Select "`Help`" -> "`Install New Software`".
141+
* Add `https://dl.bintray.com/philwebb/spring-eclipse-code-formatter/` as a site.
142+
* Install "Spring Code Formatter"
143+
144+
NOTE: These plugins are optional. Projects can be imported without the plugins, your code
143145
changes just won't be automatically formatted.
144146

145147
With the requisite eclipse plugins installed you can select

eclipse/org.eclipse.jdt.core.prefs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,3 +388,4 @@ org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
388388
org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
389389
org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
390390
org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
391+
org.eclipse.jdt.core.javaFormatter=org.springframework.ide.eclipse.jdt.formatter.javaformatter

0 commit comments

Comments
 (0)