How does the plugin annotation meta get serialized into an mcmod.info file?

I was looking more into the inner workings of sponge plugin development, specifically, how is it that the information in the @Plugin annotation of the main class get seralized into the mcmod.info that can be found in the root directory of the jarfile?

Annotation processing is turned on by default in IDEs, and SpongeAPI has the PluginProcessor which implements Processor, and is registered in META-INF as an annotation processor. The actual serialization of the annotation into JSON is done through the plugin-meta dependency.

If you’re looking for the source, it’s under SpongeAPI in src/ap/java/org/spongepowered/plugin. plugin-meta is found here.

1 Like