Enter Spring official website , enter SpringBoot homepage
Scroll down, find the quick start, click to enter
Then choose the following configuration
Or you can quickly create a new SpringBoot project in IDEA.
After clicking Next, you can see that it is the same as the configuration filled in on the website:
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:
You can see in the console:
Now open localhost:8080 to see if the project is running successfully:
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:
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
【Tips】
- In
application.properties
the settingssever.port=8081
you can change the port number to start- In the
Resources
directory under the newbanner.txt
, which can put printed at startup text pattern