Exclusions are not yet supported at the dependencyManagement level. See https://stackoverflow.com/questions/39276024/import-dependency-management-with-exclusion for more informations or the corresponding unmerged PR https://github.com/apache/maven/pull/295
Exclude it when you include the dependency in the meantime. On Apr 26, 2022, 7:35 PM -0400, David Hoffer <dhoff...@gmail.com>, wrote: > 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