Eclipse Equinox,如何配置自动加载插件文件夹中的包

Joh*_*ler 8 java eclipse osgi helios

我已经关注了http://www.eclipse.org/equinox/documents/quickstart-framework.php,但它看起来很旧而且无效.

没有像org.eclipse.update.configurator_3.2.100.jar所描述的这样的包

我尝试使用org.eclipse.equinox.simpleconfigurator_1.0.200.v20100503,但不起作用.

任何人都可以告诉我如何让Equinox自动加载plugins文件夹中的包?

Iva*_*rov 14

最简单的方法是使用Apache Felix File Install.使用Equinox可以正常工作,只需将文件安装配置参数放入configuration/config.ini即可.请注意,如果您通过启动程序JAR或二进制文件启动Equinox,则工作目录将是configuration /或plugins /目录的父目录.

摘自我们的项目config.ini:

# Start File Install itself
osgi.bundles=reference\:file\:org.apache.felix.fileinstall_3.1.0.jar@1\:start
# The name of the directory to watch
felix.fileinstall.dir=./plugins
# A regular expression to be used to filter file names
# We have all bundles in plugins/ directory, this regexp
# forbids monitoring bundles that are started via osgi.bundles property
felix.fileinstall.filter=^(?!org.apache.felix.fileinstall|org.eclipse.osgi).*
# Determines if File Install waits felix.fileinstall.poll milliseconds before doing an initial scan or not.
felix.fileinstall.noInitialDelay=true
# Not sure why we have this...
felix.fileinstall.start.level=2
Run Code Online (Sandbox Code Playgroud)

其他可能的解决方案是使用Eclipse P2.它更加先进和强大,但我发现它很难使用.

好的是,如果您的应用程序与捆绑包的配置方式无关(并且应该是这种方式),您可以随时改变主意.