简体   繁体   English

OSGI Apache felix-热部署支持

[英]OSGI Apache felix- Hot deployment support

A little back ground: We are using Apache Felix implementation of OSGI for our web development (Adobe CQ5 which inturn is built on apache felix). 有一点背景知识:我们在Web开发中使用了OSGI的Apache Felix实现(Adobe CQ5,它反过来是基于apache felix构建的)。 We have a few bundles of our own (around 10) and each of them are configured as a project. 我们有几个捆绑包(大约10个),每个捆绑包都配置为一个项目。

Issue: During the development lifecycle, we make changes to a bundle and then use an ant script to create the bundle and deploy it in the felix. 问题:在开发生命周期中,我们对捆绑软件进行更改,然后使用ant脚本创建捆绑软件并将其部署在felix中。 I am wondering if there is some way to enable hot deployment of the changes I make during development mode that would save developers time. 我想知道是否有某种方法可以使我在开发模式下进行的更改热部署,从而节省开发人员的时间。

Based on my research, we can use the felix file install which will monitor a folder(s) for changes to any bundles and can deploy them automatically. 根据我的研究,我们可以使用felix文件安装程序,该文件安装程序将监视文件夹中是否有任何捆绑软件的更改,并可以自动部署它们。 But this again means I need to run ant script to build the jar file and move it to the auto deploy folder the file install is watching. 但这又意味着我需要运行ant脚本来构建jar文件,并将其移动到文件安装正在监视的auto deploy文件夹中。 Is there a better/fast way to achieve this? 有没有更好/更快的方法来实现这一目标? The script is currently taking a around 10 seconds (approx) to compile the classes, create osgi specific meta data files, bundle the classes+metadata in a new jar. 该脚本当前大约需要10秒钟(大约)来编译类,创建osgi特定的元数据文件,将类+元数据捆绑在一个新的jar中。 Is there some way to do hot deployment, so that any change I make to a java file is automatically reflected in the bundle? 有什么方法可以进行热部署,以便我对Java文件所做的任何更改都会自动反映在捆绑软件中吗?

Many thanks 非常感谢

If you develop your project in Bndtools , and run from the built-in launcher, then Bndtools will handle immediately building any Java code that you change, and deploying the updated bundle into the runtime. 如果您在Bndtools中开发项目并从内置启动器运行,则Bndtools将立即处理构建您更改的任何Java代码,并将更新的捆绑软件部署到运行时中。 This leads to an extremely quick code/test/debug/fix cycle. 这导致非常快速的代码/测试/调试/修复周期。

Having said that, I'm amazed that it takes 10 seconds to compile and build your bundles currently! 话虽如此,我很惊讶目前需要10秒钟来编译和构建包! Are you building on an extremely ancient computer? 您是在非常古老的计算机上进行构建吗? Or is the bundle multiple gigabytes in size? 还是捆绑包的大小为数GB?

We tried DCEVM and it does almost everything we expected to reduce the develop+fix+test life cycle. 我们尝试了DCEVM,它几乎完成了我们期望减少开发+修复+测试生命周期的所有工作。 I recommend this to all java developers using big web applications. 我向所有使用大型Web应用程序的Java开发人员推荐此方法。 Thanks for your suggestion on bndtools Neil. 感谢您对bndtools Neil的建议。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM