gpt4 book ai didi

eclipse - 如何从脚本安装eclipse插件列表?

转载 作者:行者123 更新时间:2023-12-03 12:41:25 24 4
gpt4 key购买 nike

我需要一种从Linux中的脚本以完全无人值守的方式设置高度自定义的Eclipse编码环境的方法。定制的Eclipse环境需要安装来自各种来源(protobuf,pydev,cmakeed,openinterminal,egit,yaml,webpageeditor等)的大约10个不同的插件。每次使用gui手动进行此操作都需要20到30分钟。我想自动化脚本中的插件安装,以便任何运行linux的人都可以使用自定义的插件集重新创建我的Eclipse环境,而无需人工干预。任何人都有关于如何执行此操作的建议?

最佳答案

这是安装我最喜欢的一些插件的命令行片段(在Eclipse Indigo 3.7上进行了测试)...诀窍是找出软件包的“installIU”参数的值... Eclipse GUI将在以下情况下显示此信息:您在安装程序窗口中选择了所需的软件包后,单击“更多”链接。

cmakeed - CMake editor

eclipse -nosplash -application org.eclipse.equinox.p2.director -repository http://download.eclipse.org/releases/indigo/,http://cmakeed.sourceforge.net/eclipse/ -installIU com.cthing.cmakeed.feature.feature.group

OpenInTerminal - Add option in context menu
eclipse -nosplash -application org.eclipse.equinox.p2.director -repository http://download.eclipse.org/releases/indigo/,http://eclipse-openinterminal.googlecode.com/svn/trunk/site/ -installIU OpenInTerminal.feature.group

protobuf-dt - Google Protobuffer editor
eclipse -nosplash -application org.eclipse.equinox.p2.director -repository http://download.eclipse.org/releases/indigo/,http://download.eclipse.org/modeling/tmf/xtext/updates/composite/releases/,http://protobuf-dt.googlecode.com/git/update-site -installIU com.google.eclipse.protobuf.feature.group

yedit - YAML Editor
eclipse -nosplash -application org.eclipse.equinox.p2.director -repository http://download.eclipse.org/releases/indigo/,http://dadacoalition.org/yedit -installIU org.dadacoalition.yedit.feature.group

shelled - Bash Script Editor
eclipse -nosplash -application org.eclipse.equinox.p2.director -repository http://download.eclipse.org/releases/indigo/,http://download.eclipse.org/technology/dltk/updates/,https://sourceforge.net/projects/shelled/files/shelled/update/ -installIU net.sourceforge.shelled.feature.group

网页编辑器
eclipse -nosplash -application org.eclipse.equinox.p2.director -repository http://download.eclipse.org/releases/indigo/ -installIU org.eclipse.jst.webpageeditor.feature.feature.group

Pydev
Pydev棘手,因为它需要首先安装证书...这是一个自动化该步骤的脚本:
#!/usr/bin/python
# Add PyDev's certificate to Java's key and certificate database
# Certificate file here: http://pydev.org/pydev_certificate.cer
import os, sys, pexpect, urllib2
def main():
# NOTE: You may have to update the path to your system's cacerts file
certs_file = '/usr/lib/jvm/default-java/jre/lib/security/cacerts'
pydev_certs_url = 'http://pydev.org/pydev_certificate.cer'
print "Adding pydev_certificate.cer to %s" % (certs_file)
pydev_cert = open('pydev_certificate.cer', 'w')
pydev_cert.write(urllib2.urlopen(pydev_certs_url).read())
pydev_cert.close()
cmd = "keytool -import -file ./pydev_certificate.cer -keystore %s" % (certs_file)
child = pexpect.spawn(cmd)
child.expect("Enter keystore password:")
child.sendline("changeit")
if child.expect(["Trust this certificate?", "already exists"]) == 0:
child.sendline("yes")
try:
child.interact()
except OSError:
pass
print "done"

if __name__ == "__main__":
main()

然后,您可以运行:
eclipse -nosplash -application org.eclipse.equinox.p2.director -repository http://download.eclipse.org/releases/indigo/,http://pydev.org/updates/ -installIU org.python.pydev.feature.feature.group

关于eclipse - 如何从脚本安装eclipse插件列表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15262572/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com