src/java/fr/jayasoft/ivy/Ivy.java
/**
     * Resolve dependencies of a module described by a module descriptor
     * 
     * Note: the method signature is way too long, we should use a class to store the settings of the resolve.
     */
Resolve dependencies of a module described by a module descriptor

the method signature is way too long, we should use a class to store the settings of the resolve.
Resolve dependencies of a module described by a module descriptor the method signature is way too long we should use a class to store the settings of the resolve .
public ResolveReport resolve(ModuleDescriptor md, String[] confs, File cache, Date date, boolean validate, boolean useCacheOnly, boolean transitive, boolean useOrigin, boolean download, boolean outputReport, Filter artifactFilter) throws ParseException, IOException, FileNotFoundException {
		IvyContext.getContext().setIvy(this);
        DependencyResolver oldDictator = getDictatorResolver();
        if (useCacheOnly) {
        	setDictatorResolver(new CacheResolver(this));
        }
        try {
            if (cache==null) {  
                cache = getDefaultCache();
                IvyContext.getContext().setCache(cache);
            }
            if (artifactFilter == null) {
            	artifactFilter = FilterHelper.NO_FILTER;
            }
            if (confs.length == 1 && confs[0].equals("*")) {
                confs = md.getConfigurationsNames();
            }
            fireIvyEvent(new StartResolveEvent(this, md, confs));
            long start = System.currentTimeMillis();
            Message.info(":: resolving dependencies :: "+md.getResolvedModuleRevisionId()+(transitive?"":" [not transitive]"));
            Message.info("\tconfs: "+Arrays.asList(confs));
            Message.verbose("\tvalidate = "+validate);
            ResolveReport report = new ResolveReport(md);
            IvyNode[] dependencies = getDependencies(md, confs, cache, date, report, validate, transitive);
            report.setDependencies(Arrays.asList(dependencies), artifactFilter);
            File ivyFileInCache = getResolvedIvyFileInCache(cache, md.getResolvedModuleRevisionId());
            md.toIvyFile(ivyFileInCache);
            File ivyPropertiesInCache = getResolvedIvyPropertiesInCache(cache, md.getResolvedModuleRevisionId());
            Properties props = new Properties();
            if (dependencies.length > 0) {
            	IvyNode root = dependencies[0].getRoot();
            	for (int i = 0; i < dependencies.length; i++) {
            		if (!dependencies[i].isCompletelyEvicted() && !dependencies[i].hasProblem()) {
            			DependencyDescriptor dd = dependencies[i].getDependencyDescriptor(root);
            			if (dd != null) {
            				String rev = dependencies[i].getResolvedId().getRevision();
            				String status = dependencies[i].getDescriptor().getStatus();
            				props.put(dd.getDependencyRevisionId().encodeToString(), rev+" "+status);
            			}
            		}
            	}
            }
            props.store(new FileOutputStream(ivyPropertiesInCache), md.getResolvedModuleRevisionId()+ " resolved revisions");
            Message.verbose("\tresolved ivy file produced in "+ivyFileInCache);
            report.setResolveTime(System.currentTimeMillis()-start);
            if (download) {
	            Message.verbose(":: downloading artifacts ::");
	            downloadArtifacts(report, cache, useOrigin, artifactFilter);
            }
            if (outputReport) {
            	outputReport(report, cache);
            }
            fireIvyEvent(new EndResolveEvent(this, md, confs, report));
            return report;
        } finally {
            setDictatorResolver(oldDictator);
        }
	}
public ResolveReport resolve ( ModuleDescriptor md , String [ ] confs , File cache , Date date , boolean validate , boolean useCacheOnly , boolean transitive , boolean useOrigin , boolean download , boolean outputReport , Filter artifactFilter ) throws ParseException , IOException , FileNotFoundException { IvyContext . getContext ( ) . setIvy ( this ) ; DependencyResolver oldDictator = getDictatorResolver ( ) ; if ( useCacheOnly ) { setDictatorResolver ( new CacheResolver ( this ) ) ; } try { if ( cache == null ) { cache = getDefaultCache ( ) ; IvyContext . getContext ( ) . setCache ( cache ) ; } if ( artifactFilter == null ) { artifactFilter = FilterHelper . NO_FILTER ; } if ( confs . length == 1 && confs [ 0 ] . equals ( "*" ) ) { confs = md . getConfigurationsNames ( ) ; } fireIvyEvent ( new StartResolveEvent ( this , md , confs ) ) ; long start = System . currentTimeMillis ( ) ; Message . info ( ":: resolving dependencies :: " + md . getResolvedModuleRevisionId ( ) + ( transitive ? "" : " [not transitive]" ) ) ; Message . info ( "\tconfs: " + Arrays . asList ( confs ) ) ; Message . verbose ( "\tvalidate = " + validate ) ; ResolveReport report = new ResolveReport ( md ) ; IvyNode [ ] dependencies = getDependencies ( md , confs , cache , date , report , validate , transitive ) ; report . setDependencies ( Arrays . asList ( dependencies ) , artifactFilter ) ; File ivyFileInCache = getResolvedIvyFileInCache ( cache , md . getResolvedModuleRevisionId ( ) ) ; md . toIvyFile ( ivyFileInCache ) ; File ivyPropertiesInCache = getResolvedIvyPropertiesInCache ( cache , md . getResolvedModuleRevisionId ( ) ) ; Properties props = new Properties ( ) ; if ( dependencies . length > 0 ) { IvyNode root = dependencies [ 0 ] . getRoot ( ) ; for ( int i = 0 ; i < dependencies . length ; i ++ ) { if ( ! dependencies [ i ] . isCompletelyEvicted ( ) && ! dependencies [ i ] . hasProblem ( ) ) { DependencyDescriptor dd = dependencies [ i ] . getDependencyDescriptor ( root ) ; if ( dd != null ) { String rev = dependencies [ i ] . getResolvedId ( ) . getRevision ( ) ; String status = dependencies [ i ] . getDescriptor ( ) . getStatus ( ) ; props . put ( dd . getDependencyRevisionId ( ) . encodeToString ( ) , rev + " " + status ) ; } } } } props . store ( new FileOutputStream ( ivyPropertiesInCache ) , md . getResolvedModuleRevisionId ( ) + " resolved revisions" ) ; Message . verbose ( "\tresolved ivy file produced in " + ivyFileInCache ) ; report . setResolveTime ( System . currentTimeMillis ( ) - start ) ; if ( download ) { Message . verbose ( ":: downloading artifacts ::" ) ; downloadArtifacts ( report , cache , useOrigin , artifactFilter ) ; } if ( outputReport ) { outputReport ( report , cache ) ; } fireIvyEvent ( new EndResolveEvent ( this , md , confs , report ) ) ; return report ; } finally { setDictatorResolver ( oldDictator ) ; } }
Resolve dependencies of a module described by a module descriptor
Resolve dependencies of a module described by a module descriptor
// ensure that a cache exists
 // resolve dependencies
 // produce resolved ivy file and ivy properties in cache
 // we store the resolved dependencies revisions and statuses per asked dependency revision id,
 // for direct dependencies only.
 // this is used by the deliver task to resolve dynamic revisions to static ones
