JitPack builds your library directly from your GitHub repository, so publishing is mostly about preparing your Gradle setup and creating a GitHub release.
JitPack only works with Git repositories hosted on GitHub.
Make sure your project builds cleanly.
Your library module needs a Maven publication.
plugins {
`maven-publish`
}Then configure the publication
publishing {
publications {
create<MavenPublication>("release") {
groupId = "com.github.<YourUser>"
artifactId = "<YourLibraryName>"
version = "1.0.0"
afterEvaluate {
from(components["java"])
}
}
}
}If you need a specific JDK or custom build steps, add this to your repo root
jdk:
- openjdk17Common for Android/Kotlin projects.
Before pushing, confirm your library can publish locally (paste into Terminal)
./gradlew publishToMavenLocal
JitPack builds from tags. Go to GitHub → Releases → Draft a new release and create a tag like v1.0.0.
Visit:
https://jitpack.io/#YourUser/YourRepo (jitpack.io in Bing)
In their settings.gradle:
dependencyResolutionManagement {
repositories {
mavenCentral()
maven { url = uri("https://www.jitpack.io") }
}
}In their module build.gradle:
dependencies {
implementation("com.github.YourUser:YourRepo:1.0.0")
}Once the tag builds successfully, your library is live and anyone can depend on it.