最简单的方法是使用
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
其他可能的解决方案是使用Eclipse P2.它更加先进和强大,但我发现它很难使用.
好的一点是,如果您的应用程序与捆绑包的配置方式无关(并且应该是这样),您可以随时改变主意.