extra-enforcer-rules
extra-enforcer-rules copied to clipboard
Report artifact info
When an error occurs, this information is provided by handleArtifacts.
For warnings, the only information is the information provided by the getLog().warn() call itself.
Without this change, the following output is common:
[INFO] --- maven-enforcer-plugin:3.0.0-M2:enforce (display-info) @ acceptance-test-harness ---
[WARNING] Invalid bytecodeVersion for module-info.class: expected 52, but was 53
[WARNING] Invalid bytecodeVersion for module-info.class: expected 52, but was 53
[WARNING] Invalid bytecodeVersion for module-info.class: expected 52, but was 53
[WARNING] Invalid bytecodeVersion for module-info.class: expected 52, but was 53
[WARNING] Invalid bytecodeVersion for module-info.class: expected 52, but was 53
[WARNING] Invalid bytecodeVersion for module-info.class: expected 52, but was 53
[WARNING] Invalid bytecodeVersion for module-info.class: expected 52, but was 53
@jsoref can you confirm which version of extra-enforcer-rules you're using?
This should not be reported anymore since https://github.com/mojohaus/extra-enforcer-rules/pull/36
@batmat: I have no idea how to answer your question.
That said, I claim that my patch is correct, because even if it doesn't happen today due to some hand waving the code is still incredibly unhelpful and should be fixed. It's also buggy in that in theory it could complain about the major version when the problem is only the minor version.
@jsoref, first of all, thanks for creating a PR.
- As far as I understand your patch, all it does is to repeat the artifact's coordinate.
- However, you normally know in which project you currently run Maven and
- the
[INFO]line above the warnings shows theartifactIdso I do not see the immediate need for repetition of information unless you always run Maven in quiet mode, thengroupId:artifactIdcould be handy. - You stated something about major/minor, that I do not understand. As far as I know the bytecode version only changes between major Java versions, i.e. stay the same between 1.8.0_132 and 1.8.0_242 resp. 11.0.2 and 11.0.6.
@mfriedenhagen:
- I guess? All that the current code does is repeat an incomprehensible warning
- I almost never know the thing that's running maven because I'm usually making PRs to random repositories and having random CIs call maven.
- There's no reason for a random user reading a random log to realize that the info above is remotely related to the next line. That isn't how well behaved programs work.
- I don't know that this is a promise. Maybe it is, maybe it isn't.