cowwoc opened a new pull request, #391:
URL: https://github.com/apache/maven-build-cache-extension/pull/391
Fixes #375
## Problem
Maven 4 auto-injects `--module-version ${project.version}` to `compilerArgs`
during cache storage but not during validation, causing parameter mismatches
and forcing rebuilds on every invocation for modules with `module-info.java`.
## Solution
Add `ignorePattern` attribute to `TrackedProperty` that filters array
elements using regex before comparison.
## Changes
1. **MDO Model** (`build-cache-config.mdo`): Add `ignorePattern` field to
`TrackedProperty`
2. **Reconciliation Logic** (`BuildCacheMojosExecutionStrategy.java`):
- `filterAndStringifyArray()` - filters runtime array values before
stringification
- `filterArrayString()` - filters cached string representations
- Apply filtering to both current and expected values before comparison
## Configuration Example
```xml
<reconcile propertyName="compilerArgs" ignorePattern="--module-version"/>
```
## Testing
Tested with multi-module JPMS project using Maven 4.0.0-rc-4:
- ✅ No parameter mismatches with `--module-version` present
- ✅ Cache correctly reused across builds
- ✅ Legitimate `compilerArgs` changes still invalidate cache
## Related Issues
- #375 - Maven 4 --module-version causes cache mismatches
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]