简体   繁体   English

如何在一个Maven项目中打包多个WAR文件?

[英]How do I package multiple WAR files in one Maven project?

I am writing an application that integrates Geoserver with a custom component, intended to be hosted on a single servlet engine. 我正在编写一个将Geoserver与自定义组件集成的应用程序,该组件旨在托管在单个servlet引擎上。 Both are Maven based projects, and I would like to stay in Maven land to package it all into a nice distributable. 两者都是基于Maven的项目,我想留在Maven的土地上,将其打包成一个很好的可分发组件。 The general idea I have is to add another module to my application that packages the application itself, Geoserver and all dependencies into one nice archive. 我的一般想法是向应用程序中添加另一个模块,该模块将应用程序本身,Geoserver和所有依赖项打包到一个不错的存档中。

I am aware of the maven-assembly-plugin and its capability of storing all dependencies in a target folder, but I am not sure what would be the best way to create a package that it easy to deploy. 我知道maven-assembly-plugin及其将所有依赖项存储在目标文件夹中的功能,但是我不确定什么是创建易于部署的软件包的最佳方法。 Googling for any examples has not been successful. 谷歌搜索任何示例均未成功。

Extra bonus points if the module can be started via mvn jetty:run . 如果可以通过mvn jetty:run启动模块,则可以获得额外的奖励积分。

Have you considered packaging them into an EAR project. 您是否考虑过将它们打包到EAR项目中。 It will bundle a set of WARs (and jars), and allows you to specify or generate a deployment descriptor. 它将捆绑一组WAR(和jar),并允许您指定或生成部署描述符。

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

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