mirror of https://github.com/apache/maven.git
[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:
parent
d3f76d80c0
commit
bd45522faf
|
@ -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 );
|
||||
|
|
Loading…
Reference in New Issue