【发布时间】:2018-10-23 21:10:34
【问题描述】:
我正在尝试同时学习 Xtend 和 Eclipse 插件开发。我创建了一个 Eclipse 插件项目并添加了三个 Xtend 类来实现应用程序模型中的部件。如果我将项目保留为基于插件的项目并尝试从产品配置中启动它,则一切正常。
但是,如果我将其转换为基于功能的项目并尝试从产品配置中启动它,我会在尝试解析 com.google.guava 时遇到错误。
这是错误日志:
!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.
这是 MANIFEST.MF 文件:
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
这里是 feature.xml 文件:
<?xml version="1.0" encoding="UTF-8"?>
<feature
id="com.example.e4.rcp.todo.feature"
label="Feature"
version="1.0.0.qualifier">
<description url="http://www.example.com/description">
[Enter Feature Description here.]
</description>
<copyright url="http://www.example.com/copyright">
[Enter Copyright Description here.]
</copyright>
<license url="http://www.example.com/license">
[Enter License Description here.]
</license>
<requires>
<import plugin="com.google.guava"/>
<import plugin="org.eclipse.xtext.xbase.lib"/>
</requires>
<plugin
id="com.example.e4.rcp.todo"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
</feature>
我一直无法弄清楚如何在功能项目中指定额外的 Xtend 依赖项,需要建议。
【问题讨论】:
标签: xtend