Skip to content

Commit

Permalink
Fix #277 aggregate-add-third-party does not use missingFileUrl parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
balessandr authored and ppalaga committed Feb 23, 2019
1 parent e2a0f75 commit 13c9303
Showing 1 changed file with 18 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -862,22 +862,27 @@ void resolveUnsafeDependenciesFromArtifact( String groupId, String artifactId, S

void resolveUnsafeDependenciesFromFile( File missingLicenses ) throws IOException, MojoExecutionException
{
if ( missingLicenses != null && missingLicenses.exists() && missingLicenses.length() > 0 )
if ( missingLicenses == null )
{
// there are missing licenses available from the artifact
SortedProperties unsafeMappings = new SortedProperties( getEncoding() );
return;
}

if ( missingLicenses.exists() )
{
// load the missing file
unsafeMappings.load( missingLicenses );
}
if ( UrlRequester.isStringUrl( missingFileUrl ) )
{
String httpRequestResult = UrlRequester.getFromUrl( missingFileUrl );
unsafeMappings.load( new ByteArrayInputStream( httpRequestResult.getBytes() ) );
}
// there are missing licenses available from the artifact
SortedProperties unsafeMappings = new SortedProperties( getEncoding() );

if ( missingLicenses.exists() && missingLicenses.length() > 0 )
{
// load the missing file
unsafeMappings.load( missingLicenses );
}
if ( useMissingFile && UrlRequester.isStringUrl( missingFileUrl ) )
{
String httpRequestResult = UrlRequester.getFromUrl( missingFileUrl );
unsafeMappings.load( new ByteArrayInputStream( httpRequestResult.getBytes() ) );
}

if ( !unsafeMappings.isEmpty() )
{
Set<MavenProject> resolvedDependencies = new HashSet<>();
for ( MavenProject unsafeDependency : unsafeDependencies )
{
Expand Down

0 comments on commit 13c9303

Please sign in to comment.