在Equinox中运行Xtext

时间:2019-01-28 13:45:06

标签: osgi equinox bndtools

我正在尝试在Equinox OSGi运行时中使用Xtext运行项目。作为最小的示例,我仅将org.eclipse.xtext添加到了我的运行时。但是,我最终将许多捆绑包留在STARTING阶段:

g! ss
"Framework is launched."

id  State       Bundle
0   ACTIVE      org.eclipse.osgi_3.13.100.v20180827-1536
1   ACTIVE      com.google.guava_20.0.0
2   ACTIVE      com.google.guava_25.1.0.jre
3   ACTIVE      com.google.inject_4.2.2
4   ACTIVE      log4j_1.2.17
5   ACTIVE      org.antlr.runtime_3.2.0
6   ACTIVE      org.apache.felix.gogo.command_1.1.0
7   ACTIVE      org.apache.felix.gogo.runtime_1.1.2
8   ACTIVE      org.apache.felix.gogo.shell_1.1.2
9   STARTING    org.eclipse.emf.common_2.15.0.v20180723-1316
10  STARTING    org.eclipse.emf.ecore_2.15.0.v20180722-1159
11  STARTING    org.eclipse.emf.ecore.xmi_2.15.0.v20180706-1146
12  STARTING    org.eclipse.equinox.common_3.10.200.v20181021-1645
13  ACTIVE      org.eclipse.equinox.console_1.3.200.v20181115-0906
14  ACTIVE      org.eclipse.xtend.lib_2.16.0.v20181203-0507
15  ACTIVE      org.eclipse.xtend.lib.macro_2.16.0.v20181203-0507
16  STARTING    org.eclipse.xtext_2.16.0.v20181203-0514
17  ACTIVE      org.eclipse.xtext.util_2.16.0.v20181203-0514
18  ACTIVE      org.eclipse.xtext.xbase.lib_2.16.0.v20181203-0507
19  ACTIVE      org.sonatype.inject_1.4.2

我正在Eclipse中使用Bndtools,它也解决了所需的捆绑软件。在下面找到我的bndrun文件:

-runfw: org.eclipse.osgi;version='[3.13.100.v20180827-1536,3.13.100.v20180827-1536]'
-runee: JavaSE-1.8
-runrequires: \
    bnd.identity;id='org.apache.felix.gogo.shell',\
    bnd.identity;id='org.eclipse.equinox.console',\
    bnd.identity;id='org.apache.felix.gogo.runtime',\
    bnd.identity;id='org.apache.felix.gogo.command',\
    bnd.identity;id='org.eclipse.xtext'
-runproperties: \
    org.osgi.framework.storage.clean=onFirstInit,\
    eclipse.consoleLog=true,\
    osgi.console=,\
    osgi.console.enable.builtin=false
-runprogramargs: console
-runsystempackages: sun.misc
-runbundles: \
    com.google.guava;version='[20.0.0,20.0.1)',\
    com.google.guava;version='[25.1.0,25.1.1)',\
    com.google.inject;version='[4.2.2,4.2.3)',\
    log4j;version='[1.2.17,1.2.18)',\
    org.antlr.runtime;version='[3.2.0,3.2.1)',\
    org.apache.felix.gogo.command;version='[1.1.0,1.1.1)',\
    org.apache.felix.gogo.runtime;version='[1.1.2,1.1.3)',\
    org.apache.felix.gogo.shell;version='[1.1.2,1.1.3)',\
    org.eclipse.emf.common;version='[2.15.0,2.15.1)',\
    org.eclipse.emf.ecore;version='[2.15.0,2.15.1)',\
    org.eclipse.emf.ecore.xmi;version='[2.15.0,2.15.1)',\
    org.eclipse.equinox.common;version='[3.10.200,3.10.201)',\
    org.eclipse.equinox.console;version='[1.3.200,1.3.201)',\
    org.eclipse.xtend.lib;version='[2.16.0,2.16.1)',\
    org.eclipse.xtend.lib.macro;version='[2.16.0,2.16.1)',\
    org.eclipse.xtext;version='[2.16.0,2.16.1)',\
    org.eclipse.xtext.util;version='[2.16.0,2.16.1)',\
    org.eclipse.xtext.xbase.lib;version='[2.16.0,2.16.1)',\
    org.sonatype.inject;version='[1.4.2,1.4.3)'

有什么想法吗?

1 个答案:

答案 0 :(得分:2)

没事。

Eclipse大量使用Bundle-ActivationPolicy: lazy。这样做的原因很复杂,而且大多是遗留的,但这意味着这些捆绑软件保持在STARTING状态,直到其他捆绑软件需要从它们中加载类(例如DS组件实现类或从{{1 }})。在那时,它们过渡到完整的plugin.xml状态。

在换句话说,ACTIVE的状态,并不表示任何错误。