gnodet commented on PR #13276:
URL: https://github.com/apache/maven/pull/13276#issuecomment-6046970501
I pushed three improvements on top of this PR:
**1. Suppress resolver noise in text mode**
`configureLogging` now forces resolver logging to ERROR level in both text
and JSON modes (unless `-X`/`-e` is passed). Previously only JSON mode silenced
it; text output was cluttered with lines like `[INFO] Loaded 24013
auto-discovered prefixes from ...` that have nothing to do with POM validation.
**2. Extract line/column from `XmlReaderException`**
`DefaultModelBuilder.add()` now falls back to
`XmlReaderException.getLocation()` when no `InputLocation` is present on the
problem. Parser failures like `Duplicated tag: 'relativePath'` carry the
location in the exception but it was never consulted, so the FATAL problem was
reported without any line or column number.
**3. XML source context display (`-C` / `--context`)**
`TextReporter` now shows N lines of surrounding XML source around each
problem location (default 2, configurable via `-C N` / `--context N`, disabled
with `-C 0`). The problem line is marked with `>` and rendered in bold.
Severity labels are colored (red for ERROR/FATAL, yellow for WARNING) when the
terminal supports ANSI color — using `MessageUtils.isColorEnabled()` directly
rather than `context.coloredOutput`, which stays `null` in auto mode until
JLine resolves it from the terminal type.
Example output:
```
/path/to/pom.xml:
FATAL Non-parseable POM: Duplicated tag: 'relativePath' @ line 6, column 5
5 | <relativePath/>
> 6 | <relativePath/>
7 | </parent>
```
--
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]