Maven configuration in eclipse

Source: Internet
Author: User

Download maven3 Configuration

 

Http://maven.apache.org/download.cgi

 

Online document

Http://maven.apache.org/ref/3.0.5/

 

Install

1. Install JDK, Configure java_home, and configure path

Test

Open cmd

Echo % java_home %

Java-version

 

2. install and configure manen

1 decompress the downloaded package to any address, my path is D: \ Program Files \ apache-maven-3.0.5

2 new environment variable m2_home points to D: \ Program Files \ apache-maven-3.0.5

3 add % m2_home % \ bin at the end of Path

4. Check whether the installation is successful.

Open cmd

Echo % m2_home %

MVN-V

(MVN-Version)

 

Configuration File

D: \ Program Files \ apache-maven-3.0.5 \ conf \ Settings. xml

Configurable repository. Default Value: user directory \. m2 \ Repository

-- It can be configured as <localrepository >$ {env. m2_home}/Repository </localrepository>

 

Run MVN help: System

At this time, MAVEN will download a lot of things from the remote warehouse. It's okay to let it download. It will be downloaded sooner or later.

 

(By default ,~ The/. m2 directory contains no other directories and files except the repository. However, most Maven users need to copy the m2_home/CONF/settings. xml file ~ /. M2/settings. xml. This is a best practice)

3. Install Maven plug-in eclipseM2eclipse

1 open eclipse

2 help-install new software

Add

M2e

Http://m2eclipse.sonatype.org/sites/m2e

This path has been changed to the following path
Http://download.eclipse.org/technology/m2e/releases 

 

Error:

Cannot complete the install because one or more required items cocould not be found.
Software being installed: m2e-slf4j over logback logging (optional) 1.4.0.20130601-0317 (Org. Eclipse. m2e. logback. feature. feature. Group 1.4.0.20130601-0317)
Missing requirement: Maven integration for eclipse 1.4.0.20130601-0317 (Org. Eclipse. m2e. Core. UI 1.4.0.20130601-0317) requires 'bundle org. slf4j. API 1.6.2 'But it cocould not be found
Cannot satisfy dependency:
From: m2e logback appender 1.4.0.20130601-0317 (Org. Eclipse. m2e. logback. appender 1.4.0.20130601-0317)
To: bundle org. Eclipse. m2e. Core. UI [1.4.0, 1.5.0)
Cannot satisfy dependency:
From: m2e-slf4j over logback logging (optional) 1.4.0.20130601-0317 (Org. Eclipse. m2e. logback. feature. feature. Group 1.4.0.20130601-0317)
To: org. Eclipse. m2e. logback. appender [1.4.0.20130601-0317]

 

 

Iii. Problems during installation:
If you directly install maven2 online, the dependency plug-in cannot be found and cannot be installed. You must install the GEF plug-in before installing the m2eclipse-core plug-in, but installing the m2eclipse-extras plug-in is dependent on the subclipse plug-in. Therefore, the correct installation sequence of the three plug-ins is: GEF plug-ins, subclipse plug-ins, and m2eclipse plug-ins.
M2eclipse-core plug-in -- Dependency --> GEF plug-in
M2eclipse-extras plugin -- Dependency --> subclipse plugin

You may need to install the GEF plug-in and SVN plug-in first.

1.4.1 install the GEF plug-in first

When the maven plug-in is installed, it will be attached to this plug-in and installed in eclipse-> help-> install new software,

GEF

Http://download.eclipse.org/tools/gef/updates/interim/

1.4.2 install SVN plug-in

Install in eclipse-> help-> install new software, site: http://subclipse.tigris.org/_1.6.x

 

After installing GEF

Or error:

Cannot complete the install because one or more required items cocould not be found.
Software being installed: m2e-Maven integration for eclipse 1.4.0.20130601-0317 (Org. Eclipse. m2e. feature. feature. Group 1.4.0.20130601-0317)
Missing requirement: async-http-client 1.6.5.20130531-2315 (COM. Ning. async-http-client 1.6.5.20130531-2315) requires 'package org. slf4j 1.6.2 'But it cocould not be found
Cannot satisfy dependency:
From: Maven archetype common bundle 1.4.0.20130531-2315 (Org. Eclipse. m2e. Archetype. Common 1.4.0.20130531-2315)
To: bundle org. Eclipse. m2e. Maven. runtime [1.4.0, 1.5.0)
Cannot satisfy dependency:
From: m2e-Maven integration for eclipse 1.4.0.20130601-0317 (Org. Eclipse. m2e. feature. feature. Group 1.4.0.20130601-0317)
To: org. Eclipse. m2e. Archetype. Common [1.4.0.20130531-2315]
Cannot satisfy dependency:
From: Embedded Maven runtime bundle 1.4.0.20130531-2315 (Org. Eclipse. m2e. Maven. runtime 1.4.0.20130531-2315)
To: bundle com. Ning. async-http-Client [1.6.5, 1.6.6)

 

Offline installation package:

Http://ishare.iask.sina.com.cn/f/36090147.html

Create the maven3 folder in the dropins directory

Put the decompressed features directory and Plugins directory in maven3 under dropins, without link.

Directory

Eclipse3.7

-- Plugins
-- Features
-- Links
------Xxx.link(example is xxx.txt)
-- Dropins
------ Xxx

---------- Plugins
---------- Features

 

Test

Windows-Maven in preferences

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.