Building a Guide with VS Code

This guide walks you through using VS Code to build one of the Getting Started guides.

What you’ll build

You’ll pick a Spring guide and import it into VS Code. Then you can read the guide, work on the code, and run the project.

What you’ll need

Installing VS Code with Java and Spring support

Choose and visit above links, and follow instructions to install. When you’re done, go ahead and launch VS Code.

Cloning a guide project

To work with an existing project you need some code, so clone or copy one of the Getting Started guides, e.g. the REST Service guide:

git clone https://github.com/spring-guides/gs-rest-service.git

Under the root folder of cloned or copied project, there are initial and complete folders. The initial folder contains initial code set, an empty project, making it possible for you to copy-and-paste your way through a guide. The complete folder contains complete code set where all the code from the guide already entered.

Starting a guide project from initial code set

To start a guide project from initial code set, open the initial folder within VS Code. In first open, accept to import the project.

Open a specific folder in VS Code

Opening the complete version of a guide project

To open the complete version of a guide project, open the complete folder within VS Code. In first open, accept to import the project.

Running a guide

To run, open the source file where main method is defined and click Run on editor window.

Press run on the main java app

Summary

Congratulations! You have setup VS Code, imported the guide to build a RESTful web service, and ran it.

Want to write a new guide or contribute to an existing one? Check out our contribution guidelines.

All guides are released with an ASLv2 license for the code, and an Attribution, NoDerivatives creative commons license for the writing.

Get the Code