Creating Spring Boot Projects
To create a Spring Boot project, you can use Spring "starters" via Maven/Gradle, or the Spring Initializr service. Spring Initializr is a web-based tool that allows you to generate a template project and automatically sets all required dependencies according to the selected technologies instead of configuring them manually. It generates a full project, or a build file with Maven or Gradle.
With the Spring Initializr integration in IntelliJ IDEA, you can create a ready-to-run application in just a few clicks directly from the New Project wizard. To do this, perform the following steps:
- If no project is currently open, click Create New Project on the welcome screen; otherwise select File | New | Project.
- On the first page the New Project wizard, select Spring Initializr in the left pane.
In the right pane, specify a project SDK (JDK). If the necessary JDK is already defined in IntelliJ IDEA, select it from the list.
Otherwise, click New and select JDK from the list. Then, in the dialog that opens, select the installation folder of the desired JDK (by this time, the corresponding JDK must already be installed on your computer).
Specify the Spring Initializr instance URL. By default, it is
https://start.spring.io, but you can use any other custom instance if needed.
- On the next page of the wizard, specify project metadata settings. Note that specific fields vary slightly depending on the Spring Initializr instance URL you specified in the previous step.
- On the next page of the wizard, select the Spring Boot version and specify project dependencies.
- On the last page of the wizard, check the project name and location and modify them if necessary.
IntelliJ IDEA will create a fully-functional project with the predefined structure, a Spring facet, a Maven or Gradle build file and a set of libraries.
Note that if the Create run configuration for Spring Boot application option is enabled in Maven. Importing settings, IntelliJ IDEA will also automatically create a run/debug configuration for your application on Maven import.