new Create a new project and select Spring Initializr, and then configure the address. You can use Alibaba Cloud as shown in the figure below. (Because the Spring official website abroad may be unstable)
the following three addresses (choose one) can be used.
-
https://start.spring.io (default)
-
https://start.springboot.io
-
https://start.aliyun.com
and then
click Finish
and wait for the download to load, check whether the project is successfully created, and see if there is an error in the Build, as shown in the figure below, if it is successful,
if the above figure shows red instead of a green tick If the error message is reported, follow the steps below to solve it: -
Refresh maven if there is an error,
-
If refreshing the maven error cannot be resolved, delete the repository folder under the .m2 folder and then refresh maven
-
If it still doesn't work, check whether the maven configuration is correct, and if there is no problem, recreate the project again (the new project cannot have the same name as the previous project, even if the previous project has been deleted)
Test whether the project was created successfully
Create index.html in the static folder of the springBoot project, then start the project, visit localhost:8080 in the browser to see if it can be accessed, if it is accessed, it means success