Needing to start and manage a test server every time you changed something in your plugin is tedious - why not start the server right in your IDE?
If you want to start a spigot server directly in your IntelliJ IDEA IDE, you just have to follow these steps:
- Create your plugin project in IntelliJ (preferably through the Minecraft Development plugin for IntelliJ)
- Create a new directory in the root folder of your project called "server" (not in the src folder, but on the same layer)
- Move the spigot server JAR into this folder
- Click on "Add Configuration..." in the top bar
- Click on the plus icon in the upper left and choose "JAR Application"
- Give your Configuration a name, e. g. "Spigot Server"
- Select your .jar file using the folder icon in the "Path to JAR:" textbox
- Select your "server" directory you created in step 2 at "Working directory:"
- If applicable, select a JRE
- Click Apply and OK, then start your server by clicking the 'play' icon in the top bar (don't forget to accept the EULA in eula.txt)
- You now can control your server using commands in the Run window at the bottom of your IntelliJ window
- Enjoy!
This is what the Run/Debug Configurations window looks like for me: