Home > Back-end >  With the IDEA to create a new springboot mybatis project
With the IDEA to create a new springboot mybatis project

Time:11-30

1, click the top left corner File - & gt; New - & gt; The Project

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"?>
Xsi: schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" & gt;
4.0.0 & lt;/modelVersion>

Org. Springframework. Boot
Spring - the boot - starter - parent
2.3.2. RELEASE

Com. Example. Xxxxxx
Xxxxxx
0.0.1 - SNAPSHOT
Xxxxxx
The Demo project for Spring Boot


1.8 & lt;/Java. Version>




Org. Springframework. Boot
Spring - the boot - starter - web


Org. Springframework. Boot
Spring - the boot - starter - data - jpa


Mysql
Mysql connector - java
Runtime


Org. Mybatis. Spring. Boot
Mybatis - spring - the boot - starter
1.3.2 & lt;/version>


Org. Springframework. Boot
Spring - the boot - starter - thymeleaf
-->

Com. Alibaba
Fastjson
1.2.41 & lt;/version>


Javax.mail. Servlet
Javax.mail. Servlet - api
Provided


Javax.mail. Servlet
Jstl


Org, apache tomcat. Embed
Tomcat embed - jasper
Provided


Org. Springframework. Boot
Spring - the boot - devtools
  • Related