[MNG-3834] Improve missing version error message.

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@764552 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Paul Gier 2009-04-13 18:35:55 +00:00
parent d3f76d80c0
commit bd45522faf
1 changed files with 2 additions and 15 deletions

View File

@ -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 );