Files
KSpigot/guide/docs/setup/gradle.md

1.6 KiB

The following code snippets can be used in your build.gradle.kts file.

An example of a final configuration file is also available.

Prerequisites

Java version

Make sure that you have configured the Java version correctly.

Add the Spigot dependency

KSpigot does not replace Spigot, it is just an API which you can use together with Spigot. Therefore, please make sure that you have added Spigot to your project as well.

Add KSpigot

Add the dependency

Add the following repository to your repositories scope:

repositories {
    mavenCentral()
}

Add the KSpigot dependency to your dependencies scope:

dependencies {
    implementation("net.axay:kspigot:VERSION")
}

Replace VERSION with the version you want to use.

Latest version (without the v):
latest KSpigot GitHub release

Add KSpigot to your plugins libraries

Add KSpigot as a library to the libraries list on your plugin.yml. Make sure that you are always using the same string you where using when defining the dependency in Gradle.

libraries:
  - "net.axay:kspigot:VERSION"

Build your final plugin

Run the Gradle task called build. Using IntelliJ IDEA, this can be done using the Gradle sidebar, where you can find the task under Tasks > build > build. Alternatively, you can also run ./gradlew build in your terminal.

The final .jar file of your plugin will then be at the following location: build/libs/yourplugin.jar