2. Using Maven in Eclipse

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.