Skip to content
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

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

ercpe
Copy link
Contributor

@ercpe ercpe commented Feb 27, 2019

…og spam when using a shared missing file

#201

…reduce log spam when using a shared missing file
Copy link
Contributor

@ppalaga ppalaga left a 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

/**
* 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.

@guidograzioli
Copy link

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>
Copy link
Contributor Author

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." );
Copy link
Contributor Author

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.

@wuwu2000
Copy link

wuwu2000 commented Mar 3, 2020

postbuild integration tests seem to run not 100% stable -,.-

@wuwu2000
Copy link

wuwu2000 commented Mar 4, 2020

can someone tell me why some builds fail randomly?

@wuwu2000
Copy link

@ppalaga Could you see why this jdk7 build fails please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants