2010-02-12 74 views
3

我最近开发了一个Eclipse插件,但该插件似乎没有在Eclipse(3.4.2)中加载。如果我去如何加载eclipse插件

Help > About Eclipse Platform > Configuration Details 

我看到pluging上市

file:/C:/Program Files/eclipse/ganymede/plugins/de.vogella.plugin.htmlconverter_1.0.0.jar 

但是它似乎并没有工作。我知道该插件已正确实施,就好像我右键单击该项目(de.vogella.plugin.htmlconverter)并选择Run Eclipse Application,然后启动新的Eclipse并且已实施的弹出式菜单起作用。那么,为什么当我从Eclipse中导出项目并将其放入插件目录时,它不起作用。

我已经在Windows XP和Mac OS X上尝试过这种方法,如果我检查JAR,我会看到所有需要的工件。

META-INF/ 
META-INF/MANIFEST.MF 
de/ 
de/vogella/ 
de/vogella/plugin/ 
de/vogella/plugin/htmlconverter/ 
de/vogella/plugin/htmlconverter/handler/ 
src/ 
src/de/ 
src/de/vogella/ 
src/de/vogella/plugin/ 
src/de/vogella/plugin/htmlconverter/ 
src/de/vogella/plugin/htmlconverter/handler/ 
de/vogella/plugin/htmlconverter/Activator.class 
de/vogella/plugin/htmlconverter/handler/Convert.class 
plugin.xml 

MANIFEST.MF也像这样

Manifest-Version: 1.0 
Bundle-ManifestVersion: 2 
Bundle-Name: Htmlconverter Plug-in 
Bundle-SymbolicName: de.vogella.plugin.htmlconverter;singleton:=true 
Bundle-Version: 1.0.0 
Bundle-Activator: de.vogella.plugin.htmlconverter.Activator 
Require-Bundle: org.eclipse.ui,org.eclipse.core.runtime,org.eclipse.co 
re.resources;bundle-version="3.4.0",org.eclipse.jdt.core;bundle-versi 
on="3.4.0" 
Bundle-RequiredExecutionEnvironment: J2SE-1.5 
Import-Package: org.osgi.framework;version="1.3.0" 
Export-Package: de.vogella.plugin.htmlconverter;uses:="org.osgi.framew 
ork,org.eclipse.ui.plugin",de.vogella.plugin.htmlconverter.handler;us 
es:="org.eclipse.core.commands,org.eclipse.core.resources,org.eclipse 
.core.runtime" 

我试图延迟激活和渴望激活,但仍然一无所获。真正令人困惑的是,它在我调试和启动单独的Eclipse应用程序时起作用。任何想法我做错了什么。
是否有其他Eclipse插件可以执行某种形式的诊断并告诉我什么是错误的。

最后一点,如果我查看Eclipse错误日志,我看不到任何错误。但是,如果我编辑MANIFEST.MF并放入一些垃圾字符串,它会报告错误并验证MANIFEST.MF,所以我知道Eclipse会看到插件

任何人都可以帮忙吗?

+0

@ng奇怪,你能用'-clean -console'选项启动日食吗?你可以尝试一个新的(没有其他插件)日食?你用eclipse3.5试过了吗? – VonC 2010-02-12 12:32:05

+0

嗨,没有消息与 - 清洁 - 控制台,它在3.5的工作? – 2010-02-12 14:35:00

+0

@ng:请参阅我编辑的答案(关于Eclipse 3.4.x中p2的状态) – VonC 2010-02-12 14:51:16

回答

4

从eclipse3.4开始,你的eclipse安装中有一个新的目录dropins。
Eclipse p2

alt text http://www.jroller.com/myeclipseblog/resource/7-OpenDropinsFolder.png

尝试插件那里复制。

还请检查,因为illustrated by this thread,您没有定义您自己的config.ini

当我将其更改为'Generate a default config.ini file'并刷新它时,它工作正常。


的OP NG补充说:

那么它曾在3.5,但为什么不3.4.x?

p2已经在3.4开发生命周期(3.4M6)的最后阶段推出,起初是相当麻烦的。
p2的3.5版本被认为更稳定。

这促使像 “Re-enable old Update Manager in 3.4.0 and disable p2 as update engine/UI” 的错误,因为(摘自错误报告):

  • P2被公开在Eclipse开发周期(M6)异常晚了。 社区没有机会广泛测试这样一个中心特征。
  • 为P2打开的bug列表是这么大,晚 平台变化

非常大(more then 4000,他们大多收为3.5版本,但仍...)

所以如果你可以使用eclipse3.5,那工作 p2功能会更好。


吴补充说:

但一定是安装在3.4.x插件的方式,

你可以尝试在shared plugin directory复制你的插件,它应该能够解释pre-p2和p2格式。
这一共同外部目录将通过(3.4)引用:

[eclipse]\links\myplugins.link file 
content: 
path=C:/my/eclipse/plugins 

(为3.5,你可以使用一个eclipse.ini setting,如this eclipse.ini

尝试复制你的插件尊重类似的目录结构到一个我used for a ClearCase plugin

myPlugins 
    my.plugin.x.y.z 
    eclipse 
     features 
      ... 
     plugins 
      ... 

如果你的罐子已经遵守上述所示的my.plugin.xyz结构,你可以只复制罐子在myPlugins目录。 (两个办法可以在这里尝试)

+0

这似乎不起作用,我试图把它放在下拉菜单中,但仍然看不到菜单。另外作为一个基准,我添加了de.bastiankrol.startexplorer_0.4.0.200810292106.jar到dropins文件夹中。这是来自Eclipse站点的可下载插件,这也不起作用,我知道我以前在其他安装上尝试过,并且它工作正常。 – 2010-02-12 12:06:08

+0

@ng奇怪,你可以用'-clean -console'选项启动日食吗?你可以尝试一个新的(没有其他插件)日食?你用eclipse3.5试过了吗? – VonC 2010-02-12 12:32:32

+0

在“dropins”文件夹内创建一个文件夹“eclipse”。在新的“sclipse”文件夹内创建一个文件夹“插件”。将你的插件放到新的“插件”文件夹中。 http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/misc/p2_dropins_format.html – Arne 2010-02-12 13:36:23

6

听起来你正在使用我的教程:http://www.vogella.de/articles/EclipsePlugIn/article.html

安装介质P2已经3.4和3.5之间的增强。这可以解释行为的差异。听起来你可以选择使用Eclipse 3.5。我强烈建议在3.4中使用3.5作为p2,这是p2的第一个版本,它取代了旧的更新管理器。

+0

Lars ?!我没有马上看到你的答案,但是对于所有那些有用的Eclipse文章的作者必须使用t + 1 :)谢谢并欢迎Stack Overflow。 – VonC 2010-02-15 15:12:09