1 、安装ant(省略)
目前官方2.x只提供了源码下载,不再提供编译的版本,需要用户自己去编译。
2 下载nutch
2.1 下载地址:
http://www.apache.org/dyn/closer.lua/nutch/2.2.1/apache-nutch-2.2.1-src.tar.gz
tar -zxvf apache-nutch-2.2.1-bin.tar.gz
2.2 下载sonar的jar包,将jar包放到apache-nutch-2.2.1目录下
修改build.xml,引入上面添加的jar包:
<!-- 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}" />
<classpath><fileset dir="." includes="sonar*.jar" /></classpath>
</taskdef>
2.3 nutch编译安装时需要从maven资源库下载jar包,将其修改
vi apache-nutch-2.2.1/ivy/ivy.setting.xml
<property name="repo.maven.org" value="http://repo1.maven.org/maven2/" override="false"/>
将value=http://repo1.maven.org/maven2/修改成value= http://repo2