Choosing plugins to update with P2 and eclipse 4 programmatically [message #1771067] |
Mon, 21 August 2017 11:41  |
Eclipse User |
|
|
|
I would like to update a P2 repository with Eclipse 4 programmatically and I would like to choose plugins to update. Classic way to retrieve the provisioning job which updates the repository is:
ProvisioningSession session = new ProvisioningSession(agent);
UpdateOperation operation = new UpdateOperation(session);
operation.getProvisioningContext().setArtifactRepositories(new URI[] { uri});
operation.getProvisioningContext().setMetadataRepositories(new URI[] { uri});
IStatus status = operation.resolveModal(sub.newChild(100))
ProvisioningJob provisioningJob = operation.getProvisioningJob(monitor);
IStatus st = provisioningJob.runModal(monitor);
The resolveModal method checks plugins to update. If I print the possible updates I will have only the product and not the plugins to update.
Update[] updates = operation.getPossibleUpdates();
Now, how to choose the plugins I would like to updates? The UpdateOperation object constructor allows me to specify a list of Installable Units, but if I exclude only the plugin I do not want, the system equally updates all the repository (because of product which is included in the list of installable units?).
Thank you.
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.29158 seconds