[SpringBoot] Quickly build the first SpringBoot project

Enter Spring official website , enter SpringBoot homepage

Insert picture description here

Scroll down, find the quick start, click to enter

Insert picture description here

Then choose the following configuration

Insert picture description here

Or you can quickly create a new SpringBoot project in IDEA.

Insert picture description here

After clicking Next, you can see that it is the same as the configuration filled in on the website:

Insert picture description here

Insert picture description here

No matter which way to create a SpringBoot project, the initialization is an empty project, you can execute the main method to run the project:

Insert picture description here

You can see in the console:

Insert picture description here

Now open localhost:8080 to see if the project is running successfully:

Insert picture description here

This is because it is currently an empty project, but it ran through.

At this time, it may be a bit daunting, so how about this:

Insert picture description here

Note here that the customized package must be at the same level as XXXApplication, otherwise the component cannot be scanned.

At this point, run the project again and view localhost:8080/hello

Insert picture description here

【Tips】

  • In application.propertiesthe settings sever.port=8081you can change the port number to start
  • In the Resourcesdirectory under the new banner.txt, which can put printed at startup text pattern

Guess you like

Origin blog.csdn.net/dreaming_coder/article/details/114392227