How to build(?) your plugins

I couldn’t find anywhere in the documentation, how do I put my created plugin on my server. I am compiling the plugin with Gradle.

Run the task gradle build
it will place the compiled jar file in build/libs
You can then copy it over to the mods folder in your server.

If I understood correctly “run the task gradle build”, where should build/libs be located in?

In the root directory, where build.gradle is located

Well… I did something wrong then, there is no build folder there. Isn’t there documentation or something that clearly explains how to do it? EDIT: I’m using eclipse.

There’s the official gradle docs https://docs.gradle.org/current/userguide/tutorial_java_projects.html

Make sure you’ve looked over the documentation on spongedocs
https://docs.spongepowered.org/master/en/plugin/project/gradle.html

It would be helpful if you post the output of gradle build and also your build.gradle file

I don’t think I understood what means “gradle build”, how do I do it in eclipse? Here’s my build.gradle:

apply plugin: ‘java’

repositories {
mavenCentral()
maven {
name = ‘sponge’
url = ‘http://repo.spongepowered.org/maven
}
}

dependencies {
testCompile ‘junit:junit:4.12’
compile ‘org.spongepowered:spongeapi:4.1.0’
}

When I said gradle build, I meant you enter it into the command line (command prompt in Windows).

If you’re not using the command line and want to do it from within eclipse, make sure the project is a “Gradle project”. From there you can right click the project, under ‘Gradle’ there should be “Tasks Quick Launcher”. Click on that, then type build and press enter.

1 Like

Oh, alright I got it working now. Thank you.