Skip to content

armgit / nutch

Public Imported from GitHub
0

Apache Nutch is an extensible and scalable web crawler

NUTCH-586 - Add option to run compiled classes without job file.

Andrzej Bialeckica8be904e67c
diff --git a/CHANGES.txt b/CHANGES.txt
index e1a79979b..d7a3144af 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -176,6 +176,9 @@ Unreleased changes (1.0-dev)
60. NUTCH-581 - DistributedSearch does not update search servers added to
search-servers.txt on the fly. (Rohan Mehta via kubes)
+61. NUTCH-586 - Add option to run compiled classes without job file
+ (enis via ab)
+
Release 0.9 - 2007-04-02
1. Changed log4j confiquration to log to stdout on commandline
diff --git a/bin/nutch b/bin/nutch
index 797375ff8..1daac5649 100755
--- a/bin/nutch
+++ b/bin/nutch
@@ -30,7 +30,7 @@ done
# if no args specified, show usage
if [ $# = 0 ]; then
- echo "Usage: nutch COMMAND"
+ echo "Usage: nutch [-core] COMMAND"
echo "where COMMAND is one of:"
echo " crawl one-step crawler for intranets"
echo " readdb read / dump crawl db"
@@ -56,9 +56,20 @@ if [ $# = 0 ]; then
echo " or"
echo " CLASSNAME run the class named CLASSNAME"
echo "Most commands print help when invoked w/o parameters."
+ echo ""
+ echo "Expert: -core option is for developers only. It avoids building the job jar, "
+ echo " instead it simply includes classes compiled with ant compile-core. "
+ echo " NOTE: this works only for jobs executed in 'local' mode"
exit 1
fi
+IS_CORE=0
+#check for -core option
+if [ "$1" == "-core" ] ; then
+ IS_CORE=1
+ shift
+fi
+
# get arguments
COMMAND=$1
shift
@@ -99,17 +110,23 @@ IFS=
if [ -d "$NUTCH_HOME/build/plugins" ]; then
CLASSPATH=${CLASSPATH}:$NUTCH_HOME/build
fi
-for f in $NUTCH_HOME/build/nutch-*.job; do
- CLASSPATH=${CLASSPATH}:$f;
-done
if [ -d "$NUTCH_HOME/build/test/classes" ]; then
CLASSPATH=${CLASSPATH}:$NUTCH_HOME/build/test/classes
fi
-# for releases, add Nutch job to CLASSPATH
-for f in $NUTCH_HOME/nutch-*.job; do
- CLASSPATH=${CLASSPATH}:$f;
-done
+if [ $IS_CORE == 0 ]
+then
+ for f in $NUTCH_HOME/build/nutch-*.job; do
+ CLASSPATH=${CLASSPATH}:$f;
+ done
+
+ # for releases, add Nutch job to CLASSPATH
+ for f in $NUTCH_HOME/nutch-*.job; do
+ CLASSPATH=${CLASSPATH}:$f;
+ done
+else
+ CLASSPATH=${CLASSPATH}:$NUTCH_HOME/build/classes
+fi
# add plugins to classpath
if [ -d "$NUTCH_HOME/plugins" ]; then