I’ve started to work on migrating Openfire from Ant to Maven last year, but eventually came to a point where this work stagnated.
This thread is to discuss the current status and ideas how to proceed.
What I’ve achieved so far:
- Create different Maven modules (for core, for plugins, for web admin UI).
- Determine the current dependencies Openfire is using and reference them from Maven Central. This went mostly well.
- Configure Maven to build the documentation zip archive which can currently be downloaded from this site.
- Configure the build to create a distribution folder, which contains all the dependent JARs and resources and the main jars (startup.jar, openfire.jar). The classpath is correctly set in the main jars, so you can do “java -jar startup.jar” and it successfully runs Openfire.
- Configure the WebAdmin plugin, so that it’s correctly assembled and copied.
Known unresolved issues (what I’ve not achieved so far):
- Some plugins (I remember kraken and stun) require non-public, homebrew or otherwise weird jars, which cannot be found on Maven Central (sometime not even on other places in the internet). Can probably be worked around by installing them in the local repo.
- Plugins which don’t have web.xml require an empty one, because jetty-jspc-maven-plugin require an existing one in order to merge in the compiled JSP files (references). I think it can easily be solved by adding empty web.xml files. web-custom.xml was probably a workaround for a similar problem in the past and can later be removed.
- tinder.jar (1.3.0) and i4jruntime.jar (probably not needed anway) are not on Maven Central. Currently referenced via system scope. You can only build the root currently, not single plugins or modules, because Maven cannot resolve the relative path then.
- The Openfire directory structure needs to be restructured, so that it fits to the Maven structure (e.g. move src/java to src/main/java, etc…). I know these paths can be configured in pom.xml, but at least IntelliJ can’t import it properly then (although the plain build succeeds). So this point is strong recommendation.
- Native installers: Actually the most intimidating issue, because it’s hard to develop and test.
- The current Ant build script is configured to work with preconfigured igniterealtime servers (e.g. it references absolute path to some native install programmes like install4j)
A developer usually only has one platform to develop on, so we would need some joined forces here.
For Windows we need to configure Maven to create a *.exe file using install4j or (as I suggested Inno Setup). Personally I develop on a Mac, so it’s not that easy to do for me.
For Mac: the current native build scripts are hard to understand, not documented, maybe outdated and probably hard work with (e.g. build/osx/dmg_openfire.scpt).
For Linux: personally I have no idea about it.
My thoughts on these issues:
- Is the Mac installer really required in this complexity? e.g. do we need to install into the system pane?
- We could consider javapackager tool to create native bundles. The downside is, that the UX might look/work different, but so what? The upside is, that you only have one configuration for all platforms.
- After we found solutations for the plugins, missing Central jars and the installers, we should as last step change the directory structure.
Any thoughts, plans or volunteers to help?