我正在尝试实现app =>使用Hadoop从天气数据中找到最高温度(来自Tom White的书籍Hadoop:Definitive Guide(第3版))。我已经下载并安装了Hadoop 2.6.0 我应该添加哪些依赖项才能使其正常工作?
答案 0 :(得分:14)
一步一步:
添加cloudera your settings.xml(在$ {HOME} /。m2 / settings.xml下)以访问hadoop依赖项
<repository>
<id>cloudera</id>
<url>https://repository.cloudera.com/artifactory/cloudera-repos</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
将hadoop依赖项添加到您的pom.xml。
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-hdfs</artifactId>
<version>2.6.0</version>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-auth</artifactId>
<version>2.6.0</version>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-common</artifactId>
<version>2.6.0</version>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-core</artifactId>
<version>1.2.1</version>
</dependency>
然后尝试&#34; mvn clean install&#34;命令进入包含pom.xml文件的项目文件夹。