I never realized this but I might be exporting plugins incorrectly.
I’ve always done it the Spigot way of exporting the project as a jar file, and that’s always worked.
But when I was doing that with PlaceholderAPI…when I ran the plugin it said there were two instances of the plugin. I opened the jar file and found the plugin with all my eclipse stuff in the export and in the “Build” folder the actual plugin.
This made me think I’ve been doing it incorrectly this whole time, so I searched for docs on exporting and couldn’t find any.
So what’s the proper way to export/build the final jar file for a plugin?
From different testing I’ve been doing, it seems to be building the project with gradle, and the files are in the build/libs folder?
You are going to get a variety of “the only best way” but the reality of the situation is, it doesn’t matter HOW you export/build the jar file.
The reason you are getting the two=-instances of plugin issue when you are using the server is because you have two different jar files with different names, which have the same plugin id info - this can be from making a new version myplugin.jar and mypluginB.jar at one point, or from accidentally renaming another, accidentally exporting your plugin under some other name, some other project you did from a cling-on dropdown menu item selection/suggestion for name, and you look at your jar list and think that oldplugin.jar is the OTHER plugin from before, but its really the export of your Myplugin just named incorrectly, then when you correctly name the export to myplugin.jar you now have two versions of the same plugin identifier being loaded, and you mistakenly think you only have one ‘myplugin’ file to launch, but its a filename issue. - the jar name doesn’t mean squat to the server, the contents tell it what its unique information are.
Then they will push on to you a variety of build-system configurations that will prevent such accidental name changes, but the proper way is 'the way that you are most comfortable in doing, and works for your own development environment and style"
The end result is exactly what your server is telling you, regardless of the jar file name, it already loaded something with that id info found in whatever jar files its loaded sofar.
1 Like