From e907bf0c499af72eb1e289f16dbc3dc1fa5a5870 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Mon, 7 Jan 2019 09:55:18 +0100 Subject: [PATCH] Add setup instructions for in IntelliJ IDEA Closes gh-15634 --- CONTRIBUTING.adoc | 29 +++++++++ idea/codeStyleConfig.xml | 128 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 157 insertions(+) create mode 100644 idea/codeStyleConfig.xml diff --git a/CONTRIBUTING.adoc b/CONTRIBUTING.adoc index 7b85793b34..3f0d07dc4b 100755 --- a/CONTRIBUTING.adoc +++ b/CONTRIBUTING.adoc @@ -192,6 +192,35 @@ need to import the root `spring-boot` pom and the `spring-boot-samples` pom sepa +=== Importing into IntelliJ IDEA +To open the project in IntelliJ IDEA, select "`File`" -> "`Open`" and then click on the +root `pom.xml`. + + + +==== Install the Spring Formatter plugin +If you haven't done so, install the formatter plugin so that proper formatting rules are +applied automatically when you reformat code in the IDE. + +* Download the latest https://search.maven.org/search?q=g:io.spring.javaformat%20AND%20a:spring-javaformat-intellij-plugin[Intellij IDEA plugin] +* Select "`IntelliJ IDEA`" -> "`Preferences`". +* Select "`Plugins`" +* Select the wheel and "`Install Plugin from Disk...`" +* Select the jar file you've downloaded + + + +==== Import additional code style +The formatter does not cover all rules (such as order of imports) and an additional file +needs to be added. + +* Select "`IntelliJ IDEA`" -> "`Preferences`". +* Select "`Editor`" -> "`Code Style`". +* Select the wheel and "`Import Scheme`" -> "`IntelliJ IDEA code style XML`". +* Select `idea/codeStyleConfig.xml` from this repository + + + === Importing into Other IDEs Maven is well supported by most Java IDEs. Refer to your vendor documentation. diff --git a/idea/codeStyleConfig.xml b/idea/codeStyleConfig.xml new file mode 100644 index 0000000000..08f3216f74 --- /dev/null +++ b/idea/codeStyleConfig.xml @@ -0,0 +1,128 @@ + + + + \ No newline at end of file