Skip to main content

Java Gradle source deployment components

Gradle project identification strategy

By default, the platform will identify a Java Gradle project according to whether there is a gradlew file or build.gradle in the source root directory.

Platform compile and run mechanism

  1. After the pre-compilation process is completed, the Java-Gradle buildpack will be selected according to the language type to compile the project. The defined JDK version will be installed during the compilation process;
  2. After the compilation is completed, it will check whether the Procfile parameter is set on the platform. If it is configured, the startup command configuration file Procfile will be rewritten.

Platform default Gradle build command

gradlew build -x test

Gradle project source code specification

In this step, you need to provide a usable Java Gradle source program for deployment on the Rainbond platform. This application must at least meet the following conditions:

  1. A locally working Gradle program
  2. The source code program must be hosted on a related git or svn service such as gitlab
  3. The gradlew file or build.gradle must exist in the root path of the source code program

Compile and run environment settings

When choosing a JDK version or other component version, you need to pay attention not to choose a JDK or other component version that is too high or too low than the version used by the project to avoid source code compilation failure

OpenJDK support

Currently Rainbond supports OpenJDK, the following version is:

  • Java 1.6 - 1.6.0_27
  • Java 1.7 - 1.7.0_95
  • Java 1.8 - 1.8.0_74
  • Java 1.9-latest
  • Java 10 - 10.0.2
  • Java 11 - 11.0.1

The platform default version uses1.8.If you need to use other versions of OpenJDK, you can specify the required version of JDK by addingsystem.propertiesfile to the source root directory to set the value ofjava.runtime.version.

# system.properties The current version values that Rainbond can recognize are 11, 10, 1.9, 1.8, 1.7, 1.6
java.runtime.version=1.8

OracleJDK Support

The platform currently also supports OracleJDK, but this feature needs to be enabled in the platform to take effect.
OracleJDK download is not built-in by default, you need to configure the relevant OracleJDK download address after enabling OracleJDK in the settings.

OracleJDK download address format requirements: http://<web服务URL>/jdk-8u201-linux-x64.tar.gz

The configuration priority of platform settings is higher than the configuration defined in the program code, such as the choice of Java JDK version, in the program code, the JDK version is specified as 1.9 throughsystem.properties, and the JDK version is selected as 11 on the platform, Then by default, the platform-specific version JDK11 will be used preferentially when compiling source code.

Sample demo program

Examplehttps://github.com/goodrain/java-gradle-demo