Uploaded image for project: 'Maven Dependency Plugin'
  1. Maven Dependency Plugin
  2. MDEP-123

dependency:tree to optionally display all instances of a transitive dependency, not just the first one found

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0
    • 2.0
    • tree
    • None

    Description

      dependency:tree is really useful for tracking down how a particular transitive dependency has been introduced, but it only lists the first occurrence, not all occurrences. So it can be frustrating game attempting to remove a dep only to find it introduced by another component. A parameter to dependency:tree to show all occurences of a transitive dep would be really helpful.

      Eg the attached POM has a direct dep on commons-beanutils and commons-digester, which both have a dep on commons-logging. But executing

      mvn org.apache.maven.plugins:maven-dependency-plugin:2.0-alpha-5-SNAPSHOT:tree
      

      only shows commons-logging listed as a transitive dep for commons-beanutils, not commons-digester, Ie

      [INFO] [dependency:tree]
      [INFO] maven-dependency-plugin-tree-all-deps:maven-dependency-plugin-tree-all-deps:jar:0.0.1
      [INFO] +- commons-beanutils:commons-beanutils:jar:1.7.0:compile
      [INFO] |  \- commons-logging:commons-logging:jar:1.0.3:compile
      [INFO] \- commons-digester:commons-digester:jar:1.7:compile
      [INFO]    +- commons-collections:commons-collections:jar:2.1:compile
      [INFO]    \- xml-apis:xml-apis:jar:1.0.b2:compile
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD SUCCESSFUL
      [INFO] ------------------------------------------------------------------------
      

      but if an exclusion is added to commons-beanutils for for commons-logging, then the other transitive dep instance is revealed. Ie

      [INFO] [dependency:tree]
      [INFO] maven-dependency-plugin-tree-all-deps:maven-dependency-plugin-tree-all-deps:jar:0.0.1
      [INFO] +- commons-beanutils:commons-beanutils:jar:1.7.0:compile
      [INFO] \- commons-digester:commons-digester:jar:1.7:compile
      [INFO]    +- commons-logging:commons-logging:jar:1.0:compile
      [INFO]    +- commons-collections:commons-collections:jar:2.1:compile
      [INFO]    \- xml-apis:xml-apis:jar:1.0.b2:compile
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD SUCCESSFUL
      [INFO] ------------------------------------------------------------------------
      

      An option to show both instance would be fantastic, Eg

      [INFO] [dependency:tree]
      [INFO] maven-dependency-plugin-tree-all-deps:maven-dependency-plugin-tree-all-deps:jar:0.0.1
      [INFO] +- commons-beanutils:commons-beanutils:jar:1.7.0:compile
      [INFO] |  \- commons-logging:commons-logging:jar:1.0.3:compile
      [INFO] \- commons-digester:commons-digester:jar:1.7:compile
      [INFO]    +- commons-logging:commons-logging:jar:1.0:compile
      [INFO]    +- commons-collections:commons-collections:jar:2.1:compile
      [INFO]    \- xml-apis:xml-apis:jar:1.0.b2:compile
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD SUCCESSFUL
      [INFO] ------------------------------------------------------------------------
      

      Attachments

        1. pom.xml
          0.9 kB

        Activity

          People

            brianf Brian E Fox
            william_ferguson_au@yahoo.com William Ferguson
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: