Upgrading to Java Buildpack v4.32 or higher results in different buildpack names
search cancel

Upgrading to Java Buildpack v4.32 or higher results in different buildpack names

book

Article ID: 297524

calendar_today

Updated On:

Products

VMware Tanzu Application Service for VMs

Issue/Introduction

When upgrading the Java Buildpack to version 4.32 or greater, either manually with the cf cli or by updating Tanzu Application Service, the name reported for the buildpack has changed.

You will see differences in the following locations:

1. The output of cf push.

The old output:

name:              spring-music
requested state:   started
routes:            spring-music-dm.cfapps-05.slot-##.###.######.com
last uploaded:     Tue 17 Nov 13:30:35 EST 2020
stack:             cflinuxfs3
buildpacks:        java_buildpack_offline

type:            web
instances:       0/0
memory usage:    1024M
start command:   JAVA_OPTS="-agentpath:$PWD/.java-buildpack/open_jdk_jre/bin/jvmkill-1.16.0_RELEASE=printHeapHistogram=1 -Djava.io.tmpdir=$TMPDIR
...

The new output:

name:              spring-music
requested state:   started
routes:            spring-music-dm.cfapps-05.slot-##.###.#####.com
last uploaded:     Tue 17 Nov 13:36:03 EST 2020
stack:             cflinuxfs3
buildpacks:        java

type:            web
instances:       0/0
memory usage:    1024M
start command:   JAVA_OPTS="-agentpath:$PWD/.java-buildpack/open_jdk_jre/bin/jvmkill-1.16.0_RELEASE=printHeapHistogram=1 -Djava.io.tmpdir=$TMPDIR
...


2. The output of cf app <name>.

The old output:

$ cf app spring-music
Showing health and status for app spring-music in org dmikusa / space dev as admin...

name:              spring-music
requested state:   started
routes:            spring-music-dm.cfapps-05.slot-##.###.####.com
last uploaded:     Tue 17 Nov 13:36:03 EST 2020
stack:             cflinuxfs3
buildpacks:        java_buildpack_offline

type:           web
instances:      0/0
memory usage:   1024M

There are no running instances of this process.

The new output:

$ cf app spring-music
Showing health and status for app spring-music in org dmikusa / space dev as admin...

name:              spring-music
requested state:   started
routes:            spring-music-dm.cfapps-05.slot-##.###.#####.com
last uploaded:     Tue 17 Nov 13:36:03 EST 2020
stack:             cflinuxfs3
buildpacks:        java

type:           web
instances:      0/0
memory usage:   1024M

3. When querying the /v2/apps/<guid> api directly.

The old output:

$ cf curl /v2/apps/$(cf app spring-music --guid) | grep buildpack
      "buildpack": "java_buildpack_offline",
      "detected_buildpack": "",
      "detected_buildpack_guid": "97b0117d-####-48f5-a832-69e88c41043c",

The new output:

$ cf curl /v2/apps/$(cf app spring-music --guid) | grep buildpack
      "buildpack": "java_new",
      "detected_buildpack": "java",
      "detected_buildpack_guid": "6f06ba25-####-40f0-b057-f2fa41f33e68",


In all three cases, note how the buildpacks name changes from java_buildpack_offline to just java.

Resolution

The name has changed due to an improvement in the buildpack. The buildpack now outputs additional metadata which can be accessed through the Cloud Controller v3 API.

For older Java buildpack versions, you won't get any output. It'll look like this.
$ cf curl /v3/apps/$(cf app spring-music --guid)/droplets/current | jq '.buildpacks'
[
  {
    "name": "java_buildpack_offline",
    "detect_output": "",
    "buildpack_name": "",
    "version": null
  }
]
Once you upgrade to 4.32+, you'll get additional metadata including the version number of the buildpack.
$ cf curl /v3/apps/$(cf app test-application --guid)/droplets/current | jq '.buildpacks'
[
  {
    "name": "java_buildpack",
    "detect_output": "java",
    "buildpack_name": "java",
    "version": "v4.32-offline-https://github.com/cloudfoundry/java-buildpack.git#b6462f7"
  }
]
If you have scripts or pipelines that depend on the old naming convention, VMware Support recommends you update them to use the new name and additionally the new metadata exposed via the v3 API.