powered by Jive Software

Help building & deploying a plugin

Hi all

I’m quite new to developing plugins for Openfire. I’ve been reading all documents and searched in the forums, and up to now I’ve managed to set up openfire from SVN, and start the server. I can also deploy the existing plugins from the checked-out version of openfire, with the ant-build script that builds all the plugins existent in the openfire directory (ant-build “plugins”).

So the problem comes here, I want to modify one of the plugins to add some more features, so I downloaded de sources and created a project in eclipse from those sources, and the only step I haven’t found is how to run the plugin, or how to use the ant-build script called “plugin” to build the plugin and create de jar file. I know this may be kind of obvious for some of you, but I’m really haven’t found any related thread or article.

Thanks in advance.

Hi Lizaro,

I’m not a Java programmer but managet to modify UserService Plugin. After You successfully compile plugin just put jar file in plugins directory of OpenFire server.

You’re right, but I thought there was a straight way of runnning and compiling the plugin through the ant build script, that would be quite more productive than creating jar file, on and on, and copying it to the plugins directory.

I’m quite confident that it’s possible but I have used ant-building too much, maybe if someone could write down ant-build command used to build the plugin, I think I could manage to run it on eclipse.

NOTE: As far as I know the ant-build script is supposed to create the jar file (from the directory structure specified) that is needed to add the plugin to the Openfire Server. Please correct me if I’m wrong.

Thanks.

I suppose You are right, I just do not have deep knowledge of how OpenFire works.But if you plugin hook some services inside OpenFire – OpenFire must be notified somehow about it - as example during install phase ?!

I’ve succesfully deployed the default plugins that come with the openfire server, and within eclipse, using the ant-build script called “plugins” that compiles, packs and deploys all the plugins to the openfire server, there’s no need to notify openfire in any other way, it does automatically. So I want to do the same thing but for only one plugin, with the ant-build script called “plugin”.

Anyone with good knowledge of ant, that knows how ant command should look like, o how the parameters shoud be??

The way that I do:

  1. I don’t use eclipse.

  2. delete everything else than you own plugin from openfire_src/src/plugins directory.

  3. enter “ant plugins” into console

  4. you will find your JAR-file in openfire_src/target/openfire/plugins

So everything you have to do is to write a simple script:

#! /bin/bash cd openfire_src/build
ant plugins cp openfire_src/target/openfire/plugins/yourplugin.jar /opt/openfire/plugins

My script is a bit more complicated, I’am apply an incremental build number and current date to plugin.xml and such things…

Thank you for the script, at the moment I’m using a similar solution, I’ve delete all the plugins except for mine, but instead of using ant directly, I use the ant script inside eclipse, so it’s a similiar solution to what I intended, I build only one plugin with the script that builds all the plugins, xDD

Thanks all.

And if you are used to Maven you could also try the Maven Openfire Plugin to build your plugin.

Try this -
ant -f build/build.xml clean openfire plugin -Dplugin=nameofyourplugin