powered by Jive Software

Building plugins in Openfire 4.3.2 (JSPs not being compiled)

y if this is a duplicate of a previous request. Older links on this topic appear to be broken.

Migrating from Openfire 4.2.3 to 4.3.2, I have not been able to successfully build my plugins. The plugin itself builds and creates a myplugin-1.0.0.jar and myplugin-openfire-plugin-assemply.jar (containing the myplugin-1.0.0.jar) but it does not contain (nor any other jar built containing) the web pages for the plugin.

I’m not a maven expert – obviously – but I assume I’m missing something basic in the pom.xml file for my plugin. (Since no plugins are delivered in the source since 4.3.0 – I have no example to follow).

Here’s the pom for the plugin (http shortened to ttp so it would post):

<project xmlns="ttp://maven.apache.org/POM/4.0.0"
xmlns:xsi="ttp://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="ttp://maven.apache.org/POM/4.0.0 ttp://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>plugins</artifactId>
<groupId>org.igniterealtime.openfire</groupId>
<version>4.3.2</version>
</parent>
<groupId>org.igniterealtime.openfire.plugins</groupId>
<artifactId>myplugin</artifactId>
<version>1.0.0</version>
<name>My Plugin Example</name>
<description>An example to build a plugin</description>
<build>
<sourceDirectory>src/java</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

The plugin structure is unchanged:

myplugin
–>lib
–>src
–>-->database
–>-->i18n
–>-->java
–>-->web

Followed the README to build just the plugin:
mvn verify -f plugins/myplugin/pom.xml

Again, plugin seems to build ok, just doesn’t contain any of the webpages. BTW, this built fine in 4.2.3.

Appreciate any help in resolving this problem.

You can compare your pom.xml with say this plugin’s pom in our repo https://github.com/igniterealtime/openfire-broadcast-plugin

Thanks for the help. I finally have my plugin working. For those who follow and may be looking for answers, here’s what I had to do.

It turns out that (now that I know where all of the updated plugins are in git) the search plugin is a better example. https://github.com/igniterealtime/openfire-search-plugin

I needed to add the jetty-jspc-maven-plugin to my pom (even though I thought the parent pom up in the plugins directory would have handled this).

In addition, I also had to create the WEB-INF/web.xml file in my src/web directory (use what’s in the search web.xml file - doesn’t seem to want to do the merge of the generated web.xml without it).

And if you’re debugging this like I am, you’ll need to copy the myplugin-openfire-plugin-assemply.jar file to your distribution-target-distribution-base/plugins directory (and I renamed it to just myplugin.jar).

For me, this seems to work.

Thanks for the help.

1 Like

You’re absolutely right. I’d love to find a way where we could do away with that dummy WEB-INF/web.xml file, but I’ve not found any way to coarse the JSP compiler to not need it :(. If you have a solution for that, that’d be more than welcome…

By your question I assume you have created a plugin. Can you tell me while creating and testing the src of the plugin with openfire how did you debugged it.?