Skip to content

♻️ Utilities and reusable components to simplify the process of creating a Bukkit/Spigot plugin.

License

Notifications You must be signed in to change notification settings

axelrindle/PocketKnife

Repository files navigation

Logo


Test Status Codacy Badge Codacy Badge JitPack Status


PocketKnife

♻️ Utilities and reusable components to simplify the process of creating a Bukkit/Spigot plugin.

Get Started

Installation

If not already done, add the JitPack repository and the dependency:

Repository

maven { url 'https://jitpack.io' }

Dependency

implementation 'com.github.axelrindle:PocketKnife:LATEST_VERSION'

Package relocation

To avoid classpath conflicts with other plugins using the same dependencies, dependencies should be relocated to a unique package. More information can be found here.

The following Gradle configuration relocates all dependencies using the shadow plugin, that will be included in the jar file, to a new location:

plugins {
    id 'com.github.johnrengelman.shadow' version '6.1.0'
}

shadowJar {
    archiveClassifier.set('') // remove the 'all' suffix
}

import com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation
task relocateShadowJar(type: ConfigureShadowRelocation) {
    target = tasks.shadowJar
    prefix = "mypluginshadow" // Default value is "shadow"
}

tasks.shadowJar.dependsOn tasks.relocateShadowJar

Afterwards a jar file can be built by running the Gradle task shadowJar.

Usage

Documentation is moving to GitBook.

Used by

Feel free to add your plugin here by sending a pull request.

License

Apache-2.0

Copyright notices