powered by Jive Software

How to build openfire mavenized code base which automatically deploys all the plugins

Hi, How to build openfire (Maven command) which deploys all the plugins automatically. Tried, “mvn clean install”, “mvn clean package”, mvn clean -P release but no luck.

What is the equivalent of (
ant -f build/build.xml clean openfire plugin -Dplugin=nameofyourplugin) in maven

mvn verify

will compile everything and run all the tests. You can run the newly built server using distribution/target/distribution-base/bin/openfire.sh (or openfire.bat), but unlike the ant build, you’ll have to manually copy a plugin, from src/plugins/[plugin]/target/[plugin].jar, to distribution/target/distribution-base/plugins

Greg

1 Like

First of all I have never heard about maven. So I have no idea about it. So apologies in advance.

Now that plugins are moved to their own repositories - how do I compile them along with openfire? (I have slight modification to plugin)

I downloaded openfire source and found that openfire plugins directory is more or less empty. With just one directory openfire-plugin-assembly-descriptor.

I compiled openfire successfully with “mvn verify”. But it compiled just admin and search module.

I would like modified version of monitoring plugin to be compiled too. How do I do that?

Where do I place the plugins files? What would be directory structure?

If possible please give detailed answer.

Thank you.

For good reasons, the plugins are no longer part of the core Openfire code base. Each has been moved out to it’s own separate GitHub repo (the README probably needs an update!)

To build the monitoring plugin, clone the repo from https://github.com/igniterealtime/openfire-monitoring-plugin and build it using mvn verify. That will give you a file, target/monitoring-openfire-plugin-assembly.jar. Rename that to simply monitoring.jar and copy it to your ${OPENFIRE_HOME}/plugins folder - deleting any existing monitoring folder.

Greg

2 Likes

Hello @gdt,

It would be really nice if the documentation about plugin (in the master repo) was updated to include these informations.
Currently the documentation still refers to “ant” in order to build a plugin :
plugin-dev-guide.html

The build script will compile source files and JSPs and create a valid plugin structure and JAR file. Put your plugin directories in the src/plugins directory of the source distribution and then use ant plugins to build your plugins.

Thanks a lot,

Baptiste

It would indeed be nice. There’s a JIRA open on this already, and PRs are of course welcome!

https://issues.igniterealtime.org/browse/OF-1664

Greg

In the ticket you’ve stated :

The build script will compile source files and JSPs and create a valid plugin structure and JAR file. Put your plugin directories in the src/plugins directory of the source distribution and then use ant plugins to build your plugins.

Isn’t the “openfire-plugin-assembly-descriptor” (inside the plugins dir of OF parent repository) the template plugin that we can use as a starting point ? Or is it something we shouldn’t modify ?

Baptiste

Generally, openfire-plugin-assembly-descriptor is not something that will be modified regularly. That assumes a standard source tree layout, and takes that source and generates an Openfire compatible plugin.

For a template plugin, I’d suggest taking a (small) plugin as a starting point. The debugger plugin might be a good starting point as it only has a single JSP page and a handful (three?) classes to consider.

Greg

1 Like

So if I wish to developp my plugin alongside the code of Openfire (so I can check easily any part of the code), should I go with the following structure inside my IDE ? :

Then I can use the debugger plugin as a starting point for the code and also the documention to have the folders structure to use.

Thank you for your help :slight_smile:

Baptiste

I’d strongly suggest moving the whole “testdev” plugin source tree to a module on it’s own.

Simply copy the files out of the “Openfire” tree to it’s own (e.g. C:\Users\bandrini\openfire-testdev-plugin). It can then reside in it’s own repository, but you can still open it in IntelliJ at the same time as Openfire if you import it as a Module.

Whilst the plugins and core Openfire are related, then can and should be kept independent. Also,I’d advise that the parent Openfire version is 4.3.0 (unless there’s really a feature in 4.4.0 that you rely on).

Greg

Thanks for the advice. It’s what I’ve done (using the xmldebugger plugin as a starting point) and it seems to work well.

Baptiste

1 Like

@gdt can you please help me. I’ve created a plugin, compiled it and placed it in distribution/target/distribution-base/plugins and yet when I run openfire.sh my plugin is not loaded only admin and search are loaded.

Check the all.log for helpful messages,

Greg

ok, now my plugin is loaded bu noclassdeffound error has occurred. is there a way I can debug my plugin on intellij?