ant nutch mysql_ant-ANT编译nutch时失败,请问大神们这是什么原因

展开全部

前提条件:配置ant

1. 下载nutch(例如:我62616964757a686964616fe4b893e5b19e31333339666132的是apache-nutch-2.2.1-src.tar.gz)

解压,重命名nutch文件夹(命名为nutch),然后移动文件夹到/home文件夹下

2. 编译nutch

cd nutch

ant

2.1 你可能会遇到这种错误:

Trying to override old definition of task javac

[taskdef] Could not load definitions from resource org/sonar/ant/antlib.xml. It could not be found.

ivy-probe-antlib:

ivy-download:

[taskdef] Could not load definitions from resource org/sonar/ant/antlib.xml. It could not be found.

原因:缺少相应的jar文件

解决方法:

(1)下载sonar-ant-task-2.1.jar,并放到nutch文件夹目录下

(2)修改build.xml文件,从而引入这个新的jar

//找到相应的地方,增加多出的内容即可。

2.2 编译时间过长

nutch使用ivy进行构建,故编译时间长。如果时间过长,可使用该办法解决。

修改该文件:ivy/ivysettings.xml

替换

2.3 编译之后的目录:

233c6302f5a8cebd28d25affea4da8ce.png

3. 修改nutch配置文件

Nutch2.x版本存储采用Gora访问Cassandra、HBase、Accumulo、Avro等,需要在该文件中制定Gora属性。

3.1修改 conf/nutch-site.xml

storage.data.store.class

org.apache.gora.hbase.store.HBaseStore

Default class for storing data

3.2 修改 ivy/ivy.xml

3.3 修改 conf/gora.properties

gora.datastore.default=org.apache.gora.hbase.store.HBaseStore

配置nutch

(nutch文件夹已在/home目录下)

1. 修改系统环境变量

sudo gedit /etc/profile

//增加

#set nutch

export PATH=/home/nutch/runtime/local/bin:$PATH

2. 测试(nutch/runtime/local/bin中./nutch  &  ./crawl)

9312ffb80bba12657e7a2b4d0624026e.png

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值