tomwhite / hadoop-book

Example source code accompanying O'Reilly's "Hadoop: The Definitive Guide" by Tom White

Home Page:http://www.hadoopbook.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Maven cannot resolve dependencies

hollow opened this issue · comments

Hi,

i've just started reading the pre-release of the third edition and wanted to run the example code, but maven fails with the following error:

[ERROR] Failed to execute goal on project ch05: Could not resolve dependencies for project com.hadoopbook:ch05:jar:3.0: The following artifacts could not be resolved: org.apache.hadoop:hadoop-common:jar:1.0.1, org.apache.hadoop:hadoop-mapreduce-client-common:jar:1.0.1, org.apache.hadoop:hadoop-mapreduce-client-core:jar:1.0.1: Could not find artifact org.apache.hadoop:hadoop-common:jar:1.0.1 in apache.releases (https://repository.apache.org/content/repositories/releases/) -> [Help 1]

I'm not familiar with maven so any help would be very much appreciated!

Yup. Same issue.

Adding hadoop dependency explicitly will probably resolve it.

<dependency>
    <groupId>org.apache.hadoop</groupId>
    <artifactId>hadoop-core</artifactId>
    <version>1.0.0</version>
</dependency>

It seems that it is looking for the jar file artifacts that would have been built from the other chapters in the apache maven repository. I'm not a maven expert either, but definitely a bug in how the author has declared the dependencies.

quite sad that there is no response from the author after three months ... come on ... we even paid for it!

infynyxx's suggestion solve the problem, if you add that dependency in the pom.xml in ch02 file directory. It seems like mvn don't know where to find the hadoop-core lib. I am new to mvn and hadoop. Can anyone point me in the right direction?