2, choose the Spring Initializr, click Next
3, modify the project name, click Next
4, choose depend on the
General web project can check the web - "Spring web, SQL -" mysql Driver, do not choose to skip can also, in pom.
XML to add
5, click Next, fill in the project name and the location of the project in the local, and then click finish
Then you can wait for loading
At this point the project structure is
6, modify the configuration file
Yml format. The application of yml file, right click on the application. The properties, refactor - "Rename, it is ok to change the suffix to yml, use yml because structure is more clear than the properties of the format
# port
Server:
The servlet:
The context path:/demo
Port: 8082
# mysql connection
Spring:
Datasource:
The driver - class - name: com. Mysql.. JDBC driver
Url: JDBC: mysql://127.0.0.1:3306/dusk? UseUnicode=true& amp; CharacterEncoding=UTF8 & amp; amp; UseSSL=true
Username: root
Password: 123456
MVC:
View:
The prefix:/WEB - INF/views/
Suffix: JSP
7, in pom. Add the dependency in the XML, CTRL + s idea after the bottom right hand corner will pop-up window, click the important change that will automatically download the jar package, will use maven project, the need to install maven in local warehouse, the idea can be configured in setting the warehouse location
If the local repository path is not the local maven repository location, you can click the override on the right to choose, the new project, if the Java file on the left is red, be sure to look at the configuration of the maven warehouse right.
<? The XML version="1.0" encoding="utf-8"?>
-->