mavenycsb

use maven to compile ycsb


I want to run ycsb to test hbase, and I referred to this blog: http://cloudfront.blogspot.in/2013/02/how-to-benchmark-hbase-using-ycsb.html#.Uy-J2XiLe1F

But when I changed pox.xml in /ycsb/hbase, I try to build ycsb using maven, then I got this error:

[ERROR] Failed to execute goal on project hbase-binding: Could not resolve dependencies for project com.yahoo.ycsb:hbase-binding:jar:0.1.4: Failure to find org.apache.hadoop:hadoop-core:jar:2.3.0 in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]

I've already successfully installed hadoop-2.3.0 and hbase-0.94.17. Here is the pom.xml I use:

<?xml version="1.0" encoding="UTF-8"?>
<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>
  <parent>
    <groupId>com.yahoo.ycsb</groupId>
    <artifactId>root</artifactId>
    <version>0.1.4</version>
  </parent>

  <artifactId>hbase-binding</artifactId>
  <name>HBase DB Binding</name>

  <dependencies>
    <dependency>
      <groupId>org.apache.hbase</groupId>
      <artifactId>hbase</artifactId>
      <version>0.94.17</version>
    </dependency>
    <dependency>
      <groupId>org.apache.hadoop</groupId>
      <artifactId>hadoop-core</artifactId>
      <version>2.3.0</version>
    </dependency>
  </dependencies>

  <build>
    <plugins>
     <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <version>${maven.assembly.version}</version>
        <configuration>
          <descriptorRefs>
            <descriptorRef>jar-with-dependencies</descriptorRef>
          </descriptorRefs>
          <appendAssemblyId>false</appendAssemblyId>
        </configuration>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

</project>

Any help would be appreciated, thanks!


Solution

  • The problem is sometimes maven can't get the jars for hbase & hadoop. You will have to download them manually and add it to classpath.

    Source: Experimenting with YCSB extensively :)