1. Import Maven Project
1.1 Download Sample project from spring official website
Visit the Spring website
Click "Browse the Guides" to see the many demos that spring has provided for us.
Click the first example Project
On the entry page, you can see the download button
After downloading, unzip to E:\MavenProject.
1.2eclipse Import Instance Project
Open Eclipse, "Flie"--"Import"--"Existing Maven Projects"
Click "Browse" to select the MAVEN project directory that you just downloaded, such as. Click "Finish" to complete the project import.
2. Operation Engineering
2.1 View Project Catalog
In the hello package, as shown, contains 3 classes.
Gs-rest-service
|--src/mian/java
| |--hello
| The entrance to the |--application works, the whole project, starting from this
| |--greeting entity class
| |--greetingcontroller Controller, responsible for intercepting/greeting Web requests
|--src/test/java Unit Test
|--pom.xml project configuration file, primarily for managing project dependencies
2.2 Running the project
Enter Application class--right button-->run As-->java application, the whole project starts up.
Open the browser and visit http://localhost:8080/greeting to see the results of the program running.
3. Create a new MAVEN project with Eclipse
Open Eclipse, "File"--"New"--"Maven Project"
Use the default Workspace location to remove the check, choose your favorite path, click on the page next--> appear let us choose the new project template, with the default, continue to click Next.
Group ID, Artifact ID, version these three configurations, which are the coordinates of the project, are used to uniquely differentiate one item.
2. Using Maven in Eclipse