1

最近想修改nutch的代码(Fetcher.java),把原始的html页面保存到Hbase中。我已将项目导入 Eclipse。但我不熟悉 ant、ivy、maven 或 buildfile。

如何将Hbase库jar文件添加到项目中,以便我可以使用ant来构建它?

4

3 回答 3

0

将 hbase jar 添加到 eclipse 项目的 buildpath 中,并确保将 jar 复制到 nutch 内的 lib 文件夹中。

于 2012-05-01T11:31:04.220 回答
0

最终,我通过在 ivy.xml 文件中添加依赖项声明做到了。并且库描述可以在http://search.maven.org/中找到。然后只需在命令 shell 中运行 ant。(就我而言,在 Eclipse 中运行 ant 不起作用。我不知道为什么。)
这个问题可能是微不足道的,但我希望这对像我这样的初学者有所帮助。

于 2012-05-01T16:19:01.737 回答
0

让我详细介绍一下:

将以下行添加到 Nutch 的 ivysettings.xml 中:

<module organisation="org.apache.giraph" name=".*" resolver="internal"/>

将以下行添加到 Nutch 的 ivy.xml 中:

    <dependency org="org.apache.giraph" name="giraph" rev="1.1.0-SNAPSHOT"
      conf="*->default" />
    <dependency org="org.apache.giraph" name="giraph-hbase" rev="1.1.0-SNAPSHOT"
      conf="*->default" />
    <dependency org="org.apache.giraph" name="giraph-examples" rev="1.1.0-SNAPSHOT"
      conf="*->default" />

现在在 .ivy2 子文件夹下创建 put jar 文件:

/home/emre/.ivy2/local/org.apache.giraph/giraph/1.1.0-SNAPSHOT/jars/giraph.jar
/home/emre/.ivy2/local/org.apache.giraph/giraph-hbase/1.1.0-SNAPSHOT/jars/giraph-hbase.jar
/home/emre/.ivy2/local/org.apache.giraph/giraph-examples/1.1.0-SNAPSHOT/jars/giraph-examples.jar  
于 2013-06-28T13:35:45.313 回答