public static void export(ResolveReport resolved,String output,String classpath,String pattern,String pathprefix) throws IOException {
		
		File outputPath = new File(output);
		
		if( !outputPath.exists() )
			outputPath.mkdirs();
		
		if( !outputPath.exists() || !outputPath.isDirectory())
			throw new RuntimeException("invalid output directory");
		
		PrintWriter classpathWriter = null;

		if( classpath!=null )
			classpathWriter = new PrintWriter(new FileWriter(classpath));
		
		for(ArtifactDownloadReport r : resolved.getAllArtifactsReports()) {
			Artifact a = r.getArtifact();
			if( TypeUtils.jar(a) ) {
				
				String name = name(pattern,a);
				FileUtil.copy(r.getLocalFile(),new File(output,name),null);
				
				if( classpathWriter!=null )
					classpathWriter.println( (pathprefix==null?"":pathprefix) + name );
				
			}
		}

		if( classpathWriter!=null )
			classpathWriter.close();

	}