{
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 );