Maven
  1. Maven
  2. MNG-3832

Allow wildcards in dependency exclusions

    Details

    • Complexity:
      Intermediate
    • Number of attachments :
      1

      Description

      I would like to be able to exclude all transitive dependencies from a certain dependencies. This is especially useful when depending on an artifact with a classifier that may not have the same dependencies as the main artifact. Currently the only way to do this is by excluding each dependency individually which requires significant effort and is prone to becoming out of date. The following syntax is one possibility.

      Exclude all transitive dependencies

      <exclusion>
        <groupId>*</groupId>
      </exclusion>
      

      Exclude transitive dependencies with the groupId "org.company"

      <exclusion>
        <groupId>org.company</groupId>
        <artifactId>*</artifactId>
      </exclusion>
      

        Issue Links

          Activity

          Hide
          Robert Scholte added a comment -

          Exclusion with wildcards already supported since Maven 3.0
          Warning fixed in http://git-wip-us.apache.org/repos/asf/maven/diff/65c135d5

          Show
          Robert Scholte added a comment - Exclusion with wildcards already supported since Maven 3.0 Warning fixed in http://git-wip-us.apache.org/repos/asf/maven/diff/65c135d5
          Hide
          Paul Benedict added a comment -

          Just for posterity, such configuration is already documented. See the "Exclusions" section:
          http://maven.apache.org/pom.html

          Show
          Paul Benedict added a comment - Just for posterity, such configuration is already documented. See the "Exclusions" section: http://maven.apache.org/pom.html
          Hide
          Ciprian Pascu added a comment -

          This feature does not work with maven-dependency-plugin.
          Also Idea development environment is affected.

          Show
          Ciprian Pascu added a comment - This feature does not work with maven-dependency-plugin. Also Idea development environment is affected.
          Hide
          Denis Tunovic added a comment -

          Same here as comment from Ciprian with Maven 3.2.2

          Show
          Denis Tunovic added a comment - Same here as comment from Ciprian with Maven 3.2.2
          Hide
          Sergei Ivanov added a comment -

          Denis/Ciprian: it would be beneficial if you attached a small test project + a more detailed explanation to demonstrate the problem.

          Show
          Sergei Ivanov added a comment - Denis/Ciprian: it would be beneficial if you attached a small test project + a more detailed explanation to demonstrate the problem.

            People

            • Assignee:
              Robert Scholte
              Reporter:
              Paul Gier
            • Votes:
              75 Vote for this issue
              Watchers:
              69 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: