src/java/fr/jayasoft/ivy/Ivy.java
/**
     * Checks the given ivy file using current configuration to see if all dependencies
     * are available, with good confs. If a resolver name is given, it also checks that the declared
     * publications are available in the corresponding resolver.
     * Note that the check is not performed recursively, i.e. if a dependency has itself dependencies
     * badly described or not available, this check will not discover it. 
     */
Checks the given ivy file using current configuration to see if all dependencies
are available, with good confs. If a resolver name is given, it also checks that the declared
publications are available in the corresponding resolver.
Note that the check is not performed recursively, i.e. if a dependency has itself dependencies
badly described or not available, this check will not discover it.
Checks the given ivy file using current configuration to see if all dependencies are available with good confs . If a resolver name is given it also checks that the declared publications are available in the corresponding resolver . Note that the check is not performed recursively i . e . if a dependency has itself dependencies badly described or not available this check will not discover it .
public boolean check(URL ivyFile, String resolvername) {
        try {
            IvyContext.getContext().setIvy(this);
            boolean result = true;
            ModuleDescriptor md = ModuleDescriptorParserRegistry.getInstance().parseDescriptor(this, ivyFile, doValidate());
            if (resolvername != null) {
                DependencyResolver resolver = getResolver(resolvername);
                String[] confs = md.getConfigurationsNames();
                Set artifacts = new HashSet();
                for (int i = 0; i < confs.length; i++) {
                    artifacts.addAll(Arrays.asList(md.getArtifacts(confs[i])));
                }
                for (Iterator iter = artifacts.iterator(); iter.hasNext();) {
                    Artifact art = (Artifact)iter.next();
                    if (!resolver.exists(art)) {
                        Message.info("declared publication not found: "+art);
                        result = false;
                    }
                }
            }
            DependencyDescriptor[] dds = md.getDependencies();
            ResolveData data = new ResolveData(this, getDefaultCache(), new Date(), null, true);
            for (int i = 0; i < dds.length; i++) {
                String[] masterConfs = dds[i].getModuleConfigurations();
                for (int j = 0; j < masterConfs.length; j++) {
                    if (!"*".equals(masterConfs[j].trim()) && md.getConfiguration(masterConfs[j]) == null) {
                        Message.info("dependency required in non existing conf for "+ivyFile+" \n\tin "+dds[i].getDependencyRevisionId()+": "+masterConfs[j]);
                        result = false;
                    }
                }
                DependencyResolver resolver = getResolver(dds[i].getDependencyId());
                ResolvedModuleRevision rmr = resolver.getDependency(dds[i], data);
                if (rmr == null) {
                    Message.info("dependency not found in "+ivyFile+":\n\t"+dds[i]);
                    result = false;
                } else {
                    String[] depConfs = dds[i].getDependencyConfigurations(md.getConfigurationsNames());
                    for (int j = 0; j < depConfs.length; j++) {
                        if (!Arrays.asList(rmr.getDescriptor().getConfigurationsNames()).contains(depConfs[j])) {
                            Message.info("dependency configuration is missing for "+ivyFile+"\n\tin "+dds[i].getDependencyRevisionId()+": "+depConfs[j]);
                            result = false;
                        }
                        Artifact[] arts = rmr.getDescriptor().getArtifacts(depConfs[j]);
                        for (int k = 0; k < arts.length; k++) {
                            if (!resolver.exists(arts[k])) {
                                Message.info("dependency artifact is missing for "+ivyFile+"\n\t in "+dds[i].getDependencyRevisionId()+": "+arts[k]);
                                result = false;
                            }
                        }
                    }
                }
            }
            return result;
        } catch (ParseException e) {
            Message.info("parse problem on "+ivyFile+": "+e);
            return false;
        } catch (IOException e) {
            Message.info("io problem on "+ivyFile+": "+e);
            return false;
        } catch (Exception e) {
            Message.info("problem on "+ivyFile+": "+e);
            return false;
        }
    }
public boolean check ( URL ivyFile , String resolvername ) { try { IvyContext . getContext ( ) . setIvy ( this ) ; boolean result = true ; ModuleDescriptor md = ModuleDescriptorParserRegistry . getInstance ( ) . parseDescriptor ( this , ivyFile , doValidate ( ) ) ; if ( resolvername != null ) { DependencyResolver resolver = getResolver ( resolvername ) ; String [ ] confs = md . getConfigurationsNames ( ) ; Set artifacts = new HashSet ( ) ; for ( int i = 0 ; i < confs . length ; i ++ ) { artifacts . addAll ( Arrays . asList ( md . getArtifacts ( confs [ i ] ) ) ) ; } for ( Iterator iter = artifacts . iterator ( ) ; iter . hasNext ( ) ; ) { Artifact art = ( Artifact ) iter . next ( ) ; if ( ! resolver . exists ( art ) ) { Message . info ( "declared publication not found: " + art ) ; result = false ; } } } DependencyDescriptor [ ] dds = md . getDependencies ( ) ; ResolveData data = new ResolveData ( this , getDefaultCache ( ) , new Date ( ) , null , true ) ; for ( int i = 0 ; i < dds . length ; i ++ ) { String [ ] masterConfs = dds [ i ] . getModuleConfigurations ( ) ; for ( int j = 0 ; j < masterConfs . length ; j ++ ) { if ( ! "*" . equals ( masterConfs [ j ] . trim ( ) ) && md . getConfiguration ( masterConfs [ j ] ) == null ) { Message . info ( "dependency required in non existing conf for " + ivyFile + " \n\tin " + dds [ i ] . getDependencyRevisionId ( ) + ": " + masterConfs [ j ] ) ; result = false ; } } DependencyResolver resolver = getResolver ( dds [ i ] . getDependencyId ( ) ) ; ResolvedModuleRevision rmr = resolver . getDependency ( dds [ i ] , data ) ; if ( rmr == null ) { Message . info ( "dependency not found in " + ivyFile + ":\n\t" + dds [ i ] ) ; result = false ; } else { String [ ] depConfs = dds [ i ] . getDependencyConfigurations ( md . getConfigurationsNames ( ) ) ; for ( int j = 0 ; j < depConfs . length ; j ++ ) { if ( ! Arrays . asList ( rmr . getDescriptor ( ) . getConfigurationsNames ( ) ) . contains ( depConfs [ j ] ) ) { Message . info ( "dependency configuration is missing for " + ivyFile + "\n\tin " + dds [ i ] . getDependencyRevisionId ( ) + ": " + depConfs [ j ] ) ; result = false ; } Artifact [ ] arts = rmr . getDescriptor ( ) . getArtifacts ( depConfs [ j ] ) ; for ( int k = 0 ; k < arts . length ; k ++ ) { if ( ! resolver . exists ( arts [ k ] ) ) { Message . info ( "dependency artifact is missing for " + ivyFile + "\n\t in " + dds [ i ] . getDependencyRevisionId ( ) + ": " + arts [ k ] ) ; result = false ; } } } } } return result ; } catch ( ParseException e ) { Message . info ( "parse problem on " + ivyFile + ": " + e ) ; return false ; } catch ( IOException e ) { Message . info ( "io problem on " + ivyFile + ": " + e ) ; return false ; } catch ( Exception e ) { Message . info ( "problem on " + ivyFile + ": " + e ) ; return false ; } }
Checks the given ivy file using current configuration to see if all dependencies
 are available, with good confs.
Checks the given ivy file using current configuration to see if all dependencies are available with good confs .
// parse ivy file
 // check publications if possible
 // check dependencies
 // check master confs
 // resolve
