Detailed tutorial on creating SpringBoot project with IDEA

Create project

1. File—new—project in the upper left corner of IDEA

Insert image description here

2. Project related information configuration

Insert image description here

3. Select project dependencies

Insert image description here

4. Configure the location of the project

Insert image description here
Click Finish to create the project.
Insert image description here
After completing the online download package, the project is completed.

5. If the Idea creation fails, you can create it on the web page. The steps are the same as in IDEA.

Insert image description here

Configuration items

SpringBoot helps us complete universal configuration, but database connection addresses, accounts, passwords, etc. still need to be configured manually.

1. Delete some temporarily unnecessary files

Insert image description here
Insert image description here

2. springboot project structure

Insert image description here

Here, use the yml file for Springboot configuration.
Create a new application.yml file in the resources directory.
Insert image description here

3. Change configuration according to project needs

Insert image description here

4. Configure data source

Insert image description here

Pay attention to the indentation of spaces

5. Configure the mapping file path and the package name of the entity class

Insert image description here
Insert image description here

6. Specify the package name of the DAO interface through the @MapperScan annotation in the SpringBoot startup class.

Insert image description here
Insert image description here

SpringBoot's SSM integration configuration is completed

7. Start testing

Run the DemoApplication class to start the project
Insert image description here

Guess you like

Origin blog.csdn.net/qq_42042158/article/details/121625621