【OSGi】OSGi与Maven、Eclipse PlugIn的区别

OSGi是一种运行时框架,与Maven和Eclipse PlugIn不同。Maven是编译工具,无法解决JAR包问题,而OSGi提供包级别信息隐藏。Eclipse PlugIn依赖于整个plugin,而非OSGi的包级别依赖。OSGi通过Equinox在Eclipse中实现动态模块系统,解决了Eclipse早期静态插件问题。
摘要由CSDN通过智能技术生成


OSGi与Maven

Maven也具有模块化系统的特征;但是它只是一个编译时工具,而不是运行时框架。Maven并不是OSGi的竞争者,而是OSGi的一个补充。

通过在pom.xml中指定所依赖jar包的名称、版本号,Maven就能在编译时自动下载正确的jar文件,并部署到classpath中。

然而Maven并没有解决JAR文件的缺点

  • 同样使用全局的classpath;
  • 同样不能做到包级别的信息隐藏;

而且pom.xml的格式与OSGi格式并不兼容。所以,如果用Maven编译OSGi系统,通常需要定义两遍metadata:

  • 在pom.xml中定义Maven的metadata
  • 在MANIFEST.MF中定义OSGi的metadata

----------

Maven and Ivy are both popular tools that have some characteristics of a module system, but they are build-time tools rather than runtime frameworks. Thus they do not compete directly with OSGi, in fact they are complementary and many developers are using Maven or Ivy to build OSGi-based systems.

Maven is a complete, standalone build tool, whereas Ivy is a component th

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值