- navigate to start.spring.io
- choose Maven project
- Choose Java language
- use the latest version of Spring Boot
- fill in Project metadata
- choose Jar packaging
- choose Java 11
- add Spring Web, Thymeleaf dependencies
- click generate
- unzip the downloaded file
- import project to your favourite IDE as a Maven project
- choose Java 11 as your language
- under src/main/resources create a file index.html
- add the same content as in this project
- verify that Spring boot plugin is enabled. if not, go to https://plugins.jetbrains.com/plugin/10229-spring-assistant and install it in your IDE
- go to Project and start new project.
- choose Spring assistant
- select Java 11 as SDK, the default for spring initializr and hit next
- fill in project properties, same as above and hit next
- in the dependency section, from web select Spring Web, and from Template Engines select Thymeleaf
- create index.html under src/main/resources as mentioned above.
- you're ready to go
- run
mvn clean package
command - Run
java -jar target/learning-spring-2.4.1.jar
Whereas learning-spring is the name of your project, and 2.4.1 is the version of the spring boot. - go to your web browser to localhost:8080