Resolve Java Runtime version mismatch in AEM Production Pipeline
This article provides a solution for when Adobe Experience Manager (AEM) as a Cloud Service build and unit test stages fail due to a Java Runtime version mismatch. The solution involves downgrading the Maven Bundle Plugin and ensuring consistent environment configurations.
Description
Environment
Adobe Experience Manager (AEM) as a Cloud Service - Sites
Issue/Symptoms
During the build and unit test stages of the production pipeline for the main branch, failures occur. The error message indicates an API incompatibility due to a mismatch in Java Runtime versions used during Maven builds. The maven-bundle-plugin
version 6.0.0 needs Java 17, but AEM Cloud only supports Java 11, leading to an incompatibility.
Resolution
-
Downgrade Maven bundle plugin. Modify your
pom.xml
file under<build>
,<pluginManagement>
, and<plugins>
sections, and ensure you specify a compatible version ofmaven-bundle-plugin
. Recommended versions are 5.1.9 or lower since they support Java 8 and 11:<build> <pluginManagement> <plugins> ... <plugin> <groupId>org.apache.felix</groupId> <artifactId>maven-bundle-plugin</artifactId> <version>5.1.2</version> <inherited>true</inherited> </plugin> ... </plugins> </pluginManagement> </build>
-
If discrepancies persist between environments, consider clearing cached artifacts using appropriate APIs provided by Adobe’s cloud manager documentation. For steps, refer to Overview - Cloud Manager API in the Adobe developer documentation.
-
Check your codebase configuration (
pom.xml
) for any entries that might default to unsupported plugin versions. For steps, refer to Repository Structure Package in the AEM Project Structure User Guide. -
Confirm that both Development and Production pipelines use consistent configurations regarding dependencies and plugins.
If you have solved the compatibility issues for Java runtime requirements you should now be able to run build and unit tests successfully across all environments within AEM as a Cloud Service setup.