How to compile my plugin?

There’s not really a clearly explained way of doing this.
gradle.build

plugins {
    id 'org.spongepowered.plugin' version '0.6'
}

group 'shadowraix.github.io'
version '1.0-SNAPSHOT'

dependencies {
    compile 'org.spongepowered:spongeapi:5.0.0-SNAPSHOT'
}

Using the build gradle task generates a jar that Sponge does not register as a valid mod.
Adding an artifact with compile output only generates a valid mod but it reports mcmod.info is missing even though I have annotation processing enabled.

Is your main plugin class annotated with @Plugin?

Yes.

As I said, the Gradle build task is what produces a invalid mod that Sponge can’t load.
Building as an artifact produces a valid mod but fails to bundle the mcmod.info file with it.

Asked around in IRC and discovered that my sources structure is wrong. For anybody who encounters this issue, make sure your sources are in src/main/java!

1 Like