Skip to main content
The gg.grounds.push Gradle plugin is what actually uploads your JAR to forge. The CLI’s grounds push is a thin wrapper around its tasks.
gg.grounds.push is separate from the convention-plugin bundle (gg.grounds.paper-conventions, gg.grounds.kotlin-conventions, …). The conventions plugins shape your build; push ships its output. You almost certainly want both.

Prerequisites

  • A GitHub personal access token with read:packages scope (the plugin lives on GitHub Packages).
  • Gradle 8+ and JDK 21+.
  • A shadowJar or jar task that produces the artifact you want to push.

Add the plugin repository

In settings.gradle.kts:
settings.gradle.kts
Storing creds in ~/.gradle/gradle.properties:
~/.gradle/gradle.properties

Apply the plugin

In your plugin module’s build.gradle.kts (the one that produces the JAR):
build.gradle.kts
That’s it. The plugin registers four tasks:

The groundsPush extension

For most projects you don’t need to touch this — the plugin auto-detects everything. But it’s useful for power users:
build.gradle.kts
All fields are optional. Defaults match what grounds push from the CLI uses.

JAR auto-detection

At afterEvaluate, the plugin looks for tasks named (in order) shadowJar, jar, and wires the first one found as both the JAR source and a build dependency. So:
build.gradle.kts
is everything you need — groundsPush will:
  1. Trigger shadowJar.
  2. Read its output JAR.
  3. Upload it.
Override jarFile only if you have multiple JARs or use a non-standard packaging task.

Project layout

The plugin runs per Gradle project (per build.gradle.kts). For a multi-module repo where only one module is the deployable, apply it only there: Then run from the repo root:
Or cd plugin && grounds push --target=staging.

Authentication

The plugin reads a bearer token from, in order:
  1. GROUNDS_TOKEN environment variable.
  2. The credentials file written by grounds login.
For CI, set GROUNDS_TOKEN to a service-account token. Don’t commit credentials.json.