I have a project where I am trying to use exclusions to exclude transitive
dependencies but they are not being excluded.  Here is an example from my
dependencyManagement top level pom.

<dependencyManagement>
<dependency>
    <groupId>com.bs.component-library.model</groupId>
    <artifactId>model</artifactId>
    <version>${model.version}</version>
    <exclusions>
        <exclusion>
            <groupId>io.swagger.core.v3</groupId>
            <artifactId>swagger-jaxrs2</artifactId>
        </exclusion>
    </exclusions>
</dependency>
</dependencyManagement>

Then in the build this is in the dependency section.
  <dependency>
    <groupId>com.bs.component-library.model</groupId>
    <artifactId>model</artifactId>
</dependency>

However when I run mvn dependency:tree

I still see  io.swagger.core.v3:swagger-jaxrs2:jar:2.1.11:compile as a
first level dependency under the <artifactId>model</artifactId> dependency.

Why is it not being excluded?

-Dave

Reply via email to