【问题标题】:Nutch - Could not load definitions from resource org/sonar/ant/antlib.xmlNutch - 无法从资源 org/sonar/ant/antlib.xml 加载定义
【发布时间】:2017-04-18 10:25:52
【问题描述】:

我正在通过官方指南学习Nutch。因此,当我在 bin 目录中运行 Ant 时,它会显示:

“无法从资源org/sonar/ant/antlib.xml 加载定义。它 找不到。”

我在google上花了很多时间来解决它,但我失败了。我的操作系统是 Ubuntu16.04。

【问题讨论】:

    标签: java ubuntu ant nutch


    【解决方案1】:

    尝试在build.xml评论这部分:

      <!-- ================================================================== -->
      <!-- SONAR targets                                                      -->
      <!-- ================================================================== -->
    
      <!-- Define the Sonar task if this hasn't been done in a common script -->
      <taskdef uri="antlib:org.sonar.ant" resource="org/sonar/ant/antlib.xml">
        <classpath path="${ant.library.dir}"/>
        <classpath path="${mysql.library.dir}"/>
      </taskdef>
    
      <!-- Add the target -->
      <target name="sonar" description="--> run SONAR analysis">
    
        <!-- list of mandatory source directories (required) -->
        <property name="sonar.sources" value="${src.dir}"/>
    
        <!-- list of properties (optional) -->
        <property name="sonar.projectName" value="Nutch Trunk 1.4 Sonar Analysis" />
        <property name="sonar.binaries" value="${build.dir}/classes" />
        <property name="sonar.binaries" value="${build.dir}/plugins" />
        <property name="sonar.tests" value="${test.src.dir}" />
    
        <sonar:sonar workDir="${base.dir}" key="org.apache.nutch:trunk" 
         version="1.4-SNAPSHOT" xmlns:sonar="antlib:org.sonar.ant"/>
      </target>
    

    这样,它应该可以工作。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-03-15
      • 2017-08-18
      • 1970-01-01
      • 1970-01-01
      • 2016-07-23
      相关资源
      最近更新 更多