After updating to Sponge API 4.0.2 I’m getting the following message:
[20:57:02] [Server thread/WARN] [Sponge]: Plugin 'nl.riebie.mcclans' seems to be missing a valid mcmod.info metadata file. This is not a problem when testing plugins, however it is recommended to include one in public plugins. Please see the in-existent SpongeDocs link for details.
[20:57:02] [Server thread/ERROR] [Sponge]: Plugin 'nl.riebie.mcclans' is using the old dependencies format in the @Plugin annotation (before SpongeAPI 4.0.0). This is only supported for compatibility reasons and will be removed soon. Please notify the author to update the plugin as soon as possible.
I’ve found and followed the following instructions:
But that leads me to:
Plugin [id: 'org.spongepowered.plugin', version: '0.1'] was not found in any of the following sources:
- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Gradle Central Plugin Repository (no 'org.spongepowered.plugin' plugin available - see https://plugins.gradle.org for available plugins)
Simply recompiling your plugin with the latest SpongeAPI release will already automatically generate a mcmod.info based on the contents of your @Plugin annotation.
The Gradle plugin is only needed for further Gradle integration (e.g. automatically including the version you defined in Gradle in your mcmod.info file) and will be released soon.
Figured I jumped the gun a little bit. Reason I still posted is the error and warning messages it generates when using the (old) plugin annotation way, telling to contact the plugin author.
I’ll just release the new updated version as is then, and be glad I got nowhere near that many users that would spam me
So I have very little knowledge about gradle so I’ve always manually compiled my plugins in eclipse. So what do I need to do in gradle or whatever to get the above mentioned to work? I’ve already updated my build.gradle and @Plugin annotation…now what?
If you have SpongeAPI as a dependency in your gradle file all you have to do is run gradle build in the root of your project and you’re good to go! The SpongeGradle plugin will automatically generate the mcmod.info file for you.
That’s likely because you didn’t set up the project in your IDE correctly. The Gradle standard project layout has Java source files in src/main/java and resource files in src/main/resources. Therefore you either need to tell Gradle where to find the source files or set up the project properly in your IDE so it puts them into the correct directory.
I don’t know how you set up your project, but having the Java source files in src instead of src/main/java sounds more like an Eclipse/IDE standard than a Gradle standard.
So this mcinfo file is ONLY generated from the annotation information IF we are building with gradle, and using the shaded api jar and native eclipse building, we’re going to be staring at “not that theres anything wrong with it, but you’re missing a file” warning message for every plugin?
I’m writing plugins for myself and myself alone, i have no intention to make them public so it wont matter to me other than OCD on the overload of warning messages… can the file manually be added to the project to silence the warnings?
As long the SpongeAPI dependency is properly set up you can (theoretically) generate the mcmod.info file with any kind of build environment, however unlike when using the IDE directly Gradle and Maven will execute the annotation processor without any additional configuration.
If you want to use it inside your IDE directly you need to enable annotation processing and configure the Java compiler to use SpongeAPI’s plugin annotation processor.
You can also write the mcmod.info on your own if you must, however everything present in your @Plugin annotation also needs to be present in the mcmod.info file if you include one. For just plugin ID, name and version this would be:
The plugin annotation processor was specifically written so it would work in most environments. If you need any help setting it up in your IDE feel free to open another thread.