OSGi-这种技术有多成熟? [英] OSGi - How mature is this technology?

查看:101
本文介绍了OSGi-这种技术有多成熟?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个需求,我需要在不同的基于SpringStruts 2应用程序之间共享一些Web资源(jsphtmljsimagescss等).似乎可以使用OSGi来实现这一目标?

I have a requirement where I need to share some web resources (jsp, html, js, images, css etc.) across different Spring based Struts 2 applications. And seems like OSGi can be used to achieve this?

  • 有人可以提供一些有关如何使用OSGi实现此目标的指示吗?
  • 第二,我想知道OSGi是否足够成熟,可以用于生产应用程序?
  • Can some one give some pointers on how to achieve this with OSGi?
  • And secondly I want to know is OSGi mature enough to be used in production applications?

提前谢谢!

我浏览了这篇帖子,似乎人们可以跨Web应用程序共享Web捆绑包.唯一的区别是他们使用Spring MVC做到了.我想知道是否也可以使用Struts2应用程序来实现?

I went through this post and seems like people are able to share a web bundle across web applications. The only difference is that they did it with Spring MVC. I want to know whether this can be achieved with Struts2 applications also?

我基本上不清楚以下内容:

EDIT 2: I am basically little unclear about the following:

  • 将"shared-bundle"(包含要共享的Web资源)打包为.war软件包.如果是,那么由于将再次与主"Web"应用程序共享此捆绑包,因此将从何处形成最终的Web上下文?我期望最终的Web上下文将由"shared-bundle"和"main" Web应用程序的合并形成.它会自动发生吗?有什么想法吗?

推荐答案

虽然OSGI可能是一个解决方案,但可能有点过大(而且,正如Bozho指出的那样,您将需要具有OSGI功能的容器).也许看看如何以便在Maven中的各个项目之间共享资源以获取其他选择:

While OSGI might be a solution, it might be a bit overkill (and, as Bozho pointed out, you'll need an OSGI capable container). Maybe have a look at How to share resources across projects in Maven for other options:

  • Cut and paste them.
  • Use Assembly and Dependency plugins
  • Use the maven-remote-resources-plugin

在此博客中,我将展示如何进行 第二种选择,因为我认为 是目前最稳定的 灵活的.以后,我会尝试 maven-remote-resources-plugin和 写一个教程.

In this blog I’ll show how to do the second option since in my opinion, it is currently the most stable and flexible. In the future, I’ll try out the maven-remote-resources-plugin and write up a tutorial.

要回答来自OP的评论. ,它的想法是创建可共享Web资源的程序集,并使用maven-dependency-plugin在资源消耗者"项目中提取和解压缩程序集.所有这些都在上面提到的博客文章中进行了解释和详细说明.让我知道其中是否有任何不清楚的地方.

To answer a comment from the OP. Yes, the idea it to create an assembly of the shareable web resources and to use the maven-dependency-plugin to pull and unpack the assembly in the "resource-consumer" projects. All this is explained and detailed in the blog post mentioned above. Let me know if anything is unclear in it.

这篇关于OSGi-这种技术有多成熟?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆