[HowTo] Setup Intellij IDEA debugging for Sponge plugins

This is just a brief tutorial on how you can easily debug your sponge plugin without having to build Sponge from source or anything.

Step 1:
Code your plugin…

Step 2:
Create an artifact…

I changed the output directory to be in the mods folder of my server. Don’t forget to include your compile output and maybe external dependencies.

Step 3:
Create a run configuration…

I ticked “Singe instance only” so i don’t accidently run multiple servers at the same time.
At the bottom at “Before launch”, i added the “Build artifact” step.
I changed the jar to be the usual jar you use to start the server.
I also changed the working directory to be my server directory.
Maybe you want to add “nogui” as a program argument.

Step 4:
Profit…

Disclaimer
In case you have any suggestions or i made a mistake, just tell me, i’ll edit it as soon as possible.
I also never found any other description like “Setup SpongeVanilla” and stuff, why so complicated…
I also don’t know if this is the correct subforum to post in. Maybe i also missed another tutorial about that, then im sorry for doubling it.

8 Likes

A better way is to select the sponge.jar, instead of the forge.jar, and do as arguments go.
EDIT: But it seems not working :expressionless:

Is yours or mine not working?

I mean the go argument does not work

This is much easier than adding a complete sponge project as a second project. Thank you :smiley:.

This will work:
http://gyazo.com/811ed53bec4854f7e061495d123868f3 make sure specified port is empty
run sponge with -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 vm args
build your plugin and place it into sponge mods directory.
start sponge server
in intellij hit green bug icon/shift f9