问题
I am developing Node.js script to install Eclipse plugins by using Eclipse built-in p2 director application. And p2-director fails to update features in some cases.
D:\Workspaces\Nodeclipse-DEV\nodeclipse-1\org.nodeclipse.ui\templates>node nodeclipse-install.js install -repository jar:file:/D:/Workspaces/Nodeclipse-DEV/nodeclipse-1/org.nodeclipse.site/target/org.nodeclipse.site-0.10.0-SNAPSHOT.zip!/ maven
Nodeclipse CLI Installer (Eclipse Plugin Manager epm)
starting eclipsec -nosplash -application org.eclipse.equinox.p2.director -repository jar:file:/D:/Workspaces/Nodeclipse-DEV/nodeclipse-1/org.nodeclipse.site/target/org.nodeclipse.site-0.10.0-SNAPSHOT.zip!/ -installIU org.nodeclipse.enide.maven.feature.feature.group -tag org.nodeclipse.enide.maven.feature.feature.group -vmargs -Declipse.p2.mirrors=false
Installing org.nodeclipse.enide.maven.feature.feature.group 0.10.0.201402180840.
Installation failed.
Cannot complete the install because of a conflicting dependency.
Software being installed: Enide Maven 0.10.0.201402180840 (org.nodeclipse.enide.maven.feature.feature.group 0.10.0.201402180840)
Software currently installed: Enide Maven 0.10.0.201402170319 (org.nodeclipse.enide.maven.feature.feature.group 0.10.0.201402170319)
Only one of the following can be installed at once:
Enide Maven 0.10.0.201402180840 (org.nodeclipse.enide.maven.feature.feature.jar 0.10.0.201402180840)
Enide Maven 0.10.0.201402170319 (org.nodeclipse.enide.maven.feature.feature.jar 0.10.0.201402170319)
Cannot satisfy dependency:
From: Enide Maven 0.10.0.201402170319 (org.nodeclipse.enide.maven.feature.feature.group 0.10.0.201402170319)
To: org.nodeclipse.enide.maven.feature.feature.jar [0.10.0.201402170319]
Cannot satisfy dependency:
From: Enide Maven 0.10.0.201402180840 (org.nodeclipse.enide.maven.feature.feature.group 0.10.0.201402180840)
To: org.nodeclipse.enide.maven.feature.feature.jar [0.10.0.201402180840]
Application failed, log file location: E:\Eclipse\Enide-Studio-2014-try2-win64\eclipse\configuration\1392717353881.log
eclipsec process exit code 13
I also tried passing both .feature.jar
and feature.group
.
eclipsec -nosplash -application org.eclipse.equinox.p2.director -repository jar:file:/D:/Workspaces/Nodeclipse-DEV/nodeclipse-1/org.nodeclipse.site/target/org.nodeclipse.site-0.10.0-SNAPSHOT.zip!/ -installIU org.nodeclipse.enide.maven.feature.feature.group -tag org.nodeclipse.enide.maven.feature.feature.group -vmargs -Declipse.p2.mirrors=false
This maybe related to the fact that .maven
feature includes .maven
and .common
plugins. .common
plugin is also used by other features.
However this also happens with other features, that have no shared dependencies. p2 director help page does not specify the logic nor gives references.
回答1:
On the p2 director level, there is no 'update' operation. Instead, you need to tell the director to both 'uninstall' and 'install' the IU that you want to be updated:
eclipse -application org.eclipse.equinox.p2.director -uninstallIU org.nodeclipse.enide.maven.feature.feature.group -installIU org.nodeclipse.enide.maven.feature.feature.group -repository ...
来源:https://stackoverflow.com/questions/21897454/eclipse-p2-director-application-cannot-update-a-feature