Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.

AEM as a Cloud Service & Java 11 Pipelines | AEM Community Blog Seeding

Avatar

Administrator

BlogImage.jpg

AEM as a Cloud Service & Java 11 Pipelines by The AEM Maven - Juan Ayala

Abstract

Recently I started a new AEM as a Cloud Service project. The first thing I did was generate a new repository using the Maven archetype. I assumed it would be using Java 11 from the get-go. I came to learn it did not! Here are 3 things you'll need to get your AEMaaCS project ready for Java 11.


Update the Project to Use Java 11

As soon as I started to write Java code IntelliJ began screaming at my var. I love the var keyword in Java. The type inference speeds things up a lot. We need to update the root POM file. Set the Java version to 11 on the maven-enforcer-plugin and maven-compiler-plugin plugins.



org.apache.maven.plugins
maven-enforcer-plugin


...


...

Maven must be executed with a Java 11 JRE or higher.
11







org.apache.maven.plugins
maven-compiler-plugin

11
11



Your IDE should pick up on the POM changes and switch the project to Java 11. That was easy! On to the next step.


Make Sure Maven Is Using Java 11

Once I was done making my changes I opened up a terminal and tried to run mvn clean install -P autoInstallSinglePlackage to get everything deployed. The enforcer I had configured denied me. I ran mvn --version and sure enough, Maven was using Java 8.

Read Full Blog

AEM as a Cloud Service & Java 11 Pipelines

Q&A

Please use this thread to ask the related questions.



Kautuk Sahni
2 Replies

Avatar

Community Advisor

Just moved to AEM as a Cloud, will keep this in mind while migration.

Avatar

Community Advisor

Recently , my build was failing with the same error

Maven must be executed with a Java 11 JRE or higher 

This blog https://www.theaemmaven.com/post/aem-as-a-cloud-service-java-11-pipelines was useful in understnading the issue. To know how to create the file refer https://www.tothenew.com/blog/resolving-adobes-cloud-manager-deployment-issue-with-java-version-comp...