Search in sources :

Example 11 with Exclusion

use of org.sonatype.aether.graph.Exclusion in project sonatype-aether by sonatype.

the class ExclusionDependencySelector method deriveChildSelector.

public DependencySelector deriveChildSelector(DependencyCollectionContext context) {
    Dependency dependency = context.getDependency();
    Collection<Exclusion> exclusions = (dependency != null) ? dependency.getExclusions() : null;
    if (exclusions == null || exclusions.isEmpty()) {
        return this;
    }
    Set<Exclusion> merged = new LinkedHashSet<Exclusion>();
    merged.addAll(this.exclusions);
    merged.addAll(exclusions);
    return new ExclusionDependencySelector(merged);
}
Also used : LinkedHashSet(java.util.LinkedHashSet) Exclusion(org.sonatype.aether.graph.Exclusion) Dependency(org.sonatype.aether.graph.Dependency)

Aggregations

Exclusion (org.sonatype.aether.graph.Exclusion)11 Dependency (org.sonatype.aether.graph.Dependency)9 Artifact (org.sonatype.aether.artifact.Artifact)6 Test (org.junit.Test)4 ArrayList (java.util.ArrayList)2 LinkedHashSet (java.util.LinkedHashSet)2 StubArtifact (org.sonatype.aether.test.util.impl.StubArtifact)2 Collection (java.util.Collection)1 HashMap (java.util.HashMap)1 DependencyManagement (org.sonatype.aether.collection.DependencyManagement)1 DefaultArtifact (org.sonatype.aether.util.artifact.DefaultArtifact)1