public void validate()

in src/main/java/org/apache/maven/resolver/internal/ant/types/Dependency.java [62:106]


    public void validate( Task task )
    {
        if ( isReference() )
        {
            getRef().validate( task );
        }
        else
        {
            if ( groupId == null || groupId.length() <= 0 )
            {
                throw new BuildException( "You must specify the 'groupId' for a dependency" );
            }
            if ( artifactId == null || artifactId.length() <= 0 )
            {
                throw new BuildException( "You must specify the 'artifactId' for a dependency" );
            }
            if ( version == null || version.length() <= 0 )
            {
                throw new BuildException( "You must specify the 'version' for a dependency" );
            }

            if ( "system".equals( scope ) )
            {
                if ( systemPath == null )
                {
                    throw new BuildException( "You must specify 'systemPath' for dependencies with scope=system" );
                }
            }
            else if ( systemPath != null )
            {
                throw new BuildException( "You may only specify 'systemPath' for dependencies with scope=system" );
            }

            if ( scope != null && !"compile".equals( scope ) && !"provided".equals( scope ) && !"system".equals( scope )
                && !"runtime".equals( scope ) && !"test".equals( scope ) )
            {
                task.log( "Unknown scope '" + scope + "' for dependency", Project.MSG_WARN );
            }

            for ( Exclusion exclusion : exclusions )
            {
                exclusion.validate( task );
            }
        }
    }