Skip to content

feat: add default Maintenance Window definition #1272

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

bkkothari2255
Copy link

Description

  • Introducing the default configuration for the Maintenance Window in the AEM Project Archetype.

  • Added the default.maintenancewindow.json file under /conf/<project>/settings/granite/operations/maintenance.

  • Defines a weekly maintenance window, scheduled every

    Sunday from 3 AM to 4 AM UTC.

  • Ensures the configuration is context-aware and will be applied automatically to both Author and Publish instances.

Related Issue

Issue: Include AEM Maintenance Task configurations in Archetype #274

Motivation and Context

This change is required to help streamline the maintenance window configuration in generated AEM projects. It aligns with AEM's Granite Maintenance Framework and applies the maintenance window to both Author and Publish instances.

By including this in the archetype, it allows projects to easily adopt routine maintenance scheduling, promoting consistency across AEM environments.

How Has This Been Tested?

  • Built the archetype locally using mvn clean install

  • Generated a new AEM project from the archetype:

mvn archetype:generate -DarchetypeCatalog=local

  • Verified that the default.maintenancewindow.json file is created in the correct location:

/conf/<project>/settings/granite/operations/maintenance/.

  • Confirmed that the configuration is applied automatically for both Author and Publish environments.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Added `com.adobe.granite.maintenance.task.versionpurge.cfg.json` under `config.author` to enable the Version Purge task by default. 

- Runs every Sunday at 3 AM
- Targets `/content` path
- Purges versions older than 30 days
- Scoped to Author runmode via `config.author`

This improves out-of-the-box maintenance readiness for generated AEM projects.
Updated `task.name` in the Version Purge OSGi config to include the `${projectName}` archetype variable. This ensures the generated project has a context-specific label for the maintenance task.

Example: "Mysite Version Purge"
Added `default.maintenancewindow.json` under `/conf/<project>/settings/granite/operations/maintenance` to define the default maintenance window. 

- Configures a weekly maintenance window every Sunday from 3 AM to 4 AM UTC.
- Ensures context-aware configuration for both Author and Publish instances.
- Helps automate routine maintenance tasks and aligns with AEM best practices.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant