Pipeline build fails due to stale cache and outdated frontend-maven-plugin version in AEMaaCS

Pipeline build fails in Adobe Experience Manager as a Cloud Service (AEMaaCS) during the UI.frontend module execution. The failure stems from stale cache references and an outdated frontend-maven-plugin version. Although local builds succeed, pipeline failures occur due to references to reverted files and errors from an outdated frontend-maven-plugin version. Upgrading the plugin and performing a clean build resolves the issue.

Description description

Environment

  • Product: Adobe Experience Manager as a Cloud Service (AEMaaCS)
  • Scenario: Cloud Manager pipeline execution for UI.frontend module
  • Versions: Java 11, Node v16.20.2, frontend-maven-plugin 1.12.0

Issue/Symptoms

  • Pipeline build consistently fails at the UI.frontend module during Cloud Manager execution.
  • Error message reports failure in executing npm run prod via frontend-maven-plugin.
  • Build logs display unresolved Maven plugin versions and missing artifact dependencies.
  • Compilation errors reference deleted or reverted SCSS files, such as pdplayoutcontainer.scss and pdpbutton.scss.
  • Stale cache retains references to outdated files that no longer exist in the repository, causing build inconsistencies.

Resolution resolution

Follow these steps to resolve the issue:

  1. Open the pom.xml file for the UI.frontend module and upgrade the frontend-maven-plugin version from 1.12.0 to 1.15.0 or higher.

  2. In Cloud Manager, set the pipeline variable CM_DISABLE_BUILD_REUSE to true to disable reuse of previous build artifacts.

  3. Add cleanup steps to your pipeline configuration before the main build starts:

    • Delete the ui.frontend/dist directory.
    • Delete the ui.frontend/target directory.
    • Delete the ui.frontend/node_modules/.cache directory.
  4. Ensure all Maven plugins in pom.xml have explicit version numbers.

  5. Confirm that all referenced dependencies are available and accessible in your Maven repository.

  6. Trigger a new pipeline execution and verify successful completion without errors or references to deleted files.

Note: If compilation errors persist, review SCSS imports and variable definitions for completeness and accuracy before triggering a new build.

recommendation-more-help
3d58f420-19b5-47a0-a122-5c9dab55ec7f