how to exclude all artifacts from a group in maven?

后端 未结 3 1292
不知归路
不知归路 2021-02-02 07:01

I am using maven 3 with the Enforcer plugin configured to force version convergence. I am using Spring 3.1.2 and Spring Security 3.1.3.

The problem is that Spring 3.1.3

3条回答
  •  伪装坚强ぢ
    2021-02-02 07:36

    This probably won't help you much, but there is a feature request to allow wildcards in exclusions, however it is not in the current release version of Maven (3.0.4). (Edit: this feature is now present in Maven 3.2.1)

    https://issues.apache.org/jira/browse/MNG-3832

    Interesting is a comment in this JIRA issue:

    Not sure what's going on, but this seems to work in Maven 3.0.3, using this:

    
        *
        *
    
    

    However, this produces these warnings:

    [WARNING] 'dependencies.dependency.exclusions.exclusion.groupId' for my.groupid:my.artifactid:ejb-client with value '*' does not match a valid id pattern. @ line 31, column 30

    [WARNING] 'dependencies.dependency.exclusions.exclusion.artifactId' for my.groupid:my.artifactid:ejb-client with value '*' does not match a valid id pattern. @ line 32, column 33

    So I probably shouldn't be doing it, but it does work.

    So you might be able to use an artifactId wildcard in Maven 3.0.3 or later and have it work, but with warnings and with no guarantee of compatibility with later versions.

提交回复
热议问题