dotCMS / dotCMS/core

fix(mvn): restore maven-build-cache-config.xml accidentally deleted in Postgres 18 upgrade

Open Beginner friendly
#34,885 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

dotCMS : Build stale
Dominant language
Java
Stars
970
Forks
486
Avg merge
3d 33m
Merged PRs (30d)
170

Description

Summary

The .mvn/maven-build-cache-config.xml file was accidentally deleted and added to .gitignore in #34236 (Postgres 18 upgrade, commit 6cdf24645d0). The maven-build-cache-extension registration in .mvn/extensions.xml was left intact, so the plugin is still active but now runs with its default configuration — which enables caching by default. This causes over-caching and unpredictable build behavior for all developers.

Root Cause

  • Introduced in: 4acd429b408feat(mvn): incorporate maven build cache plugin (#29410)
    • Config was added with <enabled>false</enabled> (opt-in by design)
  • Accidentally deleted + gitignored in: 6cdf24645d0feat(task): upgrade to Postgres 18 (#34236)
    • Extension registration in .mvn/extensions.xml was left in place

Risk of Enabling Without Careful Configuration

Without correct input configuration, the cache can serve stale artifacts when inputs change in ways the glob patterns don't capture (e.g. environment variables, generated sources, resource filtering). This produces builds that appear to succeed but contain incorrect or inconsistent output — which is significantly harder to diagnose than a clean build failure.

This is why <enabled>false</enabled> is the right default. The current input glob patterns have not been fully validated for this codebase and should be reviewed before enabling the cache more broadly.

Opt-in Options for Developers

Developers who understand the trade-offs can enable caching locally:

Per-build:

./mvnw install -Dmaven.build.cache.enabled=true

Persistently (user-level, not committed) — add to ~/.m2/maven.config:

-Dmaven.build.cache.enabled=true

Custom config file — to use your own tuned configuration:

-Dmaven.build.cache.configPath=/Users/you/.m2/maven-build-cache-config.xml

Proposed Fix

Restore .mvn/maven-build-cache-config.xml with <enabled>false</enabled> and remove it from .gitignore. A follow-up issue should review and improve the input configuration before considering broader enablement.

Checklist

  • Restore .mvn/maven-build-cache-config.xml with enabled=false
  • Remove file from .gitignore
  • Verify no CI pipeline relies on cache being enabled
  • Create follow-up issue for cache configuration improvements

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Inspect the Postgres 18 upgrade changes, .mvn/extensions.xml, and .gitignore to confirm the deleted cache configuration and remaining extension registration. Restore .mvn/maven-build-cache-config.xml with enabled=false, remove its ignore entry, and verify the listed CI and Maven behavior checks.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system, tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
70/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.