MAVEN Project import related configuration for Eclipse

Source: Internet
Author: User

A MAVEN project was imported into eclipse yesterday, and since I did not know about Maven before we imported the MAVEN project, I asked my colleague, in this summary, the relevant settings for using the MAVEN starter configuration and the MAVEN project to import Eclipse.

1.maven Installation and Configuration

A. Download maven package: http://maven.apache.org/download.cgi, I downloaded the 3.0.5 version

B. Add compression, put the extracted folder to D disk, and set the local warehouse address, my address is D:\mvnRepository.

Customization of the local warehouse address needs to be done by modifying the D:\apache-maven-3.0.5\conf\settings.xml file.

The configuration of the settings.xml file is as follows:

               <settings xmlns= "http://maven.apache.org/SETTINGS/1.0.0" br>                       xmlns:xsi= "Http://www.w3.org/2001/X Mlschema-instance "
                        XSI:SCHEMALOCAT ion= "http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd";
                     <!--localrepository
        &NBSP ;                     | The path to the local repository maven would use to store artifacts.
                              |
                              | Default: ~/.m2/repository-->

<localRepository>D:/mvnRepository</localRepository>

....... Omit n rows thereafter

C. Configure MAVEN to the environment variable path, mine is D:\apache-maven-3.0.5\bin, and note that the semicolon is separated from the previous one when configured.

So that we have Maven installed, you can enter MVN-V in the DOS command to see the MAVEN version. One prerequisite to note is that the JDK is installed before installation.

2.maven Project Import after eclipse configuration

A. Before contacting the MAVEN project, I used MyEclipse, and then directly to the MAVEN project check down to configure MAVEN related information, in the Add deployment can not find the project, immediately dumbfounded, and then ask

Colleagues, colleagues said we all use eclipse, with MyEclipse can not find the project may be because the project was developed with Eclipse, no language, let's say so, Welcome to know the real reason of the classmate told me Ah .

B. A is only a prelude, now for the configuration under Eclipse, the installation of Eclipse,check project operation is omitted, the JDK under Eclipse, the Tomact configuration is omitted.

B.1 to configure Maven into eclipse:

Windows-preferences-maven-installations the Maven add in the D drive.

Windows-preferences-maven-user setting Select the D:\apache-maven-3.0.5\conf\settings.xml file.

With these two steps, MAVEN is integrated into eclipse

Release of the B.2 Maven project

Right-click Project-Properties-Project Facets tick the dynamic Web Module, Java (Note Select JDK version), JavaScript, and then OK.

B.3 the above operation, right-click Add and move under Eclipse Server will find our project, publish it.

It is important to note that the project may depend on the jar package in the local warehouse, and if not, you can execute the mvn clean compile command in the DOS window to the pom.xml of the project, and you may encounter a case where the class file does not compile, mvn clean Compile this command is also possible, this situation is my appearance, my colleague did not appear, after the execution of the command is no problem.

The above is my first MAVEN project to play a simple summary, there may be said not clear or incorrect place, welcome to correct, also welcome you to exchange knowledge.

MAVEN Project import related configuration for 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.