Maven在war中include/assemble打包静态html项目

发布于 2024-11-28 05:49:41 字数 201 浏览 4 评论 0原文

我有战争档案,它有自己的 xhtml。其webapp目录下有js、html、css等。 它与 Maven 打包得很好。 我必须包含另一个纯 html+js 的静态组件。怎么做呢? 我尝试将静态项目打包到 jar 文件中并添加对 war 的依赖项,但它作为 jar 文件放置在 WEB-INF/lib/ 中,因此不可公开访问。 我需要像其他 xhtml 和静态文件一样处于战争的根源。

I have war archive which has its own xhtmls. js, html, css and so on in its webapp directory.
It packages fine with maven.
I have to include another static component which is pure html+js. How to do that?
I try packaging the static project into jar file and add dependency to the war but it is placed in WEB-INF/lib/ as a jar file so it is not public accessable.
I need to be in the root of my war like the other xhtml and static files.

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

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

发布评论

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

评论(1

花间憩 2024-12-05 05:49:41

我想你想使用战争覆盖并拥有多个战争项目。

如果您无法更改静态项目的打包类型(从 jar 到 war),您可能需要使用类似 嵌入式资源。这种方法不太标准,但相当有效。

I think you want to use a war overlay and have multiple war projects.

If you can't change the packaging type of the static project (from jar to war), you may want to use something like embedded-resources. This approach is less standard but pretty efficient.

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