Skip to content

Commit

Permalink
Fix #314 ErrorRemedy.xmlOutput should log the issues on error level r…
Browse files Browse the repository at this point in the history
…ather than debug
  • Loading branch information
ppalaga committed Mar 27, 2019
1 parent c320755 commit f8d1b1a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1205,7 +1205,7 @@ private void downloadLicenses( LicenseDownloader licenseDownloader, ProjectLicen

if ( matchingUrlsOnly && ( depProject.getLicenses() == null || depProject.getLicenses().isEmpty() ) )
{
handleError( depProject, "No license information available for: " + depProject );
handleError( depProject, "No license information available for: " + depProject.toGavString() );
return;
}

Expand All @@ -1215,7 +1215,7 @@ private void downloadLicenses( LicenseDownloader licenseDownloader, ProjectLicen
if ( matchingUrlsOnly && license.getUrl() == null )
{
handleError( depProject, "No URL for license at index " + licenseIndex + " in dependency "
+ depProject.toString() );
+ depProject.toGavString() );
}
else if ( license.getUrl() != null )
{
Expand Down Expand Up @@ -1308,20 +1308,20 @@ else if ( licenseOutputFile.exists() )
}
catch ( URISyntaxException e )
{
handleError( depProject, "POM for dependency " + depProject.toString()
handleError( depProject, "POM for dependency " + depProject.toGavString()
+ " has an invalid license URL: " + licenseUrl );
getLog().debug( e );
}
catch ( FileNotFoundException e )
{
handleError( depProject, "POM for dependency " + depProject.toString()
handleError( depProject, "POM for dependency " + depProject.toGavString()
+ " has a license URL that returns file not found: " + licenseUrl );
getLog().debug( e );
}
catch ( IOException e )
{
handleError( depProject, "Unable to retrieve license from URL '" + licenseUrl + "' for dependency '"
+ depProject.toString() + "': " + e.getMessage() );
+ depProject.toGavString() + "': " + e.getMessage() );
getLog().debug( e );
}
}
Expand Down Expand Up @@ -1363,7 +1363,7 @@ private void handleError( ProjectLicenseInfo depProject, String msg ) throws Moj
case failFast:
throw new MojoFailureException( msg );
case xmlOutput:
getLog().debug( msg );
getLog().error( msg );
depProject.addDownloaderMessage( msg );
break;
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ public void loadProjectDependencies( ResolvedProjectDependencies artifacts,
}
catch ( ProjectBuildingException e )
{
laBuilder.errorMessage( e.getClass().getSimpleName() + ": " + e.getMessage() );
laBuilder.errorMessage( "Could not create effective POM for '" + id + "': "
+ e.getClass().getSimpleName() + ": " + e.getMessage() );
}

depMavenProject = laBuilder.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,11 @@ public String toString()
return getId();
}

public String toGavString()
{
return groupId + ":" + artifactId + ( version == null ? "" : ( ":" + version ) );
}

/**
* {@inheritDoc}
*/
Expand Down

0 comments on commit f8d1b1a

Please # to comment.