public void validate()

in src/main/java/org/apache/maven/resolver/internal/ant/types/Dependencies.java [51:73]


    public void validate(Task task) {
        if (isReference()) {
            getRef().validate(task);
        } else {
            if (getPom() != null && getPom().getFile() == null) {
                throw new BuildException("A <pom> used for dependency resolution has to be backed by a pom.xml file");
            }
            Map<String, String> ids = new HashMap<>();
            for (DependencyContainer container : containers) {
                container.validate(task);
                if (container instanceof Dependency) {
                    Dependency dependency = (Dependency) container;
                    String id = dependency.getVersionlessKey();
                    String collision = ids.put(id, dependency.getVersion());
                    if (collision != null) {
                        throw new BuildException("You must not declare multiple <dependency> elements"
                                + " with the same coordinates but got " + id + " -> " + collision + " vs "
                                + dependency.getVersion());
                    }
                }
            }
        }
    }