We are building an Eclipse RCP based application. It consists of several features. Our team is developing one of them. Let’s call this feature ‘update’. It consists of three bundles: ‘util’, ‘ws’ and ‘ui’.
My current task is to trigger an update with p2 of this ‘update’ feature. For that purpose I have a repository with the new version of my feature and its plugins uploaded on a web server.
Within one of the above bundles ( the ‘ui’ bundle to be precise) I have the following code snippet:
import org.eclipse.equinox.internal.p2.director.app.DirectorApplication;
…
URL guiRepositoryLocation = getGuiRepository();
DirectorApplication director = new DirectorApplication();
director.run(new String[] { "-repository", guiRepositoryLocation.toString(), "-installIU",
"update.feature.group", "-uninstallIU", "update.feature.group", "-destination", ".", "-profile",
"profile" });
The director application loads the profile and the repository, finds the features in both locations, but at the end fails with the following error:
Installing update.feature.group 1.50.0.201107141712-49L-7B5885Q8H8Q8B.
Uninstalling update.feature.group 1.0.12.201107012042-4-7Z7B5885Q58B5HB.
Installation failed.
Cannot complete the install because of a conflicting dependency.
Software being installed: Feature 1.50.0.201107141712-49L-7B5885Q8H8Q8B (update.feature.group 1.50.0.201107141712-49L-7B5885Q8H8Q8B)
Software currently installed: Product 1.0.12.201107012042 (product 1.0.12.201107012042)
Only one of the following can be installed at once:
Product - Update Web Service Client 1.0.12.201107012042 (ws 1.0.12.201107012042)
Product - Update Web Service Client 1.50.0.201107141712 (ws 1.50.0.201107141712)
Cannot satisfy dependency:
From: Feature 1.0.12.201107012042-4-7Z7B5885Q58B5HB (update.feature.group 1.0.12.201107012042-4-7Z7B5885Q58B5HB)
To: ws [1.0.12.201107012042]
Cannot satisfy dependency:
From: Feature 1.50.0.201107141712-49L-7B5885Q8H8Q8B (update.feature.group 1.50.0.201107141712-49L-7B5885Q
8H8Q8B)
To: ws [1.50.0.201107141712]
Cannot satisfy dependency:
From: Product 1.0.12.201107012042 (product 1.0.12.201107012042)
To: update.feature.group [1.0.12.201107012042-4-7Z7B5885Q58B5HB]
Indeed the ‘ws’ plugin is singleton (actually all three plugins are). I can easily change it not to be singleton, but I’m afraid I cannot do it with the ‘ui’ plugin. As its name implies, it contains the UI controls of our feature. They are described in plugin.xml. So when I tried to change the ‘ui’ plugin to be non-singleton, my IDE complained that it was not possible.
Anyway, I would expect that p2 handles both singleton and non-singleton plugins.
Could you please advise me how to trigger the update?
Thanks,
Ivan