use of org.apache.ivy.core.resolve.ResolveData in project ant-ivy by apache.
the class MirroredURLResolverTest method setUp.
@Before
public void setUp() throws Exception {
settings = new IvySettings();
engine = new ResolveEngine(settings, new EventManager(), new SortEngine(settings));
data = new ResolveData(engine, new ResolveOptions());
TestHelper.createCache();
settings.setDefaultCache(TestHelper.cache);
settings.setVariable("test.mirroredurl.mirrorlist-solo.url", this.getClass().getResource("mirrorlist-solo.txt").toExternalForm());
settings.setVariable("test.mirroredurl.mirrorlist-failover.url", this.getClass().getResource("mirrorlist-failover.txt").toExternalForm());
settings.setVariable("test.mirroredurl.mirrorlist-fail.url", this.getClass().getResource("mirrorlist-fail.txt").toExternalForm());
new XmlSettingsParser(settings).parse(MirroredURLResolverTest.class.getResource("mirror-resolver-settings.xml"));
}
use of org.apache.ivy.core.resolve.ResolveData in project ant-ivy by apache.
the class PackagerResolverTest method setUp.
@Before
public void setUp() throws Exception {
Message.setDefaultLogger(new DefaultMessageLogger(99));
settings = new IvySettings();
ResolveEngine engine = new ResolveEngine(settings, new EventManager(), new SortEngine(settings));
cache = new File("build/cache");
data = new ResolveData(engine, new ResolveOptions());
cache.mkdirs();
settings.setDefaultCache(cache);
// Create work space with build and resource cache directories
workdir = new File("build/test/PackagerResolverTest");
builddir = new File(workdir, "build");
cachedir = new File(workdir, "resources");
cleanupTempDirs();
if (!builddir.mkdirs() || !cachedir.mkdirs()) {
throw new Exception("can't create directories under " + workdir);
}
}
use of org.apache.ivy.core.resolve.ResolveData in project ant-ivy by apache.
the class PomModuleDescriptorParser method parseOtherPom.
private ResolvedModuleRevision parseOtherPom(ParserSettings ivySettings, ModuleRevisionId parentModRevID) throws ParseException {
DependencyDescriptor dd = new DefaultDependencyDescriptor(parentModRevID, true);
ResolveData data = IvyContext.getContext().getResolveData();
if (data == null) {
ResolveEngine engine = IvyContext.getContext().getIvy().getResolveEngine();
ResolveOptions options = new ResolveOptions();
options.setDownload(false);
data = new ResolveData(engine, options);
}
DependencyResolver resolver = ivySettings.getResolver(parentModRevID);
if (resolver == null) {
// TODO: Throw exception here?
return null;
}
dd = toSystem(dd, ivySettings.getContextNamespace());
return resolver.getDependency(dd, data);
}
Aggregations