Gibbs
Gibbs

Reputation: 22956

maven: dependency compilation error

My pom.xml

 <?xml version="1.0" encoding="UTF-8"?>
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org XMLSchema-instance"
 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0   http://maven.apache.org/v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.myorg.write</groupId>
<artifactId>simple-client</artifactId>
<packaging>jar</packaging>
<version>0.1.0</version>

<repositories>
 <repository>
  <id>cloudera</id>
  <url>https://repository.cloudera.com/artifactory/cloudera-repos/</url>
 </repository>
</repositories>

<dependencies>
   <dependency>
            <groupId>org.apache.hadoop</groupId>
            <artifactId>hadoop-client</artifactId>
            <version>2.0.0-mrl-cdh4.0.0</version>
    </dependency>
</dependencies>

<build>
  <plugins>
   <plugin>
       <groupId>org.codehaus.mojo</groupId>
       <artifactId>exec-maven-plugin</artifactId>
       <version>1.3.2</version>
       <configuration>
        <mainClass>org.myorg.Write</mainClass>
       </configuration>
   </plugin>
   <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <source>1.7</source>
          <target>1.7</target>
     </configuration>
  </plugin>
  </plugins>
 </build>
  </project>

I am referring cdh site

I compiled it using

mvn -e clean dependency:copy-dependencies package

I got the following error

[ERROR] Failed to execute goal on project simple-client: Could not resolve 
dependencies for project org.myorg.write:simple-client:jar:0.1.0: Failur\
e to find org.apache.hadoop:hadoop-client:jar:2.0.0-mrl-cdh4.0.0 in 
https://repository.cloudera.com/artifactory/cloudera-repos/ was cached in 
the local repository, resolution will not be reattempted until the update 
interval of cloudera has elapsed or updates are forced -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute 
goal on project simple-client: Could not resolve dependencies for project
org.myorg.write:simple-client:jar:0.1.0: Failure to find 
org.apache.hadoop:hadoop-client:jar:2.0.0-mrl-cdh4.0.0 in 
https://repository.cloudera.com /artifactory/cloudera-repos/ was cached in  
the local repository, resolution will not be reattempted until the update 
interval of cloudera has elapsed or updates are forced

Dependency cannot be resolved. I checked this site

I can see org.apache.hadoop:hadoop-client:jar:2.0.0-mrl-cdh4.0.0 in the above site. But what jar is in between the above statement? Does it cause the error? How do i resolve this?

I am trying to talk to hadoop which is runnin in another machine through java.

Upvotes: 1

Views: 437

Answers (2)

vincent
vincent

Reputation: 1234

There's a typo in your pom. The dependency "2.0.0-mrl-cdh4.0.0" should be replaced by "2.0.0-mr1-cdh4.4.0". You could check this on the cloudera repository.

Upvotes: 1

khmarbaise
khmarbaise

Reputation: 97359

The problem is that your version <version>2.0.0-mrl-cdh4.0.0</version> uses a l letter instead of 1. I've checked the cloudera repository which simply does not contain a version 2.0.0-mrl-cdh4.0.0 but it contains a version 2.0.0-mr1-cdh4.0.0.

Upvotes: 1

Related Questions