[ 
https://issues.apache.org/jira/browse/MENFORCER-195?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16920214#comment-16920214
 ] 

Falko Modler edited comment on MENFORCER-195 at 8/31/19 9:02 PM:
-----------------------------------------------------------------

[~rfscholte]:

I did some more testing and I think I can confirm that wildcard exclusions are 
indeed not working for my setup either way (3.6.1 and 3.6.2).
The surprising thing is that this:
{code:xml}
        <dependency>
            <groupId>some.group.id</groupId>
            <artifactId>common-test</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.hibernate</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.jboss.weld</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.javassist</groupId>
                    <artifactId>javassist</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.javassist</groupId>
            <artifactId>javassist</artifactId>
            <version>${version.javassist}</version>
            <scope>test</scope>
        </dependency>
{code}
yields the expected enforcer result (ok) with Maven 3.6.1 but it _fails_ with 
Maven 3.6.2!
With Maven 3.6.2 I have to move the {{javassist}} exclusion to the top (before 
{{weld}} and {{hibernate}}) to make it work:
{code:xml}
        <dependency>
            <groupId>some.group.id</groupId>
            <artifactId>common-test</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.javassist</groupId>
                    <artifactId>javassist</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.hibernate</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.jboss.weld</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.javassist</groupId>
            <artifactId>javassist</artifactId>
            <version>${version.javassist}</version>
            <scope>test</scope>
        </dependency>
{code}
Does that make sense?
I mean in the end, if Maven 3.6.2 only leads to this strange effect in 
enforcer-plugin (which needs adjustment anyway) then ok.
I just want to make sure Maven 3.6.2 did not introduce some strange general 
side-effect...

PS: The reasoning behind the exclusion of {{hibernate}} and {{weld}} is to 
prevent the usage of these Frameworks with the newer and thus possibly 
incompatible {{javassist}} version.


was (Author: famod):
[~rfscholte]:

I did some more testing and I think I can confirm that wildcard exclusions are 
indeed not working for my setup either way (3.6.1 and 3.6.2).
The surprising thing is that this:
{code:xml}
        <dependency>
            <groupId>some.group.id</groupId>
            <artifactId>common-test</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.hibernate</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.jboss.weld</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.javassist</groupId>
                    <artifactId>javassist</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.javassist</groupId>
            <artifactId>javassist</artifactId>
            <version>${version.javassist}</version>
            <scope>test</scope>
        </dependency>
{code}
yields the expected enforcer result (ok) with Maven 3.6.1 but it _fails_ with 
Maven 3.6.2!
With Maven 3.6.2 I have to move the {{javassist}} exclusion to the top (before 
{{weld}} and {{hibernate}}) to make it work.
{code:xml}
        <dependency>
            <groupId>some.group.id</groupId>
            <artifactId>common-test</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.javassist</groupId>
                    <artifactId>javassist</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.hibernate</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.jboss.weld</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.javassist</groupId>
            <artifactId>javassist</artifactId>
            <version>${version.javassist}</version>
            <scope>test</scope>
        </dependency>
{code}
Does that make sense?
I mean in the end, if Maven 3.6.2 only leads to this strange effect in 
enforcer-plugin (which needs adjustment anyway) then ok.
I just want to make sure Maven 3.6.2 did not introduce some strange general 
side-effect...

PS: The reasoning behind the exclusion of {{hibernate}} and {{weld}} is to 
prevent the usage of these Frameworks with the newer and thus possibly 
incompatible {{javassist}} version.

> Dependency convergence does not support wildcard exclusions
> -----------------------------------------------------------
>
>                 Key: MENFORCER-195
>                 URL: https://issues.apache.org/jira/browse/MENFORCER-195
>             Project: Maven Enforcer Plugin
>          Issue Type: Bug
>          Components: Plugin
>    Affects Versions: 1.3.1
>         Environment: Maven 3.2.1
>            Reporter: Tomaz Cerar
>            Priority: Major
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> Maven 3.2 introduced wildcard exclusions for dependencies.
> But if you use them dependencyConvergence wrongly complains about conflicting 
> transitive dependencies.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

Reply via email to