Eclipse RCP 产品中的自定义 config.ini
我的 eclipse RCP (3.7) 应用程序目前状况良好,产品可以成功导出到多个平台并且运行良好。我需要的是更改 config.ini 文件中的一些属性,特别是 osgi.instance.area.default 和 osgi.configuration.area 。
在 Eclipse 产品编辑器的配置选项卡中,我选中使用现有的 config.ini 文件并选择我在托管产品的同一项目中创建的config.ini
(以及核心特征)定义。
为了创建自定义 config.ini,我只是采用了先前导出中生成的配置,并添加了上述属性。
发生的情况是,导出产品后,config.ini
仍然在 configuration/config.ini
中自动生成,无需我进行编辑。我缺少什么?
这就是我的产品定义:
<?xml version="1.0" encoding="UTF-8"?>
<?pde version="3.5"?>
<product name="MyApp" id="it.myapp.product" application="it.myapp.application" version="1.0.0.qualifier" useFeatures="true" includeLaunchers="true">
<configIni use="default">
<linux>/it.myapp.app/config.ini</linux>
<macosx>/it.myapp.app.app/config.ini</macosx>
<solaris>/it.myapp.app.app/config.ini</solaris>
<win32>/it.myapp.app/config.ini</win32>
</configIni>
<launcherArgs>
<programArgs>-nl it</programArgs>
<vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts</vmArgsMac>
</launcherArgs>
<windowImages />
<splash
location="it.myapp"
startupProgressRect="6,378,485,13"
startupMessageRect="7,397,445,22"
startupForegroundColor="000000" />
<launcher name="myapp">[...]</launcher>
<vm>
</vm>
<plugins>
<plugin id="com.ibm.icu"/>
[...]
<plugin id="org.sat4j.pb"/>
</plugins>
<features>
<feature id="it.myapp.feature"/>
</features>
<configurations>
<plugin id="it.myapp" autoStart="false" startLevel="5" />
<plugin id="org.eclipse.core.runtime" autoStart="true" startLevel="4" />
<plugin id="org.eclipse.equinox.common" autoStart="true" startLevel="2" />
<plugin id="org.eclipse.equinox.ds" autoStart="true" startLevel="2" />
<plugin id="org.eclipse.equinox.simpleconfigurator" autoStart="true" startLevel="1" />
</configurations>
</product>
My eclipse RCP (3.7) application is currently in a good shape, in which product can be exported successfully for multiple platforms and runs just fine. What I need is to change some properties in config.ini
file, in particular osgi.instance.area.default
and osgi.configuration.area
.
In the configuration tab of eclipse product editor, I check Use an existing config.ini file and select the config.ini
I created inside the same project hosting the product (and the core feature) definition.
To create the custom config.ini, I just took the one generated in a previous export, and added above properties.
What happens is that after exporting the product, config.ini
is still auto-generated in configuration/config.ini
, without my edits. What am I missing?
This is how my product definition looks like:
<?xml version="1.0" encoding="UTF-8"?>
<?pde version="3.5"?>
<product name="MyApp" id="it.myapp.product" application="it.myapp.application" version="1.0.0.qualifier" useFeatures="true" includeLaunchers="true">
<configIni use="default">
<linux>/it.myapp.app/config.ini</linux>
<macosx>/it.myapp.app.app/config.ini</macosx>
<solaris>/it.myapp.app.app/config.ini</solaris>
<win32>/it.myapp.app/config.ini</win32>
</configIni>
<launcherArgs>
<programArgs>-nl it</programArgs>
<vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts</vmArgsMac>
</launcherArgs>
<windowImages />
<splash
location="it.myapp"
startupProgressRect="6,378,485,13"
startupMessageRect="7,397,445,22"
startupForegroundColor="000000" />
<launcher name="myapp">[...]</launcher>
<vm>
</vm>
<plugins>
<plugin id="com.ibm.icu"/>
[...]
<plugin id="org.sat4j.pb"/>
</plugins>
<features>
<feature id="it.myapp.feature"/>
</features>
<configurations>
<plugin id="it.myapp" autoStart="false" startLevel="5" />
<plugin id="org.eclipse.core.runtime" autoStart="true" startLevel="4" />
<plugin id="org.eclipse.equinox.common" autoStart="true" startLevel="2" />
<plugin id="org.eclipse.equinox.ds" autoStart="true" startLevel="2" />
<plugin id="org.eclipse.equinox.simpleconfigurator" autoStart="true" startLevel="1" />
</configurations>
</product>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你没有错过任何东西——这只是行不通。我也有同样的经历。您可以尝试升级到较新版本的 Eclipse,希望该功能能够正常工作。
请参阅:https://bugs.eclipse.org/bugs/show_bug.cgi?id =284732
我建议通过使用 root-properties 来解决这个问题:
Eclipse RCP 根属性< /a>
You are not missing anything - this just does not work. I experienced the same. You can try upgrading to a more recent version of Eclipse which hopefully has this function working.
See: https://bugs.eclipse.org/bugs/show_bug.cgi?id=284732
I suggest to work around this by using root-properties:
Eclipse RCP root-properties