Commit b779e8e4 authored by Phillip Webb's avatar Phillip Webb

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
https://github.com/groovy/groovy-eclipse/issues/142).

Fixes gh-4136
parent 04c2bd9c
...@@ -129,17 +129,19 @@ eclipse. If you don't already have m2eclipse installed it is available from the ...@@ -129,17 +129,19 @@ eclipse. If you don't already have m2eclipse installed it is available from the
marketplace". marketplace".
Spring Boot includes project specific source formatting settings, in order to have these Spring Boot includes project specific source formatting settings, in order to have these
work with m2eclipse, we provide an additional eclipse plugin that you can install: work with m2eclipse, we provide additional Eclipse plugins that you can install:
* Download `org.eclipse.m2e.maveneclipse.site.zip` from ===== Install the m2eclipse-maveneclipse plugin
https://github.com/philwebb/m2eclipse-maveneclipse/releases. * Select "`Help`" -> "`Install New Software`".
* Select `Install new software` from the `help` menu * Add `https://dl.bintray.com/philwebb/m2eclipse-maveneclipse` as a site.
* Click `Add...` to add a new repository
* Click the `Archive...` button
* Select the `org.eclipse.m2e.maveneclipse.site.zip` that you previously downloaded
* Install "Maven Integration for the maven-eclipse-plugin" * Install "Maven Integration for the maven-eclipse-plugin"
NOTE: This plugin is optional. Projects can be imported without the plugin, your code ===== Install the Spring Formatter plugin
* Select "`Help`" -> "`Install New Software`".
* Add `https://dl.bintray.com/philwebb/spring-eclipse-code-formatter/` as a site.
* Install "Spring Code Formatter"
NOTE: These plugins are optional. Projects can be imported without the plugins, your code
changes just won't be automatically formatted. changes just won't be automatically formatted.
With the requisite eclipse plugins installed you can select With the requisite eclipse plugins installed you can select
......
...@@ -388,3 +388,4 @@ org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false ...@@ -388,3 +388,4 @@ org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
org.eclipse.jdt.core.javaFormatter=org.springframework.ide.eclipse.jdt.formatter.javaformatter
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment