AEM 6.4 Pattern Detector
A recurring task involved with Adobe Experience Manager upgrades is preparing the current AEM implementation against the target AEM version. Until AEM 6.4, this was a completely manual process that involved combing through the current AEM implementation for deprecations. Now, in AEM 6.4, there is a new feature called the “Pattern Detector” that automatically analyzes the current implementation and then generates a list of upgrade incompatibilities. The following article will outline the steps involved with running the Pattern Detector on a standalone AEM 6.3 author instance by: launching the author instance, creating an Adobe Maven Archetype 11 project, deploying the code to the author instance, developing a template that violates AEM6.4 standards, installing the Pattern Detector, and running the Pattern Detector.
Launching the author instance
Obtain a copy of the AEM 6.3 jar and license. Rename the jar file so that it is “aem-author-4502.jar”. Place the jar file in a folder where you want to deploy the AEM application. Open a terminal or command prompt, navigate to the folder where you placed the jar file, and run the command “java -jar aem-author-4502.jar -unpack”. Execute “./crx-quickstart/bin/quickstart”.
Creating an Adobe Maven Archetype 11 project
Follow the steps outlined in this URL to create an Adobe Maven Archetype 11 project and import it into Eclipse: https://adobe.ly/2HHBmmr
Deploying the code to the author instance
Deploy the code to the author instance by executing “mvn -PautoInstallPackage install”.
Developing a template that violates AEM 6.4 standards
Create a new template beneath /apps/AEM63App/templates by right-clicking the aforementioned folder and selecting “Create” and then “Create Template” from the menu. The “Label”, “Title”, and “Description” should all be “Test”. Enter “cq:Template” as the “Resource Type” and select “Next”, “Next”, “Next”, “OK.” Right-click the jcr:content node beneath “Test” and select “Create” and then “Create Node”. The name of the node should be “captcha” and the type should be “nt:unstructured”. Only the newly created node, add a property called “sling:resourceType” of Type “String” and set the Value to “foundation/components/form/captcha”. Click the Save All button.
Installing the Pattern Detector
Log into Adobe Package Share and then navigate to this link: https://bit.ly/2LgX8vD. Select the Assets tab and download the package. Navigate to http://localhost:4502/crx/packmgr, upload, and install the package.
Running the Pattern Detector
Navigate to http://localhost:4502/system/console. Hover over the Status option in the menu and select Pattern Detector from the drop-down. In the results you should see the following entry that indicates an incompatibility “Cross-boundary resource type usage of internal marked path /libs/foundation/components/form/captcha referenced at /apps/AEM63App/templates/test/jcr:content/captcha”. This captcha component is problematic because it references the /libs form of the component. Adobe stores the implementation of the out of the box component in the /libs folder. In this case, if the out of the box component changes, the dependent component will change and may break.
This article explained how to obtain, install, and use Adobe’s new Pattern Detector. The Pattern Detector will help to catch issues during the analysis phase of an AEM upgrade. Do not rely solely on the Pattern Detector to catch all upgrade issues. There is still value in performing a manual analysis of the application. Augment manual analysis with the Pattern Detector to have the greatest chance of catching all upgrade issues.< Back to Blogs