Skip to content

[MPMD-391] Log what developers care about and not what they don't #359

@jira-importer

Description

@jira-importer

Elliotte Rusty Harold opened MPMD-391 and commented

Here's output from a recent PMD plugin run that failed:

[INFO] >>> maven-pmd-plugin:3.21.2:check (default-cli) > :pmd @ commons-io >>>
[INFO]
[INFO] --- maven-pmd-plugin:3.21.2:pmd (pmd) @ commons-io ---
[INFO] PMD version: 6.55.0
[INFO] Rendering content with org.apache.maven.skins:maven-default-skin:jar:1.3 skin.
[INFO]
[INFO] <<< maven-pmd-plugin:3.21.2:check (default-cli) < :pmd @ commons-io <<<
[INFO]
[INFO]
[INFO] --- maven-pmd-plugin:3.21.2:check (default-cli) @ commons-io ---
[INFO] PMD version: 6.55.0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 05:22 min
[INFO] Finished at: 2024-01-14T14:11:30Z
[INFO] ------------------------------------------------------------------------
Error: Failed to execute goal org.apache.maven.plugins:maven-pmd-plugin:3.21.2:check (default-cli) on project commons-io: You have 1 PMD violation. For more details see: /home/runner/work/commons-io/commons-io/target/pmd.xml -> [Help 1]
Error:
Error: To see the full stack trace of the errors, re-run Maven with the -e switch.
Error: Re-run Maven using the -X switch to enable full debug logging.
Error:
Error: For more information about the errors and possible solutions, please read the following articles:
Error: [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
Error: Process completed with exit code 1.

Things I don't care about that are printed:

  • PMD version
  • Doxia skin
  • Blank lines
  • Total time
  • Timestamp when it finished
  • Generic information about Mojo failures
  • Exit code from Mojo

The one thing I care about:

  • The actual error that caused the failure

Everything in the first list can be hidden in some random log file no one will ever look at. Everything in the second list should be front and center. Instead Maven gets this exactly backwards,


Issue Links:

  • MNG-5693 Change logging of MojoExceptions to console

Remote Links:

0 votes, 7 watchers

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions