简体   繁体   English

将多模块Maven项目打包为一战

[英]packaging multi module maven project as one war

I have a maven project and it has 3 modules core, admin, site. 我有一个Maven项目,它有3个模块核心,管理,站点。 admin and site are deployed as separate wars is it possible to have the whole thing packaged as one war? 管理员和站点部署为单独的战争,是否有可能将整个事情打包成一个战争?

Without exactly knowing what classes you have and why this are 3 war modules some possibilities with Maven: 在不完全知道您拥有什么类以及为什么这是3个战争模块的情况下,Maven可能会出现一些可能性:

  • Change to have only one war file, when you want to deploy them always as one why should they be separate modules? 更改为只有一个war文件,而当您始终要将它们作为一个部署时,为什么它们应该是单独的模块?
  • two modules only add some common resources for the last war file you can try to use a war overlay . 两个模块只会为最后一个war文件添加一些通用资源,您可以尝试使用war overlay
  • all three modules are separate war files have different content roots and should be separated at all cost. 这三个模块都是独立的战争文件,它们具有不同的内容根,应该不惜一切代价将它们分开。 Create an ear module with the three war as dependency files and deploy the ear instead of a war file. 使用三个war作为依赖文件创建一个ear模块,然后部署ear而不是war文件。

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

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