Which Sponge to use?

You’re actually mentioning what’s called classpath, which is to my understanding how classes are loaded/found etc within the environment (I a have no expertise in this field so those who are please do correct me if I am wrong).

Maven and Gradle are both build automation tools (amongst other things) that make creating and managing Java (and other language) projects (not Eclipse projects) and their binaries easier.

Noteworthy: Here are some software build automation tools laid out.

Just dropping this all here to help you understand that those are different ways of doing the same thing (ie: using Maven/Gradle/Ant. As well as using Eclipse/IntelliJ/NetBeans IDEs with or without the automation tools to manage dependencies).

FYI, if you do NOT want to use a build tool, we do provide a shaded jar that does bundle all the dependencies for SpongeAPI.

2 Likes

Little addition:
There’s no support from staff for the shaded jar. Use at your own risk :wink:
Using Maven or Gradle is recommended.

How would you go about doing so? I am using Maven. Also, once the plugin has been tested and debugged, how do I export it as a .jar file?

Refer to the documentation here: https://docs.spongepowered.org/en/plugin/workspace/dependencies.html

EDIT
/On how to use maven as a dependency/, I might of misunderstood what you meant in your first question.

1 Like

export it the same way you would a bukkit plugin

I use the M2Eclipse plugin for eclipse. It allows me to import maven projects into eclipse. Once I got it as a project in eclipse, the instructions for debugging from the Docs apply, since your maven project can be treated by eclipse just as a regular Java project is.

To export the plugin as a .jar file I run maven with the “package” target. It will then compile, run tests etc and generate whatever .jars your pom.xml specifies - if it does not specify any, just a .jar of the compiled source code is generated.