if you use an external library for your new plugin, you should define this
library in plugins build.xml file.
Example: urlfilter-automaton plugin uses external "automaton-1.11-8.jar"
library. Its build.xml file is like:
<plugin
id="urlfilter-automaton"
name="Automaton URL Filter"
version="1.0.0"
provider-name="nutch.org">
<runtime>
<library name="urlfilter-automaton.jar">
<export name="*"/>
</library>
<library name="automaton-1.11-8.jar"/>
</runtime>
<requires>
<import plugin="nutch-extensionpoints"/>
<import plugin="lib-regex-filter"/>
</requires>
<extension id="org.apache.nutch.net.urlfilter.automaton"
name="Nutch Automaton URL Filter"
point="org.apache.nutch.net.URLFilter">
<implementation id="AutomatonURLFilter"
class="org.apache.nutch.urlfilter.automaton.AutomatonURLFilter"/>
</extension>
</plugin>
On Tue, Jul 9, 2013 at 12:28 PM, Sznajder ForMailingList <
[email protected]> wrote:
> I copy here the correction in bin/nutch I made.
>
> But, I suspect that it is not the right way to force Nutch to find the
> plugin jar...
>
>
> # add libs to CLASSPATH
> if $local; then
> for f in $NUTCH_HOME/lib/*.jar; do
> CLASSPATH=${CLASSPATH}:$f;
> done
> # local runtime
> # add plugins to classpath
> if [ -d "$NUTCH_HOME/plugins" ]; then
> * for f in $NUTCH_HOME/plugins/*/*.jar; do
> CLASSPATH=${CLASSPATH}:$f;
> done
> * CLASSPATH=${NUTCH_HOME}:${CLASSPATH}
> fi
> fi
>
>
> On Tue, Jul 9, 2013 at 11:48 AM, Sznajder ForMailingList <
> [email protected]> wrote:
>
> > Hi
> >
> > I wrote a plugin following the tutorial
> > http://wiki.apache.org/nutch/WritingPluginExample
> >
> > However, when launching it via ant call, I get the following exception:
> >
> > java.lang.RuntimeException:
> > org.apache.nutch.plugin.PluginRuntimeException:
> > java.lang.ClassNotFoundException:
> >
> >
> > I had a look at the runtime/local/plugins/ directory, and I see there the
> > created directory corresponding to this plugin.
> >
> > More strange, when I specifically add the created jar to the classpath,
> it
> > is running with no problem.
> >
> > I do no understand why it doesn't it find the jar with the usal bin/nutch
> > script.....
> >
> > Best regards
> >
> > Benjamin
> >
> > PS: When running from eclipse, it is running with no problem....
> >
>