Maven for Eclipse

Source: Internet
Author: User

Maven 2 Repository

Eclipse needs to know the path to the local Maven repository. Therefore the classpath variable m2_repo have to be set. Execute the following command:

Mvn-declipse.workspace=<path-to-eclipse-workspace> Eclipse:add-maven-repo

Restart your Eclipse IDE (if you already has it open) for the change to take effect.

You can also define a new classpath variable inside eclipse:from the menu bar, select Window > Preferences. Select the Java > Build Path > Classpath Variables page.


Simple Project

If you had a simple Java project which are made up of only one module, using the eclipse is very simple. To generate the Eclipse project files from your POM you execute the following command:

MVN Eclipse:eclipse

If you have a created or checked out of the project with Eclipse, you are only having to refresh the project in your workspace. Otherwise you has to import the project into your Eclipse workspace (from the menu bar, select File >import >existi ng Projects into Workspace). In the latter case the project (directory) should not being located in your workspace, because eclipse might come into Troubl E, especially if want to use eclipse as the SCM client.

Http://maven.apache.org/guides/mini/guide-ide-eclipse.html#Maven_2_repository

PS: Can be re-executed under the project directory after updating the POM

MVN Eclipse:eclipse

To regenerate the Eclipse project description file, and then restart 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.