Maven Installation notes

Source: Internet
Author: User

1. Download maven3.0.4 from http://maven.apache.org/download.html and decompress the installation file to d:#program files \.

2. Set environment variables:

Variable name: m2_home

Variable value: D: \ Program Files \ apache-maven-3.0.4

% M2_home % \ bin is added to the PATH variable value;

3. Copy conf \ Settings. XML to the C: \ Documents ents and Settings \ Administrator \. m2 (XP user) directory. The copied file name is ~. M2 \ Settings. xml.

At this step, the \. m2 directory is still not found in the directory, and no related solutions can be found on the Internet. As a result, the directory starting with. cannot be created in the graphic interface. Therefore, mkdir. m2. in DOS is entered, but a repository folder is missing after comparison. Finally, I accidentally found the. m2 directory in D: \ 360data \ important data \. m2. It is estimated that it was caused by moving the 360C disk, but it was finally solved.

4. Change the configuration in eclipse. ini:

-- Launcher. xxmaxpermsize

256 m

-VM

D: \ Program Files \ Java \ jdk1.6 \ bin \ javaw

-- Launcher. defaultaction

Openfile

-Vmargs

-Dosgi. requiredjavaversion = 1.5

-Xms128m

-Xmx256m

By default, eclipse runs on JRE, while some functions of m2eclipse require JDK, so VM configuration is added.

5. Install m2eclipse

Eclipse --> help --> install new software... --> Add -->

Name: m2e

Location: http://m2eclipse.sonatype.org/site/m2e

--> OK

If the address above cannot be changed.

Http://download.eclipse.org/technology/m2e/releases/ -- eclipseCommunity

Http://m2eclipse.sonatype.org/sites/m2e-Official Website

 

Note:

 

(1) We can copy settings. XML in the conf folder of the maven installation directory to ~ /. M2 directory (for example, the local machine is: C: \ Users \ Chacha \. m2 \), the settings of the former. XML affects the global scope, while the latter only affects the current login users. We recommend that you use the latter, which depends on the situation.

 

(2) Disable Maven embedded in eclipse

 

This embedded Maven is usually relatively new, but not necessarily stable, and is often different from the maven version we use on the command line. There are two potential problems: first, there are many unstable factors in the newer versions of Maven, which may cause some difficult-to-understand problems. Second, apart from IDE, we also often use maven of the command line. If the versions are inconsistent, the build behavior may be inconsistent, which we do not want to see. Therefore, we should use Maven that is consistent with the command line When configuring Maven plug-ins in IDE.

 

Solution:

Window-preferences-Maven-installations-add and select the installation directory and click Apply

 

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.