daekene opened a new issue, #546: URL: https://github.com/apache/maven-build-cache-extension/issues/546
### New feature, improvement proposal Other tools can't reliably tell whether a module was restored from the build cache: build observability tools such as the [OpenTelemetry Maven extension](https://github.com/open-telemetry/opentelemetry-java-contrib/tree/main/maven-extension), CI reporting, or other extensions. The outcome only appears in two places: - log lines, which are meant for humans and change between releases - `target/maven-incremental/cache-report.*.xml`, which is written in `afterSessionEnd`, after every `ExecutionListener` callback has already fired Mojos skipped on a cache hit also never reach the `ExecutionListener`, so a listener can't work out the outcome itself. **Proposal:** record the outcome on the `MavenProject` as context values, before any of the project's mojos run: | Key | Values | |---|---| | `maven.build.cache.status` | `HIT`, `PARTIAL_HIT`, `MISS`, `RESTORE_FAILED`, `SKIPPED`, `DISABLED` | | `maven.build.cache.source` | `LOCAL` / `REMOTE` on a hit, otherwise `null` | - **When they can be read:** by a later mojo in the same project (including `runAlways` mojos on a hit), by downstream projects, and by `ExecutionListener.projectSucceeded`/`projectFailed`. - **Small change:** no model, configuration or behaviour changes. -- 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]
