[ 
https://issues.apache.org/jira/browse/MDEP-646?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Elliotte Rusty Harold updated MDEP-646:
---------------------------------------
    Labels: intern  (was: )

> mvn dependency:analyze mistakenly treat backward compatible classes as used 
> undeclared
> --------------------------------------------------------------------------------------
>
>                 Key: MDEP-646
>                 URL: https://issues.apache.org/jira/browse/MDEP-646
>             Project: Maven Dependency Plugin
>          Issue Type: Bug
>          Components: analyze
>    Affects Versions: 3.1.1
>            Reporter: John Lin
>            Priority: Major
>              Labels: intern
>
> I have the following dependency in my {{pom.xml}}:
> {code}
>     <dependency>
>       <groupId>org.apache.cassandra</groupId>
>       <artifactId>cassandra-all</artifactId>
>       <version>2.1.8</version>
>     </dependency>
> {code}
> Then a piece of code in my app:
> {code}
> import java.util.concurrent.ConcurrentHashMap;
> public class App {
>     public void foo () {
>         ConcurrentHashMap<String, String> m = new ConcurrentHashMap<>();
>         ...
>     }
> }
> {code}
> Then {{mvn dependency:analyze}} will find a used undeclared dependency:
> {code}
> [WARNING] Used undeclared dependencies found:
> [WARNING]    com.boundary:high-scale-lib:jar:1.0.6:compile
> {code}
> It turns out that {{cassandra-all}} has a dependency on {{high-scale-lib}}, 
> and {{high-scale-lib}} implemented a 
> {{java.util.concurrent.ConcurrentHashMap}} for backward compatibility.
> In fact, my app use the built-in {{ConcurrentHashMap}} in JDK, not the 
> {{ConcurrentHashMap}} from {{high-scale-lib}}. So I believe that it is 
> incorrect for the dependency analysis to report it as used.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to