You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by David Hoffer <dh...@gmail.com> on 2022/04/26 23:34:50 UTC

exclusions are not being applied

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

Re: exclusions are not being applied

Posted by David Hoffer <dh...@gmail.com>.
I thought I had tried that option and had the same issue but I just tried
that again and it worked so I must have looked at the results incorrectly.

Thanks, much for the help.

Love to see this feature in Maven.

-Dave

On Tue, Apr 26, 2022 at 5:41 PM Jacques Etienne Beaudet <je...@gmail.com>
wrote:

> 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 <dh...@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
>

Re: exclusions are not being applied

Posted by Karl Heinz Marbaise <kh...@gmx.de>.
Hi,

On 27.04.22 01:40, Jacques Etienne Beaudet wrote:
> 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

This is related to dependencyManagement and import scope (for BOM's)...

Not to that case.

Kind regards
Karl Heinz Marbaise
>
> Exclude it when you include the dependency in the meantime.
> On Apr 26, 2022, 7:35 PM -0400, David Hoffer <dh...@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
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: exclusions are not being applied

Posted by Jacques Etienne Beaudet <je...@gmail.com>.
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 <dh...@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