static Collection < MavenResolvedArtifact > postFilter ( final Collection < MavenResolvedArtifact > artifactResults ) { final MavenResolutionFilter postResolutionFilter = RestrictPomArtifactFilter . INSTANCE ; final Collection < MavenResolvedArtifact > filteredArtifacts = new ArrayList < MavenResolvedArtifact > ( ) ; final List < MavenDependency > emptyList = Collections . emptyList ( ) ; for ( final MavenResolvedArtifact artifact : artifactResults ) { final MavenDependency dependency = MavenDependencies . createDependency ( artifact . getCoordinate ( ) , ScopeType . COMPILE , false ) ; // Empty lists OK here because we know the RestrictPOM Filter doesn't consult them if ( postResolutionFilter . accepts ( dependency , emptyList , emptyList ) ) { filteredArtifacts . add ( artifact ) ; } } return Collections . unmodifiableCollection ( filteredArtifacts ) ; }
Run post - resolution filtering to weed out POMs .