Saturday, December 15, 2018

Open start.spring.io-generated project in vscode

Prerequisites

Configure a project

You can use start.spring.io to configure it. I configured it like the following:

Please note that I added "Web" and "Thymeleaf". To add these dependencies, search for dependency in the "Search for dependencies" and click the suggestion. After configuring everything, click on "Generate Project".

VScode

Once you click on "Generate Project", you will get a zip file. Extract "demo" folder of the zip. 

Drag and drop the extracted "demo" on VScode. 


Open pom.xml by double-clicking on the "pom.xml".

Press F5 then click on "Java". The project will be compiled. 

Auto import of libraries in VScode

Auto import is an important functionality of IDE and this can be done in VScode too.
Press "ctrl + ." to get suggestion of automatic import of Java library in VScode. The following is an example:
Pressing ctrl + . on the "FetchType"