public static Set<IvyPackageClasspathEntry> build(String basepath, String var, String ivyUserDir, ResolveReport report) {
		
		Set<IvyPackageClasspathEntry> result = new HashSet<IvyPackageClasspathEntry>();
		HashMap<IvyPackageKey, IvyPackage> packages = new HashMap<IvyPackageKey,IvyPackage>();

		for(ArtifactDownloadReport r : report.getAllArtifactsReports()) {
			
			Artifact a = r.getArtifact();
			String name = a.getName();
			String organisation = a.getAttribute(ATTR_ORGANISATION);
			
			if( TypeUtils.jar(a) ) {
				
				IvyPackageKey packageKey = new IvyPackageKey(organisation,name);
				IvyPackage ivyPackage = get(packages,packageKey);
				ivyPackage.jar = r;
				result.add(new IvyPackageClasspathEntry(basepath, var, ivyUserDir, ivyPackage));
				
			} else if( TypeUtils.source(a) ) {
				
				if(name.endsWith("-sources"))
					name = name.substring(0,name.length()-"-sources".length());
				IvyPackageKey packageKey = new IvyPackageKey(organisation,name);
				get(packages,packageKey).sources=r;
				
			} else if( TypeUtils.javadoc(a) ) {
				
				if(name.endsWith("-javadoc"))
					name = name.substring(0,name.length()-"-javadoc".length());
				IvyPackageKey packageKey = new IvyPackageKey(organisation,name);
				get(packages,packageKey).javadoc=r;
				
			}
			
		}
		
		return result;
	}