Collection<ArtifactResult> results = Collections.emptyList();
// Set the dependency selector used in resolving transitive dependencies based on our transitive exclusion
// policy abstraction
final Set<DependencySelector> dependencySelectors = new HashSet<DependencySelector>(3);
final TransitiveExclusionPolicy transitiveExclusionPolicy = strategy.getTransitiveExclusionPolicy();
final ScopeType[] filteredScopes = transitiveExclusionPolicy.getFilteredScopes();
final int numFilteredScopes = filteredScopes.length;
final String[] filteredScopeStrings = new String[numFilteredScopes];
for (int i = 0; i < numFilteredScopes; i++) {
filteredScopeStrings[i] = filteredScopes[i].toString();
}
if (numFilteredScopes > 0) {
dependencySelectors.add(new ScopeDependencySelector(filteredScopeStrings));
}
if (!transitiveExclusionPolicy.allowOptional()) {
dependencySelectors.add(new OptionalDependencySelector());
}
dependencySelectors.add(new ExclusionDependencySelector());
final DependencySelector dependencySelector = new AndDependencySelector(dependencySelectors);
session.setDependencySelector(dependencySelector);