I'm trying to build a simple Hadoop word count application. I have the following pom.xml file:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>wpmcn</groupId> <artifactId>WordCountTestAdapter</artifactId> <packaging>jar</packaging> <version>1.0-SNAPSHOT</version> <name>WordCountTestAdapter</name> <url>http://maven.apache.org</url> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> <dependency> <groupId>org.apache.hadoop</groupId> <artifactId>hadoop</artifactId> <version>0.22.0</version> <type>POM</type> </dependency> </dependencies> </project> When I run "mvn install" I see the following error: [ERROR] Failed to execute goal on project WordCountTestAdapter: Could not resolve dependencies for project wpmcn:WordCountTestAdapter:jar:1.0-SNAPSHOT: Could not find artifact org.apache.hadoop:hadoop:POM:0.22.0 in central ( http://repo1.maven.org/maven2) -> [Help 1] I've tried various different things in the hadoop entry to no avail. This is a vanilla Maven 3 install which works fine for building simple non-Hadoop Hello World applications, and I'm a Maven newbie so I may be missing something obvious. Can someone tell me what I'm doing wrong or direct me to a pom.xml that builds a simple Hadoop application? On Fri, Aug 12, 2011 at 2:47 PM, Luke Lu <[email protected]> wrote: > Pre-0.21 (sustaining releases, large-scale tested) hadoop: > <dependency> > <groupId>org.apache.hadoop</groupId> > <artifactId>hadoop-core</artifactId> > <version>0.20.203.0</version> > </dependency> > > Pre-0.23 (small scale tested) hadoop: > <dependency> > <groupId>org.apache.hadoop</groupId> > <artifactId>hadoop-mapred</artifactId> > <version>...</version> > </dependency> > > Trunk (currently targeting 0.23.0, large-scale tested) hadoop WILL be: > <dependency> > <groupId>org.apache.hadoop</groupId> > <artifactId>hadoop-mapreduce</artifactId> > <version>...</version> > </dependency> > > On Fri, Aug 12, 2011 at 2:20 PM, W.P. McNeill <[email protected]> wrote: > > I'm building a Hadoop project using Maven. I want to add > > Maven dependencies to my project. What do I do? > > > > I think the answer is I add a <dependency></dependency> section to my > .POM > > file, but I'm not sure what the contents of this section (groupId, > > artifactId etc.) should be. Googling does not turn up a clear answer. Is > > there a canonical Hadoop Maven dependency specification? > > >
