[ 
https://issues.apache.org/jira/browse/MDEP-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14946644#comment-14946644
 ] 

Michael Osipov edited comment on MDEP-506 at 10/7/15 10:34 AM:
---------------------------------------------------------------

The problem here is simple: missing version. {{dependencyConvergence}} won't 
help because it resolves the tree first. You need a static analysis on the dep 
mngt section. That requires a custom rule. Should be doable.

I fully agree that a NPE is not helpful and requires some context. If we take a 
look at the description of this goal, we can do better:

bq. analyzes your projects dependencies and lists mismatches between resolved 
dependencies and those listed in your dependencyManagement section.

In this case, your dep from depmngt has no version and the resolved one has a 
version, of course. This is a misatch and should be logged.

What do you think?


was (Author: michael-o):
The problem here is simple. Missing version. {{dependencyConvergence}} won't 
help because it resolves the tree first. You need a static analysis on the dep 
mngt section. That requires a custom rule. Should be doable.

I fully agree that an NPE is not helpful and requires some context. If we take 
a look at the description of this goal, we can do better:

bq. analyzes your projects dependencies and lists mismatches between resolved 
dependencies and those listed in your dependencyManagement section.

In this case, your dep from depmngt has no version and the resolved one has a 
version, of course. This is a misatch and should be logged.

What do you think?

> NPE in AnalyzeDepMgt.getMismatch
> --------------------------------
>
>                 Key: MDEP-506
>                 URL: https://issues.apache.org/jira/browse/MDEP-506
>             Project: Maven Dependency Plugin
>          Issue Type: Bug
>          Components: analyze
>    Affects Versions: 2.10
>         Environment: Apache Maven 3.3.3 
> (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T13:57:37+02:00)
> Java version: 1.8.0_40, vendor: Oracle Corporation
> OS name: "windows 7", version: "6.1", arch: "amd64", family: "dos"
>            Reporter: olivier o
>
> The goal analyze-dep-mgt generates an NPE.  Please check the github link 
> below to repoduce this issue: 
> https://github.com/Orange-OpenSource/mdep-506-analyse-dep-mgt
> Caused by: java.lang.NullPointerException
>       at 
> org.apache.maven.plugin.dependency.analyze.AnalyzeDepMgt.getMismatch(AnalyzeDepMgt.java:272)
>       at 
> org.apache.maven.plugin.dependency.analyze.AnalyzeDepMgt.checkDependencyManagement(AnalyzeDepMgt.java:175)
>       at 
> org.apache.maven.plugin.dependency.analyze.AnalyzeDepMgt.execute(AnalyzeDepMgt.java:102)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to