ivy.pushContext(); // DefaultModuleDescriptor access Ivy current context, so we need to push it.
try {
DefaultModuleDescriptor md = DefaultModuleDescriptor.newCallerInstance(
toMrid(module.getId()), new String[]{"master", "runtime"}, opts.isTransitive(), opts.isChanging());
for (String exclude : opts.getExclusions()) {
DefaultExcludeRule rule = new DefaultExcludeRule(
new ArtifactId(toModuleId(exclude), ".*", ".*", ".*"),
new ExactOrRegexpPatternMatcher(),
null);
rule.addConfiguration("master");
rule.addConfiguration("runtime");
md.addExcludeRule(rule);
}
ResolveReport report = ivy.resolve(md,
(ResolveOptions) new ResolveOptions()