Maven在war中include/assemble打包静态html项目
我有战争档案,它有自己的 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想你想使用战争覆盖并拥有多个战争项目。
如果您无法更改静态项目的打包类型(从 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.