-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#201 - Reduce log level for unknown dependencies to debug to reduce l… #300
base: master
Are you sure you want to change the base?
Conversation
…reduce log spam when using a shared missing file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The proposed solution eliminates the warnings also for users that want to see them and I cannot accept it like this. I propose to solve the issue by adding a parameter much like we did in AbstractDownloadLicensesMojo
license-maven-plugin/src/main/java/org/codehaus/mojo/license/AbstractDownloadLicensesMojo.java
Lines 319 to 333 in 1a890f1
/** | |
* What to do on any license download related error. The possible values are: | |
* <li> | |
* <ul>{@link ErrorRemedy#ignore}: all errors are ignored</ul> | |
* <ul>{@link ErrorRemedy#warn}: all errors are output to the log as warnings</ul> | |
* <ul>{@link ErrorRemedy#failFast}: a {@link MojoFailureException} is thrown on the first download related | |
* error</ul> | |
* <ul>{@link ErrorRemedy#xmlOutput}: error messages are added as {@code <downloaderMessages>} to | |
* {@link AbstractDownloadLicensesMojo#licensesErrorsFile}; in case there are error messages, the build will | |
* fail after processing all dependencies</ul> | |
* </li> | |
* @since 1.18 | |
*/ | |
@Parameter( property = "license.errorRemedy", defaultValue = "warn" ) | |
protected ErrorRemedy errorRemedy; |
I'd recommend to add your own ErrorRemedy-like enum that would initially contain just warn
(default) and ignore
so that you not need to implement the other options we have in AbstractDownloadLicensesMojo.
Do not forget to add an integration test.
I'm interested in this change, is anybody currently working on it? Happy to help otherwise |
…ugin into 201-reduce-log-level # Conflicts: # src/main/java/org/codehaus/mojo/license/api/DefaultThirdPartyTool.java
/** | ||
* What to do on defined files not found in project. The possible values are: | ||
* <li> | ||
* <ul>{@link UnkownFileRemedy#debug}: unkown files are logged debug</ul> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo throughout the change Unkown -> Unknown
@@ -552,7 +554,7 @@ public SortedProperties loadUnsafeMapping( LicenseMap licenseMap, | |||
MavenProject project = artifactCache.get( id ); | |||
if ( project == null ) | |||
{ | |||
LOG.warn( "dependency [{}] does not exist in project.", id ); | |||
handleUnkownDependency(unkownFileRemedy, "dependency [" + id + "] does not exist in project." ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably cleaner to hand id
down to handleUnkownDependency
instead of passing the log message around.
postbuild integration tests seem to run not 100% stable -,.- |
can someone tell me why some builds fail randomly? |
@ppalaga Could you see why this jdk7 build fails please? |
…og spam when using a shared missing file
#201