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

标签 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 自动加载插件文件夹中的包?

最佳答案

最简单的方法是使用 Apache Felix File Install .它与 Equinox 一起工作得很好,你只需要将文件安装配置参数放入 configuration/config.ini 中。请注意,如果您通过启动器 JAR 或二进制文件启动 Equinox,工作目录将是 configuration/或 plugins/目录的父目录。

摘 self 们的项目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 .它更先进、更强大,但我发现它很难使用。

好消息是,如果您的应用程序不知道 bundle 的配置方式(应该是这样),您以后随时可以改变主意。

关于java - Eclipse Equinox,如何配置自动加载插件文件夹中的包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5171551/

相关文章:

java - 如何将 new Date(0L) 正确转换为 LocalDate (1970-01-01)?

java - Eclipse 格式化程序和双括号初始化

java - 更改maven eclipse项目中的java SDK版本

java - Eclipse:使用 Java 类编译 AspectJ 类

java - 在 karaf 中安装 scr 功能后,激活方法被调用两次

java.lang.SecurityException : class "org.eclipse.core.runtime.PlatformObject"'s signer information does not match signer information 错误

java - 如何在 servlet 过滤器中重定向?

java - 如何从 LinkedList 获取数据?

java - 如何将一个字符串转换为另一个字符串,以便输出中不允许使用特定字符?

spring - 访问 Web 应用程序包中的 Spring 配置文件