idea配置ant版本_Nutch 2.4 相关配置问题

系统 ubuntu 18.04

Nutch 2.4

Ant 1.10

JDK 1.8

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

在用ant编译Nutch时出现上述情况,显示缺少相关的包。

1.下载sonar-ant-task-2.1.jar,并拷贝到nutch解压目录的lib文件夹下

2.修改nutch文件夹下的build.xml文件,引入上面的jar包

<taskdef uri="antlib:org.sonar.ant" resource="org/sonar/ant/antlib.xml">
  <classpath path="${ant.library.dir}" />
  <classpath path="${mysql.library.dir}" />
  <classpath><fileset dir="lib/" includes="sonar*.jar" /></classpath>
 </taskdef>
  • JDK 版本过高 或过低

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by
org.apache.hadoop.security.authentication.util.KerberosUtil
(file:/C:/cygwin64/home/apache-nutch-1.15/lib/hadoop-auth-2.7.4.jar) to
method sun.security.krb5.Config.getInstance()
WARNING: Please consider reporting this to the maintainers of
org.apache.hadoop.security.authentication.util.KerberosUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal
reflective access operations
WARNING: All illegal access operations will be denied in a future
release

建议使用JDK 1.8

  • Maven 仓库加载失败,停在下面语句,使用阿里镜像仓库

0a16a7ec835f0af14b222ef7cea75a46.png

编辑 ivy/ivysettings.xml 文件,替换较快的 ivy 仓库:

[devalone@nutch apache-nutch-1.14]$ vi ivy/ivysettings.xml

Nutch 的 ivysettings.xml 配置了 3 个 maven 模块仓库:

       <property name="Nexus Repository Manager"
        value="Central Repository:"
        override="false"/>
      <property name="repo.maven.org"
        value="http://repo1.maven.org/maven2/"
        override="false"/>
      <property name="Nexus Repository Manager"
        value="Index of /repositories/snapshots"
        override="false"/>

将这 3 个仓库替换为较快的仓库,

示例:Nexus Repository Manager 将这 3 个仓库替换为较快的仓库,示例:

http://maven.aliyun.com/nexus/content/groups/public/
http://maven.aliyun.com/nexus/content/repositories/central/
http://maven.aliyun.com/nexus/content/repositories/apache-snapshots/
走进 Apache Nutch (v1.14)​blog.csdn.net
  • nutch 要求在运行前至少要配置 http.agent.name 属性。因此打开 conf/nutch-site.xml 文件,配置类似如下的内容:

[devalone@nutch nutch]$ vi conf/nutch-site.xml

    <property>
     <name>http.agent.name</name>
     <value>My Nutch Spider</value>
    </property>

该属性值随便设置一个合理的字符串,只要不是空串或空白串就好。

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值