Analyze an AEM dispatcher module for violations of best practices, and report a list of actionable optimizations.
The dispatcher is a critical component of a secure, stable, and lightning fast AEM implementation. Unfortunately it is often an afterthought, and its large array of configurations can be overwhelming and easily misconfigured.
This repository offers a tool (implemented as both a Maven Plugin and standalone app) which performs static analysis of the dispatcher module of an AEM archetype based project. It can identify:
- Syntax issues such as misplaced tokens, unmatched quotes, or missing files referenced from
Include
directives - Violations of best practices including checks for
/filter
deny rules,/statfileslevel
,/gracePeriod
and more
Don't agree with one of the rules? Wish there was a check for /propertyX
? Use the extensible rules engine to augment (or completely replace) the core set of rules to meet your exact needs.
This repository does not attempt to suggest or prescribe a one-size-fits-all configuration for the dispatcher. Due to the myriad use cases that AEM supports, it would be impossible to do so. Instead, we attempt to identify syntax issues and known violations of best practices that can, when corrected, make your AEM environment more resilient and performant.
- core - Core code shared between the Plugin and App
- app - Spring Boot app implementation and Dockerfile
- plugin - Maven plugin implementation
- plugin-it - Maven plugin integration tests
mvn clean install
Refer to the Plugin README.
Refer to the App README.
- The "core rules" can be found here: core-rules.json
- The spec of the Rules file can be found here: Rules
- Entry point for the Maven plugin implementation: AnalyzerMojo
- Entry point for the Spring Boot app implementation: DispatcherOptimizerApplication
- DispatcherConfiguration model class: DispatcherConfiguration
- Test cases which exercise the core Parser code: ConfigurationParserTest
- Test cases which exercise the core Rule Processor code: com/adobe/aem/dot/common/analyzer/rules
- Install the Lombok plugin for your IDE
From the project root:
mvn -N -Darguments=-N release:prepare
mvn -N -Darguments=-N release:perform
Contributions are welcomed! Read the Contributing Guide for more information.
This project is licensed under the Apache V2 License. See LICENSE for more information.