diff --git a/maven-project/src/main/java/org/apache/maven/project/validation/DefaultModelValidator.java b/maven-project/src/main/java/org/apache/maven/project/validation/DefaultModelValidator.java index 29821faea3..57b930d132 100644 --- a/maven-project/src/main/java/org/apache/maven/project/validation/DefaultModelValidator.java +++ b/maven-project/src/main/java/org/apache/maven/project/validation/DefaultModelValidator.java @@ -85,10 +85,10 @@ public class DefaultModelValidator validateId( "dependencies.dependency.groupId", result, d.getGroupId() ); - validateStringNotEmpty( "dependencies.dependency.type", result, d.getType(), dependencySourceHint( d ) ); + validateStringNotEmpty( "dependencies.dependency.type", result, d.getType(), d.getManagementKey() ); validateStringNotEmpty( "dependencies.dependency.version", result, d.getVersion(), - dependencySourceHint( d ) ); + d.getManagementKey() ); if ( Artifact.SCOPE_SYSTEM.equals( d.getScope() ) ) { @@ -263,19 +263,6 @@ public class DefaultModelValidator // Field validation // ---------------------------------------------------------------------- - /** - * Create a hint string consisting of the groupId and artifactId for user validation - * messages. For example when the version or type information is missing from a - * dependency. - * - * @param d The dependency from which to make the hint. - * @return String of the form g:a. - */ - private String dependencySourceHint( Dependency d ) - { - return d.getGroupId() + ":" + d.getArtifactId(); - } - private boolean validateStringNotEmpty( String fieldName, ModelValidationResult result, String string ) { return validateStringNotEmpty( fieldName, result, string, null );