Merge branch '2.3.x' into 2.4.x
Closes gh-26333
This commit is contained in:
commit
65cb654a22
@ -54,111 +54,4 @@ added after the original pull request but before a merge.
|
||||
|
||||
|
||||
== Working with the Code
|
||||
If you don't have an IDE preference we would recommend that you use https://spring.io/tools[Spring Tool Suite] or https://eclipse.org[Eclipse] when working with the code.
|
||||
We use the https://projects.eclipse.org/projects/tools.buildship[Buildship] Eclipse plugin for Gradle support.
|
||||
Other IDEs and tools should also work without issue.
|
||||
|
||||
|
||||
|
||||
=== Building from Source
|
||||
Spring Boot source can be built from the command line using https://gradle.org[Gradle] on JDK 1.8 or above.
|
||||
We include https://docs.gradle.org/current/userguide/gradle_wrapper.html[Gradle's wrapper scripts] (`./gradlew` or `gradlew.bat`) that you can run rather than needing to install Gradle locally.
|
||||
|
||||
The project can be built from the root directory using the standard Gradle command:
|
||||
|
||||
[indent=0]
|
||||
----
|
||||
$ ./gradlew build
|
||||
----
|
||||
|
||||
|
||||
|
||||
=== Importing into Eclipse
|
||||
You can import the Spring Boot code into any Eclipse 2019-12-based distribution.
|
||||
The easiest way to setup a new environment is to use the Eclipse Installer with the provided `spring-boot-project.setup` file (in the `/eclipse` folder).
|
||||
|
||||
|
||||
|
||||
==== Using the Eclipse Installer
|
||||
Spring Boot includes a `.setup` files which can be used with the Eclipse Installer to provision a new environment.
|
||||
To use the installer:
|
||||
|
||||
* Download and run the latest https://download.eclipse.org/justj/?file=oomph/products/latest[Eclipse Installer] (must be 1.19.0 or above).
|
||||
* Switch to "Advanced Mode" using the drop down menu on the right.
|
||||
* Select "`Eclipse IDE for Java Developers`" under "`Eclipse.org`" as the product to install, `2020-12` as the product version, and click "`next`".
|
||||
* For the "`Project`" click on "`+`" to add a new setup file.
|
||||
Select "`Github Projects`" and browse for `<checkout>/eclipse/spring-boot-project.setup` from your locally cloned copy of the source code.
|
||||
Click "`OK`" to add the setup file to the list.
|
||||
* Double-click on "`Spring Boot`" from the project list to add it to the list that will be provisioned then click "`Next`".
|
||||
* Click show all variables and make sure that "`Checkout Location`" points to the locally cloned source code that you selected earlier.
|
||||
You might also want to pick a different install location here.
|
||||
* Click "`Finish`" to install the software.
|
||||
|
||||
Once complete you should find that a local workspace has been provisioned complete with all required Eclipse plugins.
|
||||
Projects will be grouped into working-sets to make the code easier to navigate.
|
||||
|
||||
TIP: If you see import errors with `com.sun` packages make sure you have setup a valid `JavaSE-1.8` environment. From preferences select "`Java`", "`Installed JREs`", "`Execution Environments`" and make sure "`JavaSE-1.8`" points to a Java 1.8 install (we use AdoptOpenJDK on our CI).
|
||||
|
||||
|
||||
|
||||
==== Manual Installation with Buildship
|
||||
If you prefer to install Eclipse yourself you should use the https://projects.eclipse.org/projects/tools.buildship[Buildship] Eclipse plugin.
|
||||
If you don't already have Buildship installed it is available from the "`Eclipse marketplace`".
|
||||
|
||||
Spring Boot includes project specific source formatting settings, in order to have these work with Buildship, we provide an additional Eclipse plugin that you can install.
|
||||
|
||||
|
||||
|
||||
===== Install the Spring Formatter plugin
|
||||
* Select "`Help`" -> "`Install New Software`".
|
||||
* Add `https://repo.spring.io/javaformat-eclipse-update-site/` as a site.
|
||||
* Install "Spring Java Format".
|
||||
|
||||
NOTE: The plugin is optional.
|
||||
Projects can be imported without the plugins, your code changes just won't be automatically formatted.
|
||||
|
||||
With the requisite Eclipse plugins installed you can select `Gradle -> Existing Gradle project` from the `File -> Import...` menu to import the code.
|
||||
|
||||
|
||||
|
||||
=== Importing into IntelliJ IDEA
|
||||
If you have performed a checkout of this repository already, use "`File`" -> "`Open`" and then select the root `build.gradle` file to import the code.
|
||||
|
||||
Alternatively, you can let IntelliJ IDEA checkout the code for you. Use "`File`" -> "`New`" -> "`Project from Version Control`" and `https://github.com/spring-projects/spring-boot` for the URL.
|
||||
Once the checkout has completed, a pop-up will suggest to open the project.
|
||||
|
||||
|
||||
|
||||
==== 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-idea-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
|
||||
Gradle is well supported by most Java IDEs. Refer to your vendor documentation.
|
||||
|
||||
|
||||
|
||||
== Cloning the git repository on Windows
|
||||
Some files in the git repository may exceed the Windows maximum file path (260 characters), depending on where you clone the repository.
|
||||
If you get `Filename too long` errors, set the `core.longPaths=true` git option:
|
||||
|
||||
```
|
||||
git clone -c core.longPaths=true https://github.com/spring-projects/spring-boot
|
||||
```
|
||||
For information on editing, building, and testing the code, see the https://github.com/spring-projects/spring-boot/wiki/Working-with-the-Code[Working with the Code] page on the project wiki.
|
||||
|
Loading…
x
Reference in New Issue
Block a user