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

Field accesses and method invocations cause bogus dependencies

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 2.0
    • 2.2
    • analyze
    • None
    • Patch

    Description

      When hunting down some "Used undeclared dependencies" warnings, I found the plugin lying. For example, the line

      java.lang.Object var = bean.field;
      

      does not impose a direct dependency on the field's type, whatever it may be. Likewise, the line

      bean.method(null);
      

      does not directly depend on the method's return type nor parameter types. Unless I explicitly code a reference to a type by means of variable declarations, type checks/casts etc., there is no need to declare dependencies that are already brought in via transitivity, that's what Maven was invented for, isn't is

      Attachments

        1. MDEP-149.zip
          3 kB
          Benjamin Bentmann
        2. bogus-dependencies.patch
          4 kB
          Benjamin Bentmann

        Activity

          People

            brianf Brian E Fox
            bentmann Benjamin Bentmann
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: