sourceDependencyCacheDir.mkdirs();
}
}
catch ( IOException e )
{
throw new MavenReportException(
"Failed to delete cache directory: " + sourceDependencyCacheDir + "\nReason: " + e.getMessage(), e );
}
final SourceResolverConfig config = getDependencySourceResolverConfig();
final AndArtifactFilter andFilter = new AndArtifactFilter();
final List<String> dependencyIncludes = dependencySourceIncludes;
final List<String> dependencyExcludes = dependencySourceExcludes;
if ( !includeTransitiveDependencySources || isNotEmpty( dependencyIncludes ) || isNotEmpty(
dependencyExcludes ) )
{
if ( !includeTransitiveDependencySources )
{
andFilter.add( createDependencyArtifactFilter() );
}
if ( isNotEmpty( dependencyIncludes ) )
{
andFilter.add( new PatternIncludesArtifactFilter( dependencyIncludes, false ) );
}
if ( isNotEmpty( dependencyExcludes ) )
{
andFilter.add( new PatternExcludesArtifactFilter( dependencyExcludes, false ) );
}
config.withFilter( andFilter );
}
try
{
return ResourceResolver.resolveDependencySourcePaths( config );
}
catch ( final ArtifactResolutionException e )
{
throw new MavenReportException(
"Failed to resolve one or more javadoc source/resource artifacts:\n\n" + e.getMessage(), e );
}
catch ( final ArtifactNotFoundException e )
{
throw new MavenReportException(
"Failed to resolve one or more javadoc source/resource artifacts:\n\n" + e.getMessage(), e );
}
}