Not finding plugins on the classpath

54 views
Skip to first unread message

Mitchell Hashimoto

unread,
Apr 11, 2011, 5:57:23 AM4/11/11
to jspf
Hm, this seems like it should work for me. I'm instantiating the
plugin manager from Scala like so:

val pm = PluginManagerFactory.createPluginManager()
pm.addPluginsFrom(ClassURI.CLASSPATH)

And then in the same project I have a plugin implementation:

@PluginImplementation
class InitImpl extends CommandPlugin {
val name = "init"
val subcommand = Init
}

But when I dump all the available plugins, the InitImpl one isn't
listed:

println(manager.getPluginRegistry().getAllPlugins())

Is there something I'm doing wrong? Can JSPF not find plugins in the
same JAR as the executing application?

Best,
Mitchell

Ralf

unread,
Apr 25, 2011, 5:19:06 AM4/25/11
to jspf


Unfortunately I haven't been playing with Scala recently, so I don't
know if the latest JSPF version actually works with it. However, you
might try to add plugins like this:

pm.addPluginsFrom(ClassURI.CLASSPATH, new OptionReportAfter());

and check what the report says, accessing getPluginRegistry() is not
recommended. Also check if InitImpl is a public class. If you add
plugins with ClassURI.CLASSPATH, everything the application sees
should be found by JSPF as well (except it is blacklisted, see the
other posts in the forum about this).

Kind regards
Ralf
Reply all
Reply to author
Forward
0 new messages