Eclipseプラグインをコマンドラインでインストールする方法

BoxenというかPuppetでEclipse環境を構築するのにプラグインのインストールをDropins使ってやろうと思ったのだけど、どうもDropins用にファイルで提供してるプラグインがあまりない感じだったのでやり方を探してみたところ分かったのでメモ。

やり方

インストール:

$ <eclipse-home>/eclipse -nosplash \
  -application org.eclipse.equinox.p2.director \
  -profile SDKProfile \
  -destination <eclipse-home> \
  -repository http://download.eclipse.org/releases/juno \
  -installIU <plugins-id>

アンインストール:

$ <eclipse-home>/eclipse -nosplash \
  -application org.eclipse.equinox.p2.director \
  -profile SDKProfile \
  -destination <eclipse-home> \
  -repository http://download.eclipse.org/releases/juno \
  -uninstallIU <plugin-id> 

repositoryにはインストールするプラグインの依存関係にあるアップデートサイトは全て指定しておかないとだめっぽい。ちなみにカンマ区切りで指定すれば良い。

複数のpluginをまとめてインストール/アンインストールする場合はinstallIU/uninstallIUオプション付きで指定。

例:VrapperをJDTフィーチャ、surroundオプション付きで入れる

$ <eclipse-home>/eclipse -nosplash \
  -application org.eclipse.equinox.p2.director \
  -profile SDKProfile \
  -destination <eclipse-home> \
  -repository http://download.eclipse.org/releases/juno,http://vrapper.sourceforge.net/update-site/stable \
  -installIU net.sourceforge.vrapper.feature.group \
  -installIU net.sourceforge.vrapper.eclipse.jdt.feature.feature.group \
  -installIU net.sourceforge.vrapper.plugin.surround.feature.group

詳しくは以下参照

http://help.eclipse.org/juno/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/p2_director.html