mirror of https://github.com/apache/maven.git
[MNG-5157] NPE stemming from DefaultModelBuilder.containsCoordinates
o Revised original fix to prevent duplicate emission of error msg git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1176402 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
a6b7bc895f
commit
a1d64e71ca
|
@ -909,6 +909,18 @@ public class DefaultModelBuilder
|
|||
String artifactId = dependency.getArtifactId();
|
||||
String version = dependency.getVersion();
|
||||
|
||||
if ( groupId == null || groupId.length() <= 0 )
|
||||
{
|
||||
problems.add( Severity.ERROR, "'dependencyManagement.dependencies.dependency.groupId' for "
|
||||
+ dependency.getManagementKey() + " is missing.", dependency.getLocation( "" ), null );
|
||||
continue;
|
||||
}
|
||||
if ( artifactId == null || artifactId.length() <= 0 )
|
||||
{
|
||||
problems.add( Severity.ERROR, "'dependencyManagement.dependencies.dependency.artifactId' for "
|
||||
+ dependency.getManagementKey() + " is missing.", dependency.getLocation( "" ), null );
|
||||
continue;
|
||||
}
|
||||
if ( version == null || version.length() <= 0 )
|
||||
{
|
||||
problems.add( Severity.ERROR, "'dependencyManagement.dependencies.dependency.version' for "
|
||||
|
|
|
@ -356,12 +356,6 @@ public class DefaultModelValidator
|
|||
{
|
||||
String key = dependency.getManagementKey();
|
||||
|
||||
validateStringNotEmpty( prefix + ".groupId", problems, Severity.ERROR, dependency.getGroupId(), key,
|
||||
dependency );
|
||||
|
||||
validateStringNotEmpty( prefix + ".artifactId", problems, Severity.ERROR, dependency.getArtifactId(), key,
|
||||
dependency );
|
||||
|
||||
if ( "import".equals( dependency.getScope() ) )
|
||||
{
|
||||
if ( !"pom".equals( dependency.getType() ) )
|
||||
|
|
Loading…
Reference in New Issue