Installation configuration for Maven in eclipse

Source: Internet
Author: User
Tags xmlns

Transferred from: http://blog.csdn.net/wode_dream/article/details/38052639

Before installing Maven, you need to make sure that your JDK is installed and configured. MAVEN is a project under Apache. First step: Install and configure MAVEN

First go to the official website to download maven:http://www.apache.org/dyn/closer.cgi/maven/binaries/apache-maven-3.0.4-bin.tar.gz
After the download is done, unzip it, I rename the extracted folder to maven and place it in the D:\Server directory, where Maven's final path is: D:\Server\maven

To configure the MAVEN environment variable:
System variable: maven_home = D:\Server\maven
System variable: PATH =%maven_home%\bin

Open cmd, knock inside: mvn-version

If you can print the information above, it means that the MAVEN3 has been installed on your PC.
MVN is a mavn instruction, mvn-version is to view the version information, my operating system is 32-bit WIN7, the installation of MAVEN is 3.0.4
If you can print the information above, it means that the MAVEN3 has been installed on your PC.

To modify the MAVEN repository storage location :
Find the Settings.xml configuration file under Maven under Conf, mine is in D:\Server\maven\conf\settings.xml

The MAVEN repository defaults to the. M2 folder under the local user's Temp folder under Repository, mine is under the C:\Users\admcnm.m2\repository directory,
Now let's modify to assign it to our own path, I'm now going to assign the repository to the D:\Repositories\Maven directory, just open the local repository that was logged off.
Then write the corresponding path value in it:

OK, first to experience maven, knock in CMD and enter to execute: MVN help:system
This is when Maven downloads a whole bunch of things from the remote repository.

Step Two: Install and configure the Maven plugin for Eclipse

Download M2eclipse plugin:
http://m2eclipse.sonatype.org/sites/m2e/0.12.1.20110112-1712/

3. Copy the jar package from the features to the Eclipse/features directory, and copy the jar package from the plugins to the Eclipse/plugins directory;
4. Restart Eclipse;

PS: There are many ways to install plugins. http://inotgaoshou.iteye.com/blog/978600

Check that the Maven plugin for Eclipse is installed successfully:window–> Preferences

To configure MAVEN:
1. Click the Add button to select the path value of your native MAVEN installation

2. Click the Browse button, select your Maven setting.xml profile, then click OK to complete the configuration of the Eclipse Maven plugin

3. Add Mahout dependency, modify the Pom.xml (the configuration above is the configuration required by the system, which is configured for each project)

<project xmlns= "http://maven.apache.org/POM/4.0.0" xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance" xsi: schemalocation= "http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" > < Modelversion>4.0.0</modelversion> <groupId>abb</groupId> <artifactid>test</ artifactid> <version>0.0.1-SNAPSHOT</version> <packaging>jar</packaging> <name> test</name> <url>http://maven.apache.org</url> <properties> <project.build.sourceencod
      ing>utf-8</project.build.sourceencoding> </properties> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</ve rsion> <scope>test</scope> </dependency> <dependency> <groupid>org .apache.mahout</groupid> <artifactid>mahout-core</artifactid> <version>0.6</version> </dependency> <dependency>
        <groupId>org.apache.mahout</groupId> <artifactId>mahout-integration</artifactId> <version>0.6</version> </dependency> <dependency> <groupid>org.apache.mahou
    T</groupid> <artifactId>mahout-math</artifactId> <version>0.6</version> </dependency> <dependency> <groupId>org.apache.hadoop</groupId> <artifacti d>hadoop-core</artifactid> <version>0.20.204.0</version> </dependency> </de
 Pendencies> </project>

Save the Pom.xml file, and then enter the mvn clean install download dependency on the command line.

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.