Apache Nutch is an extensible and scalable web crawler
NUTCH-843 Separate the build and runtime environments.
Andrzej Bialeckid92d73173840
diff --git a/CHANGES.txt b/CHANGES.txtindex 2d49e3f02..9270e2e96 100644--- a/CHANGES.txt+++ b/CHANGES.txt@@ -2,6 +2,8 @@ Nutch Change LogRelease 2.0 - Current Development+* NUTCH-843 Separate the build and runtime environments (ab)+* NUTCH-821 Use ivy in nutch builds (Enis Soztutar, jnioche)* NUTCH-838 Add timing information to all Tool classes (Jeroen van Vianen, mattmann)diff --git a/build.xml b/build.xmlindex 8de70d880..5ca743860 100644--- a/build.xml+++ b/build.xml@@ -15,7 +15,7 @@See the License for the specific language governing permissions andlimitations under the License.-->-<project name="Nutch" default="job" xmlns:ivy="antlib:org.apache.ivy.ant">+<project name="Nutch" default="runtime" xmlns:ivy="antlib:org.apache.ivy.ant"><!-- Load all the default properties, and any the user wants --><!-- to contribute (without having to type -D or edit this file -->@@ -143,6 +143,39 @@</jar></target>+ <target name="runtime" depends="jar, job">+ <mkdir dir="${runtime.dir}"/>+ <mkdir dir="${runtime.local}"/>+ <mkdir dir="${runtime.deploy}"/>+ <!-- deploy area -->+ <copy file="${build.dir}/${final.name}.job"+ todir="${runtime.deploy}"/>+ <copy todir="${runtime.deploy}/bin">+ <fileset dir="src/bin"/>+ </copy>+ <chmod perm="ugo+x" type="file">+ <fileset dir="${runtime.deploy}/bin"/>+ </chmod>+ <!-- local area -->+ <copy file="${build.dir}/${final.name}.jar"+ todir="${runtime.local}/lib"/>+ <copy todir="${runtime.local}/conf">+ <fileset dir="conf"/>+ </copy>+ <copy todir="${runtime.local}/bin">+ <fileset dir="src/bin"/>+ </copy>+ <chmod perm="ugo+x" type="file">+ <fileset dir="${runtime.deploy}/bin"/>+ </chmod>+ <copy todir="${runtime.local}/lib">+ <fileset dir="${build.dir}/lib"/>+ </copy>+ <copy todir="${runtime.local}/plugins">+ <fileset dir="${build.dir}/plugins"/>+ </copy>+ </target>+<!-- ================================================================== --><!-- Compile test code --><!-- ================================================================== -->@@ -495,7 +528,7 @@<!-- ================================================================== --><!-- target: clean =================================================== -->- <target name="clean" depends="clean-build, clean-lib, clean-dist" description="--> clean the project" />+ <target name="clean" depends="clean-build, clean-lib, clean-dist, clean-runtime" description="--> clean the project" /><!-- target: clean-local ============================================= --><target name="clean-local" depends=""@@ -524,6 +557,10 @@<ivy:cleancache /></target>+ <target name="clean-runtime" description="--> clean the project runtime area">+ <delete includeemptydirs="true" dir="${runtime.dir}"/>+ </target>+<!-- ================================================================== --><!-- RAT targets --><!-- ================================================================== -->diff --git a/default.properties b/default.propertiesindex afb90859f..d4faad1ee 100644--- a/default.properties+++ b/default.properties@@ -24,8 +24,6 @@ test.build.data = ${test.build.dir}/datatest.build.classes = ${test.build.dir}/classestest.build.javadoc = ${test.build.dir}/docs/api-javacc.home=/usr/java/javacc-# Proxy Host and Port to use for building JavaDocjavadoc.proxy.host=-J-DproxyHost=javadoc.proxy.port=-J-DproxyPort=@@ -42,6 +40,10 @@ javac.optimize=onjavac.deprecation=offjavac.version= 1.6+runtime.dir=./runtime+runtime.deploy=${runtime.dir}/deploy+runtime.local=${runtime.dir}/local+ivy.version=2.1.0ivy.dir=${basedir}/ivyivy.file=${ivy.dir}/ivy.xmldiff --git a/bin/nutch b/src/bin/nutchsimilarity index 88%rename from bin/nutchrename to src/bin/nutchindex 770346d75..ab5167933 100755--- a/bin/nutch+++ b/src/bin/nutch@@ -64,13 +64,6 @@ if [ $# = 0 ]; thenexit 1fi-IS_CORE=0-#check for -core option-if [ "$1" == "-core" ] ; then- IS_CORE=1- shift-fi-# get argumentsCOMMAND=$1shift@@ -107,42 +100,26 @@ CLASSPATH=${CLASSPATH}:$JAVA_HOME/lib/tools.jar# so that filenames w/ spaces are handled correctly in loops belowIFS=-# for developers, add plugins, job & test code to CLASSPATH-if [ -d "$NUTCH_HOME/build/plugins" ]; then- CLASSPATH=${CLASSPATH}:$NUTCH_HOME/build-fi-if [ -d "$NUTCH_HOME/build/test/classes" ]; then- CLASSPATH=${CLASSPATH}:$NUTCH_HOME/build/test/classes-fi--if [ $IS_CORE == 0 ]-then- for f in $NUTCH_HOME/build/nutch-*.job; do+# add libs to CLASSPATH+for f in $NUTCH_HOME/lib/*.jar; do+ CLASSPATH=${CLASSPATH}:$f;+done+if [ -f ${NUTCH_HOME}/nutch-*.job ]; then+ # distributed runtime+ for f in $NUTCH_HOME/nutch-*.job; doCLASSPATH=${CLASSPATH}:$f;done-- # for releases, add Nutch job to CLASSPATH- for f in $NUTCH_HOME/nutch-*.job; do+ for f in $NUTCH_HOME/hadoop-*.jar; doCLASSPATH=${CLASSPATH}:$f;doneelse- CLASSPATH=${CLASSPATH}:$NUTCH_HOME/build/classes-fi--# add plugins to classpath-if [ -d "$NUTCH_HOME/plugins" ]; then- CLASSPATH=${NUTCH_HOME}:${CLASSPATH}+ # local runtime+ # add plugins to classpath+ if [ -d "$NUTCH_HOME/plugins" ]; then+ CLASSPATH=${NUTCH_HOME}:${CLASSPATH}+ fifi-# add libs to CLASSPATH-for f in $NUTCH_HOME/lib/*.jar; do- CLASSPATH=${CLASSPATH}:$f;-done--for f in $NUTCH_HOME/lib/jsp-2.1/*.jar; do- CLASSPATH=${CLASSPATH}:$f;-done-# cygwin path translationif $cygwin; thenCLASSPATH=`cygpath -p -w "$CLASSPATH"`@@ -150,13 +127,9 @@ fi# setup 'java.library.path' for native-hadoop code if necessaryJAVA_LIBRARY_PATH=''-if [ -d "${NUTCH_HOME}/build/native" -o -d "${NUTCH_HOME}/lib/native" ]; then+if [ -d "${NUTCH_HOME}/lib/native" ]; thenJAVA_PLATFORM=`CLASSPATH=${CLASSPATH} ${JAVA} org.apache.hadoop.util.PlatformName | sed -e 's/ /_/g'`- if [ -d "$NUTCH_HOME/build/native" ]; then- JAVA_LIBRARY_PATH=${HADOOP_HOME}/build/native/${JAVA_PLATFORM}/lib- fi-if [ -d "${NUTCH_HOME}/lib/native" ]; thenif [ "x$JAVA_LIBRARY_PATH" != "x" ]; thenJAVA_LIBRARY_PATH=${JAVA_LIBRARY_PATH}:${NUTCH_HOME}/lib/native/${JAVA_PLATFORM}