in src/main/java/org/apache/easyant/core/services/DefaultPluginService.java [141:190]
public EasyAntReport getPluginInfo(final ModuleRevisionId moduleRevisionId, String conf) throws Exception {
IvyContext.pushNewContext().setIvy(ivyInstance);
EasyAntReport eaReport = null;
try {
ResolveOptions resolveOptions = buildResolveOptions(conf);
final ResolveReport report = IvyContext.getContext().getIvy().getResolveEngine()
.resolve(moduleRevisionId, resolveOptions, false);
eaReport = new EasyAntReport();
eaReport.setResolveReport(report);
eaReport.setModuleDescriptor(report.getModuleDescriptor());
Project project = buildProject();
// expose resolve report for import deferred
project.addReference(EasyAntMagicNames.IMPORTED_MODULES_RESOLVE_REPORT_REF, report);
AbstractImport abstractImport = new AbstractImport() {
@Override
public void execute() throws BuildException {
Path path = createModulePath(moduleRevisionId.getModuleId());
File antFile = null;
for (ArtifactDownloadReport artifact : report.getConfigurationReport(getMainConf()).getAllArtifactsReports()) {
if ("ant".equals(artifact.getType())) {
antFile = artifact.getLocalFile();
} else if (shouldBeAddedToClasspath(artifact)) {
path.createPathElement().setLocation(artifact.getLocalFile());
} else {
handleOtherResourceFile(moduleRevisionId, artifact.getName(), artifact.getExt(),
artifact.getLocalFile());
}
}
if (antFile != null && antFile.exists()) {
ProjectHelper.configureProject(getProject(), antFile);
}
}
};
abstractImport.setProject(project);
// location ?
abstractImport.execute();
analyseProject(project, eaReport, conf);
} catch (Exception e) {
throw new Exception("An error occured while fetching plugin informations : " + e.getMessage(), e);
} finally {
IvyContext.popContext();
}
return eaReport;
}