Java Error, ClassNotFindException when importing plugin

I want to develop an openfire plugin but encounter a persistent error during import
"An exception occurred while loading plugin. Review the logs for additional details. "

Logs:

The plugin.xml file in src/resources correctly declares the org.example.simple.SimplePlugin class as the main class.

The Maven/Gradle build correctly generates a .jar file in target/.

I have included the SimplePlugin .class file in the package.

The build will generate two jar files in the target directory. Which one are you using?
You should be using the one that includes openfire_assembly in its name (you will have to rename that to userlist.jar (or whatever the name of your plugin is).

You can try and share your work here, so that we can have a look.

I can only find one jar in the target directory

You’ll need to provide us more context for us to be able to help you.

What does your source code look like? How do you start a new build of your plugin?

Here is the tree structure of my plugin

To compile it, I place my plugin in the plugin folder of the openfire git repo that I’ve cloned and I do a mvn clean install which provides me with a .jar file

Here is my source code from my main java class

That is very unusual. Maybe this is the cause of the problem that you’re having.

In principle, an Openfire plugin project is a stand-alone Java/Maven project. It can be built ‘on its own’ without needing to be placed inside of the Openfire directory structure (for very, very old versions of Openfire, this was different, but that predates the usage of Maven in Openfire).

Have you found our plugin developer guide? This explains in detail how you can set up a plugin project. You can find it at Openfire: Plugin Developer Guide