Resolve Java version build failures in AEM Cloud Manager pipelines

This article explains how to resolve build failures in Adobe Experience Manager (AEM) Cloud Manager pipelines that are caused by Java version mismatches and build image override variables.

Description description

Environment

Adobe Experience Manager Cloud Manager (all supported versions)

Symptoms

  • Pipeline build step fails with errors indicating an unrecognized Java version.

  • Build logs show messages such as:

    • The file .cloudmanager/java-version did not contain a recognized value and will be ignored. Using default Java version 8
    • The pipeline defaults to Java 8 instead of the intended Java version (For example: Java 21).

Cause

This issue occurs when the pipeline variable that overrides the build image (such as CM_BUILD_IMAGE_OVERRIDE) is set to an outdated image that doesn’t support the required Java version. As a result, the pipeline ignores the Java version specified in the codebase and defaults to Java 8, causing build failures.

Resolution resolution

Follow the steps below to resolve the issue:

  1. In the Cloud Manager UI, navigate to the affected pipeline.

  2. Review the pipeline variables:

    • Locate the section for pipeline variables in the pipeline configuration.

    • Look for any variable that overrides the build image (For example: a variable named CM_BUILD_IMAGE_OVERRIDE).

  3. If a build image override variable is present and set to an older or unsupported image, remove this variable from the pipeline configuration.

  4. Ensure your codebase contains the file .cloudmanager/java-version at the root level.

    • Open the .cloudmanager/java-version file and verify it contains a supported Java version (For example: 21) with no extra spaces or characters.

    • If the file doesn’t exist or contains an unrecognized value, create or update it accordingly, and commit the change to your repository.

  5. If you’re using other pipeline variables, such as CM_DISABLE_BUILD_REUSE, ensure they are set, as needed, for your build process.

  6. Re-trigger the pipeline to verify that the build uses the intended Java version and completes successfully.

recommendation-more-help
experience-cloud-kcs-help-kbarticles