A collection of applications used for testing the Java buildpack.
| Name | Description |
|---|---|
dist-zip-application |
A Spring Boot 4.1 application, deployed as a distZip |
ejb-application |
A Jakarta EE 10 EJB application |
groovy-application |
A Spring Boot 4.1 application started with groovy |
java-main-application |
A Spring Boot 4.1 application started with java -jar |
java-task-application |
A Spring Boot 4.1 CF task application. Tests Spring Boot Start-Class detection and JBP_CONFIG_JAVA_MAIN class override. Push with instances: 0, run via cf run-task |
web-application |
A Spring MVC 4.1 application (Servlet 6 / WAR) |
| Name | Description |
|---|---|
java-main-application-boot3 |
A Spring Boot 3.5 application started with java -jar |
Standalone projects have their own
build.gradleand Gradle wrapper and are not included in the root multi-module build. Build them from their own directory.
⚠️ These applications are for CI/integration testing only. Endpoints such as/spring-env,/environment-variables, and/system-propertiescan expose sensitive runtime values (credentials, service bindings, system properties). Never deploy to production or shared environments.
All applications support the following REST operations:
| URI | Description |
|---|---|
GET / |
The health of the application |
GET /active-profiles |
The active Spring profiles (e.g. ["cloud"] when java-cfenv is active) |
GET /class-path |
The JVM system classpath (boot loader only — see /loaded-jars for full picture) |
GET /environment-variables |
The environment variables available to the application |
GET /input-arguments |
The list of JVM input arguments for the application |
GET /loaded-jars |
All jars loaded by the full classloader chain including BOOT-INF/lib/ |
POST /out-of-memory |
The URL to trigger an out of memory error |
GET /request-headers |
The http request headers of the current request |
GET /security-providers |
The system security providers available to the application |
GET /spring-env?key=<property> |
A single Spring Environment property value (404 if absent) |
GET /system-properties |
The system properties available to the application |
java-main-application-boot3exposes onlyGET /(health).
- JDK 21 for the multi-module build (Spring Boot 4.1 modules)
- JDK 17 for standalone Spring Boot 3.5 projects
Both JDKs can be managed with sdkman:
sdk install java 21.0.10-librca
sdk install java 17.0.19-temNote: This applies to the root multi-module build (Gradle 9.6.1 / ASM 9.9, supports Java 21–26).
java-main-application-boot3is a standalone project with its own Gradle wrapper — check its wrapper version separately. Java 27+ requires a newer Gradle release. Java 21 is recommended — it matches the project toolchain. To pin the daemon, addorg.gradle.java.home=/path/to/java21in a local (uncommitted)gradle.properties.
./gradlew
cd java-main-application-boot3
./gradlew bootJar
Since this project downloads its dependencies from the internet, building behind a proxy requires some extra effort. Configure Gradle with the following system properties (more information here):
./gradlew -Dhttp.proxyHost=<HOST> -Dhttp.proxyPort=<PORT>
Each test application contains a manifest.yml file which allows the built application to be deployed to Cloud Foundry by simply issuing:
cf push
To avoid clashing with the URLs of other applications, you should specify your own subdomain for the application (unless the test application does not need a subdomain).
Failure testing is supported for each of the above applications by setting a suitable environment variable.
If the environment variable FAIL_INIT is set, the application will fail to initialize:
cf set-env <application name> FAIL_INIT true
If the environment variable FAIL_OOM is set, the application will repeatedly exhaust the heap until the JVM is killed:
cf set-env <application name> FAIL_OOM true
To run the tests, do the following:
./gradlewThe project is released under version 2.0 of the Apache License.