Use Maven to manage dependencies in eclipse Projects

Source: Internet
Author: User

 

Normal
Eclipse
Project execution:
MVN Eclipse: Eclipse

Then
Eclipse
Medium
Import
Project

1.3 In
Eclipse
Set in
Maven
PATH variable

The imported project has an error mark. Don't worry, because you haven't set
Maven
Class Library variable

Open the properties box of the project
Java build path
We can see that the paths of the dependent class libraries of the project have been automatically set.

 

The following settings
Maven
PATH variable
M2_repo

Window-> preferences-> JAVA-> build path-> classpath Variables
,
New

Name
Name it
M2_repo
, Path for your local
Maven
Class Library address, which is
C:/Documents and Settings/Jeffrey/. m2/Repository
, After the setting is successful, re-compile and find that the error mark of the project has been eliminated. So far,
Eclipse
The project has been imported successfully.

1.4 Add a new dependency for the project

Edit
POM
File to add a new
Dependency
,
Save

Run the following commands on the console:

MVN Eclipse: clean

MVN-dwtpversion = 1.0 Eclipse: Eclipse

In
Eclipse
Refresh the project to see that the new dependency has been added
Eclipse
Project



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.