Problems with P2 garbage collector [message #1803990] |
Thu, 14 March 2019 19:11  |
Eclipse User |
|
|
|
I have a RAP product and I using the P2 Operations API (org.eclipse.equinox.p2.operations) to install an remove features depending on certain command line arguments.
The features are installed and removed correctly, but the plugins of a removed feature are not deleted.
After some searching I saw what i though was the answer to my question:Equinox/p2/FAQ
I try to install a feature as follows:
myRapApp -install -profileProperties org.eclipse.update.install.features=true
After the install the systemis shutdown, then restart it and uninstall the feature making sure the the p2 garbage collector is explicitly invoke. See code below:
IQueryResult<IInstallableUnit> queryResult = getInstalledIUfromID(rootIdToUninstall);
if (queryResult.isEmpty()) {
log.error("Installable unit {} is not installed.", rootIdToUninstall);
return false;
}
// --- If found, trigger an UninstallOperation ---------------
UninstallOperation uninstallOperation = new UninstallOperation(this.provisioningSession, queryResult.toSet());
IStatus result = this.performOperation(uninstallOperation);
if (!result.isOK()) {
String childStatusStr = null;
for ( IStatus children : result.getChildren()) {
childStatusStr += "\t" + children.toString() + LINE_SEP;
}
log.error("Fail to uninstall {}: {} {} {}", rootIdToUninstall, result.getMessage(), LINE_SEP, childStatusStr);
if ( result.getException() != null ) {
log.error("Uninstalling exception:", result.getException());
}
} else {
IProfileRegistry profileRegistry = (IProfileRegistry) this.provisioningAgent.getService(IProfileRegistry.SERVICE_NAME);
IProfile profile = profileRegistry.getProfile(IProfileRegistry.SELF);
GarbageCollector gc = (GarbageCollector) this.provisioningAgent.getService(GarbageCollector.SERVICE_NAME);
gc.runGC(profile);
}
Unfortunately, the plugins are still there after the feature is uninstalled.
How can I made sure that I am specifying the "org.eclipse.update.install.features=true" property correctly, it seems that the -profileProperties org.eclipse.update.install.features=true is not doing the trick.
Moreover, is there a way to set this property to true by default?
Could it be that I am still missing something else?
Additionally, using tycho I have materialize a product with several features with installMode="root" and making sure that the org.eclipse.update.install.features=true is in the p2 properties. I have actually inspected the profile files to double check. Everything is there.
However when I uninstall any of the features running the code I put above to invoque explicitly the p2 garbage collector this does not delete the plugins associated to the the feature group but it does delete the feature from the feature folder.
I run out if ideas
[Updated on: Thu, 14 March 2019 20:17] by Moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03002 seconds