Gradle
Gradle build system for Java and JVM-based projects.
Using Gradle Locally
With the JFrog Fly Desktop App (Recommended)
Ensure the Desktop App is installed, running, and configured for Gradle.
Simply use your standard commands - the Desktop App handles authentication automatically:
Upload:
./gradlew publishDownload:
./gradlew buildAlternatively: Manual Configuration
1. Generate an Access Token
2. Configure
Option A: Project Configuration
Edit build.gradle:
repositories {
maven {
url "https://<your-fly-subdomain>.jfrog.io/artifactory/maven"
credentials {
username = "<your-fly-username>"
password = "<your-fly-token>"
}
}
}
publishing {
publications {
maven(MavenPublication) {
from components.java
}
}
repositories {
maven {
url "https://<your-fly-subdomain>.jfrog.io/artifactory/maven"
credentials {
username = "<your-fly-username>"
password = "<your-fly-token>"
}
}
}
}Option B: Global Configuration
For global configuration (applies to all Gradle projects), create an init script at ~/.gradle/init.d/artifactory.gradle:
allprojects {
repositories {
maven {
url "https://<your-fly-subdomain>.jfrog.io/artifactory/maven"
credentials {
username = "<your-fly-username>"
password = "<your-fly-token>"
}
}
}
}
rootProject {
publishing {
repositories {
maven {
name = "Fly"
url = "https://<your-fly-subdomain>.jfrog.io/artifactory/maven"
credentials {
username = "<your-fly-username>"
password = "<your-fly-token>"
}
}
}
}
}Note: This approach automatically applies to all Gradle projects without modifying individual
build.gradlefiles.
3. Upload
./gradlew publish4. Download
./gradlew buildUsing Gradle in CI/CD
Gradle is fully supported in GitHub Actions workflows configured with JFrog Fly.
Learn how to configure GitHub Actions →