heroku-buildpack-gradle

by heroku

README.md

gradle

Heroku Buildpack: Gradle CI

This is the official Heroku buildpack for apps that use Gradle as their build tool. It's primarily used to build Java applications, but it can also build applications written in other JVM languages.

If you're using a different JVM build tool, use the appropriate buildpack:

Table of Contents

Supported Gradle Versions

This buildpack officially supports Gradle 8.x and 9.x. Gradle 9.x is the current recommended version.

Getting Started

See the Getting Started with Gradle on Heroku tutorial.

Application Requirements

Your app requires a gradlew script in the root directory. This script is created when you install the Gradle Wrapper in your project.

Configuration

OpenJDK Version

Specify an OpenJDK version by creating a system.properties file in the root of your project directory and setting the java.runtime.version property. See the Java Support article for available versions and configuration instructions.

Gradle Version

The buildpack uses the Gradle Wrapper to determine which Gradle version to use. To change the Gradle version, see Upgrading the Gradle Wrapper.

Buildpack Configuration

Configure the buildpack by setting environment variables:

Environment Variable Description Default GRADLE_TASK Gradle task to execute stage*

* The buildpack may use a different default task based on detected frameworks (e.g., build for Spring Boot and Quarkus, shadowJar for Micronaut).

Documentation

For more information about using Java on Heroku, see the Java Support documentation on Dev Center.

CLI Installation

For new applications:

$ heroku create --buildpack https://github.com/heroku/heroku-buildpack-gradle.git

For existing applications:

$ heroku buildpacks:set https://github.com/heroku/heroku-buildpack-gradle.git -a YOUR_APP_NAME