bndTools为我们提供了一种使用Eclipse开发OSGi bundles的方式。
它没有通过直接编辑Manifest.MF的方式定义依赖关系,
而是使用Bnd文件基于Bnd工具驱动工具链(toolchain)
。它还提供了介绍性的教程。
此外,BndTools还具有自动化语义版本控制功能(automated semantic versioning),它会将已构建的组件和之前发布的组件相比较,让算法来决定是否对大、中、小三种版本号进行升级,而不是让用户人为决定。
命令:
felix:bundlelevel
felix:cd
felix:frameworklevel
felix:headers
felix:help
felix:inspect
felix:install
felix:lb
felix:log
felix:ls
felix:refresh
felix:resolve
felix:start
felix:stop
felix:uninstall
felix:update
felix:which
gogo:cat
gogo:each
gogo:echo
gogo:format
gogo:getopt
gogo:gosh
gogo:grep
gogo:not
gogo:set
gogo:sh
gogo:source
gogo:tac
gogo:telnetd
gogo:type
gogo:until
obr:deploy
obr:info
obr:javadoc
obr:list
obr:repos
obr:source
scr:config
scr:disable
scr:enable
scr:info
scr:list
牛人的谈话
Neil Bartlett, preeminent OSGi expert and current maintainer of the popular Bndtools Eclipse plugin for OSGi has announced the release of Bndtools 2.0. Some of the features he has highlighted are:
Support for OSGi Release 5 Resolver and Repository specifications
Export run descriptors as standalone executables
Baselining (build errors for incorrectly versioned bundles)
Enhanced Semantic Versioning, using annotations for Consumer and Provider roles
Exported Package Decorations
Improved Incremental Builder
Support for Apache ACE
Lots of bug fixes and performance improvements.
This is a long awaited release. The previous release 1.1 became available in March 2012.
InfoQ spoke to Neil Bartlett about Bndtools and about OSGi in general.
Can you please explain a bit about OSGi and Bndtools to the non-OSGi audience?
OSGi is a way of developing modular applications on the JVM. It allows you to build modules (which we call "bundles") that are cleanly isolated from each other, and with explicit, managed dependencies. Because of our focus on dependencies, we can always tell whether a particular bundle can be installed into our environment, whether additional dependencies will need to be added as well, what effect it will have on other modules, and so on.
Bndtools is an IDE for developing OSGi bundles and applications. It is based on Eclipse, and can be installed from the Eclipse Marketplace.
Is OSGi important to Java projects of all sizes and kinds, or is it more appropriate to larger or smaller projects?
OSGi means modularity, which is beneficial to almost all sizes of projects. It should be clear enough why large projects benefit from modularity: it helps to isolate complexity and divide the work into manageable chunks. But even small projects benefit, for example if you write a small piece of code it's likely that you will want to reuse it later in another project. If you develop that as an OSGi bundle then it will be much easier to reuse.
Having said that, some very small projects don't really need modularity; for example "Hello World" doesn't benefit much from a modular approach!
OSGi seems to have some loyal followers, but it does not seem to have huge traction. What is the reason for that?
Well, the traction is increasing fast, but I agree it's not mainstream yet. OSGi is actually very ambitious because it aims to improve the entire software development process, therefore it has an impact on everything from code repositories through testing to team structures. So it takes time for the benefits to be realized, and many businesses are understandably nervous about taking on a known up-front cost in return for uncertain future gains. However this is changing as more businesses become successful with it.
Another problem is technical, in that OSGi has had quite poor tool support for a long time. Bndtools – and the ecosystem of tools that can integrate with it – have started to improve that situation.
There is a lot of focus on Android right now, is OSGi relevant for Android development?
Yes, I think that as Android applications get bigger and more complicated, they are going to need to look at modularity seriously as well. OSGi has been used successfully in some Android projects, however Android is sufficiently different from standard Java – in subtle but important ways – that this is still a bit of an experimental area right now.
How does Bndtools help in OSGi projects?
OSGi has a reputation for being difficult to use, however it really just needs certain information about our code to be stated explicitly. Nearly all of this information is available inside the Java classes that we put into the bundle... it just needs to be teased out. Bndtools does this as part of the build process, which allows developers just to concentrate on their own code and not repeat anything they have already written into the source.
Bndtools also hooks into the Eclipse build system, which means that as soon as you save a change in a source file, your bundle will be immediately built and ready. Then if you happen to have an OSGi runtime going already (e.g. in debugging or testing) then we push the new bundle straight into it, by taking advantage of OSGi's ability to dynamically update modules at runtime. This leads to an extremely fast code/run/test workflow, since basically your code is already running as soon as you save it.
Finally in Bndtools 2.0 we added support for the new Resolver and Repositories specifications from OSGi Release 5. This lets you compose applications by focusing on the small number of "top-level" modules that provide your core functionality – the resolver takes care of providing all of the static and runtime dependencies from that core. So you no longer have to manage long lists of JARs that need to go on your classpath.
Does Bndtools provide any collaboration tools?
Yes. One of the major difficulties in collaborating with other developers is maintaining compatibility of shared APIs, and how to coordinate when those APIs need to change. The key to getting this right is a proper versioning strategy, but most developers apply versions to their artifacts in a manual and fairly arbitrary way. Bndtools has the ability to analyze your classes and work out the changes that were made compared with the previously released version. Then it can automatically bump the version for you. Also for consumers of an API it works out what range of versions your code is going to be compatible with, and automatically generates an import of that range.
Are there any competitors?
Probably the closest competitor is PDE, the Plug-in Development Environment, which is also an Eclipse-based IDE but takes a very different approach. Naturally I believe that Bndtools is much better and more productive; in fact I'm confident of this because I used PDE for many years before Bndtools existed.
Is Eclipse required, or does it standalone? Do you support other IDEs such as IntelliJ and Netbeans?
Yes and no. Bndtools is built on top of bnd, developed by Peter Kriens. Bnd is a headless tool that can be used from the command line, or from ANT, or from Maven, and so on. Therefore developers using NetBeans, IDEA or even a plain text editor can still work with the projects because they are just using bnd.
Bndtools does require Eclipse and it isn't directly usable in other IDEs. However those IDEs could build their own support for OSGi by using bnd themselves. Most of the smarts are in bnd, and Bndtools only provides things like pretty editors for the bnd descriptor files, a launcher, hooks into the Eclipse build lifecycle, and so on.
I hope that other IDEs spend some effort on this, because really I just want people to use OSGi. I have no interest in forcing them to use Eclipse if that is not their preference.
As well as the Bndtools Tutorial Bartlett recommends the books "Java Application Architecture" by Kirk Knoernschild (previously covered on InfoQ) and "Enterprise OSGi in Action" by Tim Ward and Holly Cummins, which discusses tooling options for OSGi including bnd and Bndtools, as good sources for further information.
InfoQ has also run a series of articles discussing modularity in general: Modular Java: What is it?, Modular Java: Static Modularity, Modular Java: Dynamic Modularity, Modular Java: Declarative Modularity.
相关推荐
NULL 博文链接:https://q445862108.iteye.com/blog/2049068
BndTools为在Eclipse中进行OSGi开发提供支持
使用BndTools必备教程。开发OSGi更加方便。
bndtools是用来开发OSGi的一个工具,这是目前最新的版本
bnd, bnd,用于OSGi的瑞士军刀 构建OSGi包的工具 自述文件bnd是针对OSGi的军刀,它基于分析类代码,验证设置,验证你的设置,并对项目的依赖关系进行验证,并提供了相应的日期和时间。关于bnd的信息可以在 ...
bndtools2.1 离线插件安装包,网上其他地方找不到的,识货的下载吧。 安装步骤同Eclipse其他插件安装一样。下载下来解压,然后新建link文件链接到你解压的目录,然后把Link文件放到eclipse根目录下面的links文件夹...
hessian-bndtools-OSGI 此存储库包含几个 bndtools 项目,这些项目解释了如何从外部 Java 应用程序使用 OSGi 声明式服务 bndtools 运行描述符未处于工作状态。 最好将生成的目录中的 jar 文件复制并部署到 OSGi ...
opencmis_bndtools 示例bndtools项目,该项目演示了无法访问“ Apache Chemistry OpenCMIS Client OSGi包装器”中的软件包
Bnd / Bndtools是OSGi的瑞士军刀。 它基于对类代码的分析为您创建清单标头,验证您的设置,管理项目依赖项,diff罐子等等。 有关Bnd的信息可在上找到,有关Bndtools的信息可在上找到。 资料库 git存储库包含所有...
使用 Scala、Akka 和 Spray 的 Web 应用程序的 OSGi 运行时平台动机... 和提供前沿Bndtools 如果您更愿意留在发布的版本,你可以试试 。 我还运行 JDK8 来启动 Eclipse 以及构建和启动 Scala 代码。 目前无法在 Eclips
我们还有列表,用于讨论bndtools的开发。 网站的错误和问题应转到贡献想要入侵bndtools.org网站吗? 有关构建,测试和做出更改的信息,请参见 。 它们可能并不完美,如果有任何问题或不完整之处,请告诉我们。执照...
我自己翻译的中文版,之前的版本语法问题比较多;这个版本可读性好很多。
它允许人们通过Web UI或“ mvn deploy”部署工件,并使用Eclipse P2,OSGi R5 XML索引(例如Bndtools),纯Maven,APT(用于.deb文件)使用它们。 可以自动清理工件(用于快照或集成构建),进行转换(例如,将...
bnd/bndtools 和 Maven Aether 这个示例项目展示了如何在 bnd/bndtools 中使用来自 maven 存储库的依赖项。 该项目包含一个 bndrun 配置,它使用来自 maven 中心的一些工件。 在项目中有一个 bnd 文件,其中包含...
该框架使用 Felix OSGi Container 和云环境(目前为 OpenStack)来开发分布式应用程序。 在 Eclipse 中使用开发了一个应用程序。 可以在上找到有关使用 BNDTools 进行开发的文档。 项目 该示例应用程序包含6个项目...
Eduonix OSGI 教程代码 导入安装了 e(fx)clipse 和 BndTools 的 Eclipse 需要 java 8 版本 >=45 Windows 最佳 linux 上的许多问题
解析工具 我自己的简单有用的实现,用于处理不同的编码方案(现在主要是JSON) 该项目的主要目标是: 开发人员易于使用(简单的事情应该很简单)。 吻!... 与OSGi兼容(例如,使用bndtools编译)
simple.web.blog OSGi 网络应用演示。要求Java JDK 8 节点GradleMySQL 数据库蚀Bndtools(最新版本或 2.4.0.RC1)配置MySQL数据库连接配置等配置可以在simple.web.blog.configuration/configuration/*.yaml下找到
OSGi enRoute 原型 此存储库代表 bndtools 的模板工作区,它是开始使用 OSGi enRoute 的最简单方法。 如果您想开始使用 enRoute,请按照的步骤操作。
gogo壳尝试获得有关gogo的概述(命令,语法,增强和限制)。 概述比[ ]更详细。目录(上) 代表Eclipse工作区入门,逐步了解gogo。 [cnf]( ) bndtools的gogo.shell要求[gogo.shell.doc]( ) 文件资料命令帮助...