try {
// set the locale to UK as workaround for SUN bug 6240963
Locale.setDefault(Locale.UK);
// Create and configure resolver
PackagerResolver resolver = new PackagerResolver();
resolver.setSettings(settings);
File repoRoot = new File("test/repositories/IVY-1179/repo");
resolver.addIvyPattern(
new File(repoRoot, "[organisation]/[module]/[revision]/ivy.xml").getAbsoluteFile().toURL().toExternalForm());
resolver.setPackagerPattern(
new File(repoRoot, "[organisation]/[module]/[revision]/packager.xml").getAbsoluteFile().toURL().toExternalForm());
resolver.setBuildRoot(builddir);
resolver.setResourceCache(cachedir);
resolver.setPreserveBuildDirectories(true);
resolver.setVerbose(true);
resolver.setProperty("packager.website.url",
new File("test/repositories/IVY-1179/website").getAbsoluteFile().toURL().toExternalForm());
resolver.setName("packager");
// Get module descriptor
ModuleRevisionId mrid = ModuleRevisionId.newInstance("org", "B", "1.0");
ResolvedModuleRevision rmr = resolver.getDependency(
new DefaultDependencyDescriptor(mrid, false), data);
// Download artifact
Artifact artifact = new DefaultArtifact(mrid, rmr.getPublicationDate(), "B", "jar", "jar");
resolver.download(new Artifact[] {artifact}, downloadOptions());
// assert that the file B.jar is extracted from the archive
File jar = new File(builddir, "org/B/1.0/artifacts/jars/B.jar");
assertTrue(jar.exists());