通过 Maven 将 Web 应用程序构建为 osgi 捆绑包并使用 Webstart 启动它们的最佳方式是什么?

发布于 2024-10-08 23:07:27 字数 835 浏览 0 评论 0原文

我正在寻找一种方法来实现我的愿景。最好的方法是什么?

这是我的愿景:

  1. 我想通过 maven 构建一个 captain casa 应用程序(作为 war 文件)。
  2. 然后我想通过 Maven 从构建的战争中创建一个 osgi 包。
  3. 接下来我想构建一个可以通过 java webstart (jnlp) 下载和启动的工件。

jnlp 文件应该下载具有 Web 容器支持的 osgi 环境(可能是 jetty osgi 服务),然后下载 osgi 捆绑的 war。然后应该启动 osgi 容器和 jetty 服务,并部署我的战争。最后,该应用程序在 osgi 环境中本地运行。

有很多问题需要回答:

  1. 我如何通过 Maven 构建一个 Captain casa 应用程序来进行战争?
  2. 应该使用哪个 maven 插件来构建 osgi 包(pax、maven-bundle-plugin、tycho...)有什么区别?
  3. 如何通过maven构建一个可以部署在站点上的jnlp工件?
  4. 必须如何修改 osgi 包才能支持 java webstart?

已知信息:

  • 博客条目为 java webstart 准备 osgi 包。
  • 许多 maven 插件页面,例如 pax、maven-bundle-plugin、tycho、bnd,...

I am looking for a way to reach my vision. What is the best way to go?

Here is my vision:

  1. I would like to build a captain casa app via maven (as a war file).
  2. Then i would like to create a osgi bundle from the builded war via maven.
  3. Next i would like build a artifact which could be downloaded and started via java webstart (jnlp).

The jnlp file should be download the osgi environment with web container support (maybe jetty osgi service), next download osgi bundled war. Then the osgi container and the jetty service should be started and my war should be deployed. Finally the app is running local in a osgi environment.

There are many questions to be answered:

  1. How can i build a captain casa app via maven to a war?
  2. Which maven plugin should be used to build the osgi bundle (pax, maven-bundle-plugin, tycho, ...) What are the differnce?
  3. How to build a jnlp artifact via maven which can deployed on a site?
  4. How must be modified the osgi bundle to support java webstart?

Known informations:

  • Blog entry to prepare osgi bundle for java webstart.
  • many pages to maven plugins, such as pax, maven-bundle-plugin, tycho, bnd, ...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

呢古 2024-10-15 23:07:27

可能值得将其作为 3 个单独的问题提出,但是在构建 Web 应用程序捆绑包时,我使用 maven-bundle-plugin 版本 2.2.0(当前未发布,因此您需要依赖快照)。

然后我使用以下文件结构:

src/main/java - 任何 .java 文件
src/main/resources - 应该位于类路径上的任何非 .java 文件
src/main/webapp - 静态内容、图像、html 文件、jsps 等

然后在 pom 中配置 maven-bundle-plugin 的正常数据后,指定以下内容:

<_wab>src/main/webapp

这将导致静态内容被拉入包中,并且包将使用 WEB-INF/classes 目录中的类和资源来构建。

It might be worth asking this as 3 separate questions, but when building Web application Bundles I use the maven-bundle-plugin version 2.2.0 (currently unreleased, so you'll need to depend on a snapshot).

Then I use the following file structure:

src/main/java - any .java files
src/main/resources - any non .java files that should be on the classpath
src/main/webapp - static content, images, html files jsps and so on

Then inside the pom once you have configured the normal data for the maven-bundle-plugin you specify the following:

<_wab>src/main/webapp</_wab>

this will cause the static content to be pulled into the bundle and the bundle to be structured with the classes and resources in the WEB-INF/classes directory.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文