Setting up Nutch: war file


You need to build war file with:

ant war

However, you may get:

java.lang.ClassNotFoundException: org.apache.tools.ant.taskdefs.optional.TraXLiaison

Your ant may not be installed right. Just download binaries (not use yum) from ant.apache.org set classpath to the jars within, e.g.

export CLASSPATH=/opt/ant/apache-ant-1.8.2/lib/ant-antlr.jar:/opt/ant/apache-ant-1.8.2/li
b/ant-apache-bcel.jar:/opt/ant/apache-ant-1.8.2/lib/ant-apache-bsf.jar:/opt/ant/apache-an
t-1.8.2/lib/ant-apache-log4j.jar:/opt/ant/apache-ant-1.8.2/lib/ant-apache-oro.jar:/opt/an
t/apache-ant-1.8.2/lib/ant-apache-regexp.jar:/opt/ant/apache-ant-1.8.2/lib/ant-apache-res
olver.jar:/opt/ant/apache-ant-1.8.2/lib/ant-apache-xalan2.jar:/opt/ant/apache-ant-1.8.2/l
ib/ant-commons-logging.jar:/opt/ant/apache-ant-1.8.2/lib/ant-commons-net.jar:/opt/ant/apa
che-ant-1.8.2/lib/ant-jai.jar:/opt/ant/apache-ant-1.8.2/lib/ant-javamail.jar:/opt/ant/apa
che-ant-1.8.2/lib/ant-jdepend.jar:/opt/ant/apache-ant-1.8.2/lib/ant-jmf.jar:/opt/ant/apac
he-ant-1.8.2/lib/ant-jsch.jar:/opt/ant/apache-ant-1.8.2/lib/ant-junit4.jar:/opt/ant/apach
e-ant-1.8.2/lib/ant-junit.jar:/opt/ant/apache-ant-1.8.2/lib/ant-launcher.jar:/opt/ant/apa
che-ant-1.8.2/lib/ant-netrexx.jar:/opt/ant/apache-ant-1.8.2/lib/ant-swing.jar:/opt/ant/ap
ache-ant-1.8.2/lib/ant-testutil.jar:$CLASSPATH

AND make sure ANT_HOME is set, i.e.:
export ANT_HOME=/opt/ant/apache-ant-1.8.2

Leave a Comment