Spring Boot with Thymeleaf and Maven

In this section, we will see how we can use Spring boot to create a Spring with Thymeleaf application.

The pre-requisite for this operation is Maven, which should be installed. To check if Maven is installed, type the following command in to the Command Prompt:

mvn –version
  1. Use the archetype to generate a Spring boot with a thymeleaf project:
    mvn archetype:generate -DarchetypeArtifactId=maven-archetype-quickstart -DgroupId=com.packt.demo -DartifactId=spring-boot-thymeleaf -interactiveMode=false
    

    The preceding command will create a spring-boot-thymeleaf directory. This can be imported into Eclipse IDE.

  2. You will open the pom.xml file and add a parent project:
    <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> ...

Get Mastering Spring Application Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.