gnodet opened a new pull request, #12885:
URL: https://github.com/apache/maven/pull/12885

   ## Summary
   
   Adds web-based build report viewing to `mvnlog` (addresses #12645), rebased 
cleanly on the `feature/mvnlog` PR chain (#12694 → #12695 → #12697 → #12698 → 
#12699):
   
   - **`--web` flag** starts a local HTTP server bound to loopback only (not 
0.0.0.0)
   - **`--port`** configures the server port (default 8080, auto-fallback to 
random available port)
   - **Interactive HTML viewer** with filtering, search, and report history
   - **Security**: path traversal protection via regex + 
`normalize().startsWith()` checks
   - **Graceful shutdown** via `CountDownLatch` after 30 minutes of inactivity 
(no `System.exit()`)
   - **Auto-opens browser** on supported desktops (best-effort, ignored if 
headless)
   - **Build report opt-out** via `-Dmaven.build.report.skip=true`
   - **Report directory** changed to `target/build-reports/` with 
`build-report-latest.json` copy
   
   ### Review feedback addressed (from #12716)
   
   - Removed Google Fonts CDN links → system font stack
   - Use `LogEvent` API (`event.level().name()`, `event.timestamp()`, 
`event.message()`) instead of string parsing
   - Use `Collections.synchronizedList(new ArrayList<>())` instead of 
`CopyOnWriteArrayList` for performance
   - Fix `@since 4.0.0` → `@since 4.1.0` in `package-info.java`
   - `lastRequestTime` is an instance field (not static)
   - Added `mojoFinished(ExecutionEvent, String)` to `BuildEventListener` 
interface
   - Updated all implementations and tests for the new interface signatures
   
   ### Files changed
   
   | Area | Files |
   |------|-------|
   | API | `LogOptions.java` (added `web()`, `port()`), `package-info.java` 
(fixed `@since`) |
   | CLI | `CommonsCliLogOptions.java`, `LogInvoker.java`, `report.html` |
   | Core | `BuildEventListener.java`, `BuildReportEventListener.java`, 
`LoggingExecutionListener.java`, `SimpleBuildEventListener.java` |
   | Tests | `MachineBuildEventListenerTest.java`, 
`RichBuildEventListenerTest.java` |
   
   ## Test plan
   
   - [ ] `mvn verify -pl impl/maven-cli -am -DskipTests` compiles cleanly 
(verified locally)
   - [ ] `mvn test -pl impl/maven-cli -am` passes (4 pre-existing 
MavenInvokerTest failures unrelated to this PR)
   - [ ] `mvnlog --web` starts HTTP server on localhost:8080
   - [ ] `mvnlog --web --port 9090` uses custom port
   - [ ] Port fallback works when preferred port is busy
   - [ ] Path traversal attempts return 400 Bad Request
   - [ ] Server auto-shuts down after 30 minutes of inactivity
   - [ ] `-Dmaven.build.report.skip=true` prevents report generation
   - [ ] Report files written to `target/build-reports/`
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
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]

Reply via email to