Creating a new Spring Boot application

The initial creation on a Spring Boot application is easy with the utilization of IntelliJ IDE and the Spring initializer. Open IntelliJ IDE and create a new project with the Spring Initializer. This can be done by clicking on Create New Project and selecting Spring Initializer on the left side bar of the New Project screen:

After selecting the Spring Initializer, progress to the next screen by clicking the Next button. Upon clicking next, before the next screen is displayed, Spring Initializer will be retrieved by the IDE. This will only take a few moments to do.

The Spring plugin is only available in the Ultimate edition of IntelliJ IDEA, which comes with a paid subscription.

Once the Spring Initializer is retrieved, you will be asked to provide the appropriate details for the project to be created. Fill in the necessary details. You may choose to use the details used for the development of the application in this book or decide to input your own. However, in the instance that you want to use our details, do the following:

  1. Input com.example as the group ID.
  2. Enter messenger-api as the artifact ID.
  3. Select Maven Project as the project type if it is not already selected.
  4. Leave the packaging option and the Java version the way they are.
  5. Select Kotlin as the language. This is important, as we are learning the Kotlin language, after all.
  6. Leave the SNAPSHOT value as it is.
  7. Enter a description of your choice.
  8. Input com.example.messenger.api as the package name.

After filling in the required project information, proceed to the next screen by clicking Next:

In the next screen, you will be asked to select the project dependencies. For starters, we will need to select the Security, Web, JPA, and PostgreSQL dependencies. Security can be found under the Core category, Web can be found under the Web category, and JPA and PostgreSQL can be found under the SQL category. In addition, in the Spring Boot Version selection drop-down menu at the top of the screen, select 2.0.0 M5 as the version.

After the selection of the necessary dependencies, the content should look similar to the following screenshot:

After selecting the appropriate dependencies, click Next to continue to the final setup screen. You will be asked to provide a project name and a project location. Fill in messenger-api as the project name and select the location where want the project to be saved on your computer. Select Finish and wait for the project to be set up. You will be taken to a new IDE window containing the initial project files.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.15.176.80