Java Gradle

How to deploy Java-based Gradle project?

If you do not have code ready, you can fork the repository being used in this example:


We are going to deploy a simple hello world java api, that will have a single endpoint:

/ -> Hello world


Choose your repo first:

Choose repo

Next, select JavaGradle deployment: Java Gradle select

To choose a correct Java version, open up the terminal and type:

$ java --version
Picked up _JAVA_OPTIONS: -Xmx1024M
openjdk 2020-11-04
OpenJDK Runtime Environment AdoptOpenJDK (build
OpenJDK 64-Bit Server VM AdoptOpenJDK (build, mixed mode)

Choose major version like 11 or 13.

On the final screen, enter the following settings: Java Gradle settings

Build command:

#Default build command, will create out folder
gradle build --no-daemon

#Run tests first
gradle buildAndTest --no-daemon


#For monorepo example

Port to expose:

#Choose port 8080 (default) as ssl is provided automatically

Deploy folder:

#Build command deploys into out

Run command:

#Take project name from settings.gradle:
java -jar java-gradle-helloworld-0.0.1-SNAPSHOT.jar

After that you can visit your api and see how easy it was to deploy it: Deployed

Note: if you need to configure which spring profile file to use, set environment variable SPRING_PROFILES_ACTIVE to production/dev/staging - Set runtime environment variables

Edit this page on GitHub Updated at Wed, May 17, 2023