Spring Boot from entry to mastery - project construction

Spring Boot greatly simplifies the development of Java projects. If you want to develop a java project before, you need to install tomcat or other container plug-ins. However, tomcat has been integrated in Spring Boot, so it is very convenient to start the project. In addition, there are many default configurations in the development of Spring Boot, which helps us save a lot of time.

Quick start of Spring Boot project

In idea, file -- > New -- > Project


Select Spring Initializr


Fill in the basic project information of your maven project, such as groupId and artifact, and then select web - > Web in dependency to finish.


The directory structure is as follows:


Run DemoApplication.java directly to run the project.

Next let's analyze the dependencies in pom.xml.

<?xml version="1.0" encoding="UTF-8"?>

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">












  <description>Demo project for Spring Boot

 <description>Demo project for Spring Boot</description>




<!--Basically all spring boot All projects must refer to dependencies to ensure that they will not stop after project startup-->



  <!--Dependencies used in testing-->
  <!--Able to Maven To provide Spring Boot The support of is Spring Boot Application provides execution Maven The possibility of operation can Spring Boot    Application packaged as executable jar or war file-->


There is also an important file in Spring Boot: the application.properties/yml/yaml file.

The configuration in the project is no longer in the previous xml form, but written in this file. Spring Boot has provided us with many default configurations.

We have built a Spring Boot framework without any operation at all. In the next chapter, we will continue to learn more about Spring Boot step by step.

Tags: Spring Maven Java xml

Posted on Tue, 03 Dec 2019 05:48:19 -0500 by m@tt