Build Hadoop projects with Maven

Source: Internet
Author: User

Environment:eclipse-jee-mars-2-win32-x86_64 (Maven plugin comes with)

1.maven Downloads

Here with the Apache-maven-3.2.2-bin.tar example,

Specific download link: http://pan.baidu.com/s/1geRAykj Password: EGCT

2. Configure environment variables under Windows: Maven_home and Path

  

  

3.cmd, mvn-v Check whether the installation is successful

  

4. Configuring Maven in Eclipse

Configuring the MAVEN configuration file path in Eclipse's repository of MAVEN's jar library is configured by default on the C drive, in order to save space on the system disk, the jar can be configured on a different disk and needs to be modified

  

  Then in eclipse, Windows--preferences--maven--user settings is set up as follows:

  

5. Click Add, installation, Preference, Windows----

  

6.Eclipse Configure Hadoop plug-ins and Hadoop Eclipse plug-ins (under 64-bit Windows systems)

Hadoop-2.2.0-x64.tar

Link: Http://pan.baidu.com/s/1o83VNnW Password: CKNP

hadoop-eclipse-plugin-2.2.0

Link: http://pan.baidu.com/s/1jIRK5E2 Password: RCLF


  6 (1) first put hadoop-eclipse-plugin-2.2.0 into D:\software_hadoop\eclipse-jee-mars-2-win32-x86_64\eclipse\plugins Next, restart Eclipse

  

  6 (2) Import hadoop2.2.0

  

Create Maven Handoop project in 7.ECLIPSP

  

  

  

  

Configuring the Hadoop jar package in a 8.Maven pom.xml file

1 <Projectxmlns= "http://maven.apache.org/POM/4.0.0"Xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance"2 xsi:schemalocation= "http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">3   <modelversion>4.0.0</modelversion>4 5   <groupId>Com.chynn.dashuju</groupId>6   <Artifactid>Recommend</Artifactid>7   <version>6.1.0-snapshot</version>8   <Packaging>Jar</Packaging>9 Ten   <name>Recommend</name> One   <URL>http://maven.apache.org</URL> A  -   <Properties> -     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> the   </Properties> -  -   <Dependencies> -     <Dependency> +       <groupId>Junit</groupId> -       <Artifactid>Junit</Artifactid> +       <version>3.8.1</version> A       <Scope>Test</Scope> at     </Dependency> -     <Dependency> -         <groupId>Org.apache.hadoop</groupId> -         <Artifactid>Hadoop-client</Artifactid> -         <version>2.2.0</version> -     </Dependency> in     <Dependency> -         <groupId>Org.apache.hadoop</groupId> to         <Artifactid>Hadoop-common</Artifactid> +         <version>2.2.0</version> -     </Dependency> the     <Dependency> *         <groupId>Org.apache.hadoop</groupId> $         <Artifactid>Hadoop-hdfs</Artifactid>Panax Notoginseng         <version>2.2.0</version> -     </Dependency> the     <Dependency> +         <groupId>Org.apache.hbase</groupId> A         <Artifactid>Hbase-server</Artifactid> the         <version>0.98.3-hadoop2</version> +         <Exclusions> -             <exclusion> $                 <Artifactid>Hadoop-common</Artifactid> $                 <groupId>Org.apache.hadoop</groupId> -             </exclusion> -         </Exclusions> the     </Dependency> -     <Dependency>Wuyi         <groupId>Org.apache.hbase</groupId> the         <Artifactid>Hbase-client</Artifactid> -         <version>0.98.3-hadoop2</version> Wu         <Exclusions> -             <exclusion> About                 <Artifactid>Hadoop-common</Artifactid> $                 <groupId>Org.apache.hadoop</groupId> -             </exclusion> -         </Exclusions> -     </Dependency> A     <Dependency> +         <groupId>Jdk.tools</groupId> the         <Artifactid>Jdk.tools</Artifactid> -         <version>1.7</version> $         <Scope>System</Scope> the         <Systempath>${java_home}/lib/tools.jar</Systempath> the     </Dependency> the   </Dependencies> the </Project>

9. Basic completion

Build Hadoop projects with Maven

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.