如何在 Eclipse 中为多个项目构建一个 war

How to build a One war for multiple project in eclipse

我有 3 个项目文件 1)FirstFile(包含Beans和dao文件) 2)SecondFile-API(属性文件) 3)ThirdFile-Service(所有控制器)

我想为我的 Eclipse 项目创建一个 war 文件 我如何为这个项目构建 war 文件。

使用 Apache Maven Shade 插件

an uber-jar, including its dependencies and to shade

参见:http://maven.apache.org/plugins/maven-shade-plugin/index.html

使用 Maven 生成将构建 war 的原型项目。

mvn archetype:generate |grep webapp

remote -> org.apache.maven.archetypes:maven-archetype-webapp (An archetype which contains a sample Maven Webapp project.)

将您的子模块和依赖项添加到原型。