In my case it was sufficient to do the following:
- download the Openfire source
- build Openfire - the binaries will be in the ./target/ folder
- start openfire in debug mode by adding the " -debug" switch to the call to the sh or bat script
- openfire remote debug will be by default accessible on port 8000
- in your IDE (Eclipse, IntelliJ) create a new project from the existing Openfire sources
- in your IDE create a remote debug configuration with a correctly configured port (i.e. 8000)
- set the necessary breakpoints in the code (i.e. in your plugin code if you are creating a plugin)
- start your debug from your IDE
- do something that will trigger your breakpoints, i.e. send messages with appropriate content