Closed Nimisha94 closed 6 years ago
Can you please share some example output here?
Now the output looks something like this -
LGTM, with one small comment. I wonder if @jhaber has more thoughts on formatting the output.
It could be worth taking a look at how the custom banned dependencies message is displayed and checking that this is consistent. I also wonder about putting more newlines in between the log messages.
Awesome! How does it look if the custom message is multiline?
Multiline message -
And if a user doesn't set any custom messages?
If a user doesn't give
I think we should probably check if the custom message is null before calling log.warn
I tweaked the code to display the custom message only if given. So, the blank line above doesn't show up even if the user doesn't set any custom messages. For example, looks like this if the user doesn't set <unmanagedDependencyMessage>
in the pom file
I think we should also omit the log.warn("");
if there are no messages to print. One approach could be to add the messages we want to print to a list instead of log.warn
ing them immediately. Then we could log the empty line only when we have messages to print.
Yes. I was thinking of logging it only when the success flag is false (which happens when there is some dependency or plugin issue).
I changed the code to display the custom messages only if present by adding them to a list before logging them as warnings. The output is looks like this (if custom messages are given)-
The output looks like this if the custom messages are not given -
Nice, I think this looks great! Have you experimented with adding more newlines / indentation? What do you think about
[WARNING] Found version mismatches in managed dependencies:
[WARNING] Custom version mismatch message
Yes. It's behaving in the similar way as the bannedDependencies custom messages has been implemented by the Apache plugin.
Multi-line message without any spaces at the beginning of the second line would be shown this way
[WARNING] Found version mismatches in managed dependencies : Custom message line 1.
Custom message line 2
Output look like this now
Given any custom message -
No custom messages given -
LGTM w/ tweak
This PR provides support to pass custom error messages for the following errors -