Spring Boot in Visual Studio Code

Visual Studio Code is an ideal lightweight development environment for Spring Boot application developers and there are several useful VS Code extensions including:

If you run into any issues when using the features below, you can contact us by clicking the Report an issue button below.

Report an issue

Prerequisites

A working Java environment with essential extensions installed is needed, including:

For more details, please refer to Java Tutorial

Create the project

The Spring Initializr extension allows you to search for dependencies and generate new Spring Boot projects.

To install, launch VS Code and from the Extensions view (kb(workbench.view.extensions)), search for vscode-spring-initializr.

Once you have the extension installed, open the Command Palette (kb(workbench.action.showCommands)) and type Spring Initializr to start generating a Maven or Gradle project and then follow the wizard.

Edit the project

The Spring Initializr extension allows you to edit dependencies after generating a new Spring Boot project.

Navigate to your pom.xml file and right-click to select Edit starters. The Command Palette will show the dependencies you already have beginning with a . You can search for other dependencies you want to add to your project. Or you can click on the existing dependencies to remove them.

Develop the application

The Spring Boot Tools extension includes rich language support for working with Spring Boot application.properties, application.yml, and .java files.

The extension supports quick navigate through source code, smart code completions, quick access to running apps, live application information, and code templates. Similar code completion and validation features are also available for .properties and .yml files.

Run the application

In addition to click kb(workbench.action.debug.start) to run your application, there’s another convenient extension Spring Boot Dashboard with which you can view and manage all available Spring Boot projects in your workspace as well as quickly start, stop, or debug your project.

Next steps