Add the dependency
Published through JitPack, so you need the JitPack repository as well as the dependency.
- Gradle (Kotlin)
- Gradle (Groovy)
- Maven
repositories {
maven("https://jitpack.io")
}
dependencies {
implementation("com.github.1robie.paper-dispatch:paper-dispatch:1.0.2")
}
repositories {
maven { url 'https://jitpack.io' }
}
dependencies {
implementation 'com.github.1robie.paper-dispatch:paper-dispatch:1.0.2'
}
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.github.1robie.paper-dispatch</groupId>
<artifactId>paper-dispatch</artifactId>
<version>1.0.2</version>
<scope>compile</scope>
</dependency>
</dependencies>
com.github.1robiepaper-dispatch is a multi-module project, so JitPack publishes it under
com.github.1robie.paper-dispatch — the repository name becomes part of the
group — with each module keeping its own artifact id. Using
com.github.1robie:paper-dispatch will not resolve.
Which module
| Artifact | Use when |
|---|---|
paper-dispatch | Normal case. Full implementation, includes Lib-API. |
Lib-API | You want to compile against the interfaces only. |
Swap the artifactId (Maven) or the last coordinate segment (Gradle) to pick.
You must also shade it
The library is not installed on the server, so compileOnly alone gives you
NoClassDefFoundError on first use. Use implementation and
shade it in — with relocation, which is not optional here.
Also needed: the Paper API
paper-dispatch does not bring a server API with it. Add Paper separately as
provided (Maven) or compileOnly (Gradle) — the server supplies it at
runtime:
<repositories>
<repository>
<id>papermc-repo</id>
<url>https://repo.papermc.io/repository/maven-public/</url>
</repository>
</repositories>
<dependency>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>26.1.2.build.53-stable</version>
<scope>provided</scope>
</dependency>
Note the asymmetry: provided/compileOnly for what the server already has,
implementation for what you ship. Getting these the wrong way round is the
most common build problem in plugin development.
Versions
The version is a git tag, and JitPack builds tags on demand — the first request for a new version takes a minute or two while it compiles. Check the build log if a resolve fails before assuming the coordinates are wrong.
You can also depend on main-SNAPSHOT or a commit hash. Neither is
reproducible; use a tag for anything you publish.
The version in the project's pom.xml is the next, unreleased version. Only
tags that exist resolve — asking JitPack for an unreleased version returns 404.
The snippet above always shows the latest released tag.
Requirements
- Java 21 — the library is built with
--release 21 - PaperMC — see Supported platforms
- Maven 3.6+ or a recent Gradle
Next
- Shading & relocation — required before you publish
- Core concepts — registering your first command