我试图同时学习Xtend和Eclipse插件开发。我创建了一个Eclipse插件项目,并添加了三个Xtend类以在应用程序模型中实现Parts。如果我将该项目保留为基于插件的项目,并尝试从产品配置中启动它,那么一切正常。
但是,如果我将其转换为基于功能的项目并尝试从产品配置中启动它,则尝试解析Arrays.asList(Classtouse.getDeclaredFields()).forEach(Field -> FieldMap.put(Field.getName(),Field.get(//your object here)));
时会出错。
这是错误日志:
com.google.guava
这是MANIFEST.MF文件:
!SESSION 2018-07-27 06:36:27.121 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.8.0_181
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments: -product com.example.e4.rcp.todo.product -clearPersistedState
Command-line arguments: -product com.example.e4.rcp.todo.product -data D:\WiseOldBird\Workspaces\VogellaRcpXtend/runtime-todo.product -dev file:D:/WiseOldBird/Workspaces/VogellaRcpXtend/.metadata/.plugins/org.eclipse.pde.core/todo.product/dev.properties -os win32 -ws win32 -arch x86_64 -consoleLog -clearPersistedState
!ENTRY org.eclipse.equinox.app 0 0 2018-07-27 06:36:28.434
!MESSAGE Product com.example.e4.rcp.todo.product could not be found.
!ENTRY com.example.e4.rcp.todo 2 0 2018-07-27 06:36:28.526
!MESSAGE Could not resolve module: com.example.e4.rcp.todo [75]
Unresolved requirement: Require-Bundle: com.google.guava
!ENTRY org.eclipse.osgi 4 0 2018-07-27 06:36:28.531
!MESSAGE Application error
!STACK 1
java.lang.RuntimeException: No application id has been found.
at org.eclipse.equinox.internal.app.EclipseAppContainer.startDefaultApp(EclipseAppContainer.java:242)
at org.eclipse.equinox.internal.app.MainApplicationLauncher.run(MainApplicationLauncher.java:29)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:656)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:592)
at org.eclipse.equinox.launcher.Main.run(Main.java:1498)
at org.eclipse.equinox.launcher.Main.main(Main.java:1471)
An error has occurred. See the log file
D:\WiseOldBird\Workspaces\VogellaRcpXtend\.metadata\.plugins\org.eclipse.pde.core\todo.product\1532691387713.log.
这是feature.xml文件:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Todo
Bundle-SymbolicName: com.example.e4.rcp.todo;singleton:=true
Bundle-Version: 1.0.0.qualifier
Automatic-Module-Name: com.example.e4.rcp.todo
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: com.google.guava,
org.eclipse.xtext.xbase.lib,
org.eclipse.xtend.lib,
org.eclipse.xtend.lib.macro
我一直无法弄清楚如何在功能项目中指定其他Xtend依赖关系,并需要建议。
答案 0 :(得分:0)
如错误消息所述,您的产品不包含Guava插件。 当您希望产品基于功能时,必须添加一个包含Guava插件的功能。如有必要,您可以为此定义自己的功能。