@Override
public void run() {
IOTabIvyLogger logger = null;
try {
ProjectInformation projectInformation = ProjectUtils.getInformation(project);
ProjectPreferences projectPreferences = project.getLookup().lookup(ProjectPreferences.class);
ArtifactUpdater updater = project.getLookup().lookup(ArtifactUpdater.class);
Ivy ivy = getIvy(projectPreferences.getIvySettingsFile(), projectPreferences.getIvyPropertiesFiles());
logger = new IOTabIvyLogger(projectInformation.getDisplayName(), IOTabIvyLogger.TAB_SUFFIX);
logger.log(NbBundle.getMessage(IvyFacade.class, "StartResolve"), Message.MSG_INFO);
IvyProgressHandleListener transferListener = new IvyProgressHandleListener(projectInformation.getDisplayName() + " " + NbBundle.getMessage(IvyProgressHandleListener.class, "Resolving"));
IvyProgressHandleTransferListener ivyProgressHandleTransferListener = new IvyProgressHandleTransferListener(projectInformation.getDisplayName());
ivy.getLoggerEngine().setDefaultLogger(logger);
ivy.getEventManager().addIvyListener(transferListener);
ivy.getEventManager().addTransferListener(ivyProgressHandleTransferListener);
URL ivyFileLocation = projectPreferences.getIvyFile().getURL();
String[] confs;
if (projectPreferences.isAllConfsSelected()) {
confs = getConfs(ivyFileLocation, ivy);
} else {
confs = projectPreferences.getSelectedConfs().toArray(new String[0]);
}
SubprojectProvider subprojectProvider = project.getLookup().lookup(SubprojectProvider.class);
transferListener.setConf(Arrays.deepToString(confs));
ResolveOptions resolveOption = new ResolveOptions().setConfs(confs);
resolveOption.setValidate(ivy.getSettings().doValidate());
ResolveReport report = ivy.resolve(ivyFileLocation, resolveOption);
logger.log(NbBundle.getMessage(IvyFacade.class, "EndResolve"), Message.MSG_INFO);
AbstractLibraryParser libraryParser;
if (projectPreferences.isUseCachePath()) {
libraryParser = Lookup.getDefault().lookup(CachePathLibraryParser.class);
} else {
libraryParser = Lookup.getDefault().lookup(RetrievingLibraryParser.class);
}
logger.log(NbBundle.getMessage(IvyFacade.class, "StartLibrariesUpdate"), Message.MSG_INFO);