[
https://issues.apache.org/jira/browse/MDEP-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14945702#comment-14945702
]
Michael Osipov commented on MDEP-506:
-------------------------------------
After analyzing your demo project with version 3.0-SNAPSHOT, I know what the
problem is. Your {{parent/pom.xml}} does not provide a version for
{{spring-cloud-spring-service-connector}}. This is strictly necessary in the
dependency management section. The analyze goal does only a static analysis,
not interpolated in contrast to {{:dependency-tree}}. Unfortunately, the API
does not tell whether {{getVersion}} can be {{null}} or not. I would highly
recommend to write an Enforcer rule which fails the build when such a
dependency is hit.
Currently, I see no reason to apply a fix for a symptom where the cause is
appearantly visible.
Thoughts? Do you have a better approach in mind?
> 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)