feat: add execution ID parameter to failing spotless check log
for improved error messaging, issue #1988
- Introduced a new parameter
executionIdto capture the execution ID from Maven's configuration. - Updated error messages to include the execution ID when suggesting commands to fix format violations.
- Enhanced test cases to validate the new behavior of error messages based on the execution ID.
Maven always adds an execution id even if it is not configured in the pom file. I used a debugger and implemented a heuristic better separating user specified execution ids from maven generated ones. Now I assume execution id "default" or starting with "default-" like "default-cli" to be automatically added and do not mention them in the generated output. Unfortunately, I have not found a direct access to the xml after it was processed by the maven xml parser because the parser does not generate any DOM.
This needs a spotlessApply, but once CI passes this LGTM. Before I merge, I'd like one of our established maven contributors to give it a thumbs-up first. I am not maven-literate-enough to understand the debate above. I'll publish a set of releases once this either gets merged or rejected.
I'm open to merging this, but it needs to pass CI, and it needs signoff from an existing maven contributor.