gnodet commented on PR #12690: URL: https://github.com/apache/maven/pull/12690#issuecomment-5464490499
Applied review fixes from #12694 to align the backport: **1. `Log.java` — default trace methods (prevents `AbstractMethodError`)** All 6 trace methods (`isTraceEnabled` + 5 overloads) now have `default` implementations — `isTraceEnabled()` returns `false` by default, all `trace(...)` overloads are no-ops. This prevents `AbstractMethodError` for existing third-party `Log` implementors (even though `@Experimental`+`@Provider`, this is the safe thing to do). **2. `ProjectBuildLogAppender` — fork-aware mojoId** Added `FORKING_MOJO_ID` ThreadLocal mirroring the existing `FORKING_PROJECT_ID` pattern. When `setMojoId(null)` is called after a fork completes, the forking mojo's ID is restored instead of simply clearing. This fixes the case where a forking mojo (e.g. a report goal) resumes after its fork — log messages during the resumed execution now correctly carry the mojo ID. **3. `LoggingExecutionListener` — fork save/restore + cleanup ordering** - `forkStarted()` now saves the current mojoId via `setForkingMojoId()` - `forkSucceeded()`/`forkFailed()` clear the forking mojoId - `mojoSucceeded()`/`mojoFailed()` now run the delegate *before* clearing the MDC (matching #12694's ordering) Build: compiles cleanly and passes all maven-core tests (562 tests, 2 pre-existing failures unrelated to logging). -- 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]
