2016-11-16 40 views
0

我試圖實施星火應用程序字計數,但我得到一個錯誤,當我加入Hadoop的共同依賴性:Maven依賴:不存在的庫「Hadoop的共同-2.6.0-cdh5.9.0.jar」

'Maven Dependencies' references non existing library '/root/.m2/repository/org/apache/hadoop/hadoop-common/2.6.0-cdh5.9.0/hadoop-common-2.6.0-cdh5.9.0.jar' 

,這我的pom.xml:

<dependencies> 
<!-- https://mvnrepository.com/artifact/org.scala-lang/scala-library --> 
<dependency> 
    <groupId>org.scala-lang</groupId> 
    <artifactId>scala-library</artifactId> 
    <version>2.10.6</version> 
</dependency> 
<dependency> 
    <groupId>org.apache.hadoop</groupId> 
    <artifactId>hadoop-common</artifactId> 
    <version>2.6.0-cdh5.9.0</version> 
</dependency> 
    <dependency> 
     <groupId>junit</groupId> 
     <artifactId>junit</artifactId> 
     <version>3.8.1</version> 
     <scope>test</scope> 
    </dependency> 
    </dependencies> 

我haddop版本是2.6.0 - cdh5.9.0
請任何幫助!

回答

2

更換

<dependency> 
    <groupId>org.apache.hadoop</groupId> 
    <artifactId>hadoop-common</artifactId> 
    <version>2.6.0-cdh5.9.0</version> 
</dependency> 

<dependency> 
    <groupId>org.apache.hadoop</groupId> 
    <artifactId>hadoop-common</artifactId> 
    <version>2.6.0</version> 
</dependency> 

或使用外部罐子,並添加http://repo.spring.io/libs-milestone/org/apache/hadoop/hadoop-common/2.6.0-cdh5.9.0/hadoop-common-2.6.0-cdh5.9.0.jar

希望這有助於

+0

是我試過的外部罐子,它做工精細,但爲什麼它不會自動與Maven一起工作。當我在/ root/.m2/repository/org/apache/hadoop/hadoop-common /中看到''我找不到** hadoop-common-2.6.0-cdh5.9.0.jar **。 –

+0

hadoop版本2.6.0-cdh5.9.0在中央倉庫中無效。檢查此http://search.maven.org/#search|gav|1|g%3A%22org.apache.hadoop%22%20AND%20a%3A%22hadoop-common%22 –

+0

謝謝,但我有一個錯誤當我運行我的程序:'java.lang.ClassNotFoundException:org.apache.commons.configuration.Configuration' –