Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aether-users] Exclusions on a dependency


Hello Aetherians,

I am trying to add a Dependency with an Exclusion, but the Exclusion does not appear to be applied with the dependencies are resolved. Here is the paraphrased code I am using based on what I figured out from the javadocs:

    Dependency dependency = new Dependency(new DefaultArtifact( "org.apache.tomcat:jasper:6.0.23" ), null);
    List<Exclusion> exclusions = new ArrayList<Exclusion>();
    exclusions.add( new Exclusion( "org.apache.tomcat", "catalina", null, null) );               
    dependency.setExclusions( exclusions );

The Exclusion does not affect the resolution, the org.apache.tomcat:catalina:6.0.23 jar is still included in the result.

The actual source is at https://github.com/mguymon/naether/blob/master/src/main/java/com/slackworks/naether/Naether.java ~ line 157-168. The addDependency method is for converting an org.apache.maven.model.Dependency into a org.sonatype.aether.graph.Dependency.

I have not tried source diving to figure this out, was hoping this is an easy fix. Any help is greatly appreciated.

thanks,
Michael


Back to the top