【英文】通过STS创建SpringBoot项目
Introduction
Creating a SpringBoot project based on SpringToolSuite4.
Preparation
- Java 1.8
- Maven 3.6.3
Configuring Maven in STS
Spring Tool Suite 4
->Preferences
->Maven
->Installations
->Add
- Configure the Maven installation directory
- Select the new configuration->Apply
Maven
->User Settings
->Modify the configuration->Apply
Creating a Project using Official Starter
File
->New
->Spring Starter Project
- Configure project parameters->
Next
- Select SpringBoot version->
Finish
Creating a Project using Alibaba Cloud’s Starter
File
->New
->Spring Starter Project
- Configure project parameters, change
Server URL
to Alibaba Cloud’s Starter->Next
- If the version is displayed incorrectly, you can manually adjust the version, ignore the version number in the configuration version, and select
Next
- Manually adjust the version number->
Finish
Importing Project using Packaged File from Official Website
- Configure project parameters on the official website and download the packaged new project https://start.spring.io
SNAPSHOT
: Snapshot versionM2
: Important feature release version, not official
Unzip the package and import the project into STS
File
->Import
->Maven
->Existing Maven Projects
->Next
- Select the project root directory->
Finish
Creating Project using Normal Maven Project
Create a simple Maven project
File
->New
->Other
->Maven
->Maven Project
->Select Simple Maven Project->Next
- Configure project parameters->
Finish
- Replace the content of the pom.xml file with:
1 |
|
- Right-click on the project->
Maven
->Update Project
- Select
Force Update of Snapshots/Releases
->OK
Create the entry program manually
Create a new Java file with the fully qualified name
com.company.CgbSpringboot04Application
Define the annotation
@SpringBootApplication
on the class and define the main method
1 |
|
Copying Project from Another Machine
After building a complete new project using any of the above methods, compress the project and copy it to another machine
Adjust the parameters in the pom.xml file