Build server jar


I successfully build the server and a plugin with gradle. Everything is fine.

But what is annoying: The long build time of the server jar. I start the gradle task, wait half a minute and then wait for the server startup…
My idea is to get jar that is generated every time I build the server. I tried some gradle tasks but no success.

Any ideas how to get/find the jar which is generated when the server is build?

Btw: I shutdown the server to reload my plugin. Maybe any ideas how to replace the plugin.jar that is “running”? It is locked when I try to delete it.

I do not understand what you are asking. Can you not find the jar output of the gradle build task? You should only have to build the server itself once, unless you need to update it with the latest files from github. If half a minute is still too long for you get a better computer :stuck_out_tongue:

It is possible to copy the output jar to another folder on your computer so it copies to your server directory after it finishes building. I don’t remember the syntax but it is not difficult.

You should always shutdown your server before changing any plugin files within it. It is extremely bad practice to add, update or remove plugins while the server is running.

1 Like

I only want to get the testing of my plugins more comfortable. :wink:

Before I opened this thread, I found in \build\libs 4 jars. The root of the file names are sponge-1.8-…-DEV. One with only that root and three others with source, javadoc and release appended. I tried to execute the first jar and the release jar with java -jar name.jar. The error message is no main manifest attribute. I think that these jars aren’t the right one’s. They are generated when I execute assemble gradle task.

Besides, there is no output folder.

Sponge is a Forge coremod. The jar that is built needs to be copied into the coremod folder of a Forge 1.8 server for it to run.


Ahhh… I heard that so often and now it again comes to my mind. I tried that but it gives me an exception when I join the server. Something with the ASM or Mixin.

I don’t care now. I think the implementation will be released soon. I can wait until it and this half a minute. :smile:

If you want a standalone Bukkit-like jar, you can try Granite:

I tried Granite. Nice thing. But there is also a problem: When I want to do Player#sendMessages(Message) it gives me a NPE. The same code runs on the official Sponge server.

As I said, now I don’t care about the compiling time if a server jar doesn’t work out of the box.

That’s because they’ve started on different ends and it’s not ready on Granite afaik.