[ 
http://jira.codehaus.org/browse/MDEP-149?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]
Benjamin Bentmann updated MDEP-149:
-----------------------------------

    Attachment: MDEP-149.zip

Here are some (pathological) demo projects if you want to try this out. Run 
"mvn install" on api and impl, then "mvn dependency:analyze" on impl-client. 
Without the patch, the plugin warns that impl-client uses api although there is 
not a single souce code line directly referencing any type from api.

> Field accesses and method invocations cause bogus dependencies
> --------------------------------------------------------------
>
>                 Key: MDEP-149
>                 URL: http://jira.codehaus.org/browse/MDEP-149
>             Project: Maven 2.x Dependency Plugin
>          Issue Type: Bug
>          Components: analyze
>    Affects Versions: 2.0
>            Reporter: Benjamin Bentmann
>            Assignee: Brian Fox
>            Priority: Trivial
>         Attachments: bogus-dependencies.patch, MDEP-149.zip
>
>
> When hunting down some "Used undeclared dependencies" warnings, I found the 
> plugin lying. For example, the line
> {code:java}
> java.lang.Object var = bean.field;
> {code}
> does not impose a direct dependency on the field's type, whatever it may be. 
> Likewise, the line
> {code:java}
> bean.method(null);
> {code}
> 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 ;-)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to