Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

Error in POM.xml , please help

avatar

Hi ,

 

 

I am facing one issue on downloading hadoop jar files through pom.xml  ,Need a little help from you .

 

Below is the changes I made in pom.xml for adding  hadoop jar files

 

                <!-- Adding for Hadoop repositories -->

<repositories>

                                <repository>

                                                <id>maven-hadoop</id>

                                                <name>Hadoop Releases</name>

                                                <url>https://repository.cloudera.com/content/repositories/releases/</url>

                                </repository>

                                <repository>

                                                <id>cloudera-repos</id>

                                                <name>Cloudera Repos</name>

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

                                </repository>

                                <!-- Ended here -->

</repositories>

 

Under Dependencies, I added the below

 

<dependencies>

<dependency>

                <groupId>org.apache.hadoop</groupId>

                <artifactId>hadoop-client</artifactId>

                <version>2.0.0-cdh4.3.0</version>                       

</dependency>

</dependencies>

 

But still giving error in pom.xml as below

 

Missing artifact org.apache.hadoop:hadoop-client:jar:2.0.0-cdh4.3.0

 

Also tried with below dependency with SNAPSHOT

<dependencies>

<dependency>

                <groupId>org.apache.hadoop</groupId>

                <artifactId>hadoop-client</artifactId>

                <version>2.0.0-cdh4.3.0-SNAPSHOT</version>

</dependency>

</dependencies>           

 

I could see that the both  artifacts are available in cloudera repository

 

https://repository.cloudera.com/artifactory/libs-snapshot-local/org/apache/hadoop/hadoop-client/2.0....

 

Can you please throw some idea on what to do to get out of this error, so that my pom.xml will compile and download jar files.

 

I referred to below example as reference for configure my hadoop in pom.xml

 

http://blog.cloudera.com/blog/2012/12/how-to-run-a-mapreduce-job-in-cdh4/

 

Thanks

Rajasekhar

1 ACCEPTED SOLUTION

avatar
Expert Contributor

jdk.tools:jdk.tools (or com.sun:tools, or whatever you name it) is a JAR file that is distributed with JDK. Usually you add it to maven projects like this:

<dependency>
    <groupId>jdk.tools</groupId>
    <artifactId>jdk.tools</artifactId>
    <scope>system</scope>
    <systemPath>${JAVA_HOME}/../lib/tools.jar</systemPath>
</dependency>


Or, you can manually install tools.jar in the local repository using:

mvn install:install-file -DgroupId=jdk.tools -DartifactId=jdk.tools -Dpackaging=jar -Dversion=1.6 -Dfile=tools.jar -DgeneratePom=true

and then reference it like Cloudera did, using:

<dependency>
    <groupId>jdk.tools</groupId>
    <artifactId>jdk.tools</artifactId>
    <version>1.6</version>
</dependency>

Em Jay

View solution in original post

1 REPLY 1

avatar
Expert Contributor

jdk.tools:jdk.tools (or com.sun:tools, or whatever you name it) is a JAR file that is distributed with JDK. Usually you add it to maven projects like this:

<dependency>
    <groupId>jdk.tools</groupId>
    <artifactId>jdk.tools</artifactId>
    <scope>system</scope>
    <systemPath>${JAVA_HOME}/../lib/tools.jar</systemPath>
</dependency>


Or, you can manually install tools.jar in the local repository using:

mvn install:install-file -DgroupId=jdk.tools -DartifactId=jdk.tools -Dpackaging=jar -Dversion=1.6 -Dfile=tools.jar -DgeneratePom=true

and then reference it like Cloudera did, using:

<dependency>
    <groupId>jdk.tools</groupId>
    <artifactId>jdk.tools</artifactId>
    <version>1.6</version>
</dependency>

Em Jay