分工分模块 合并

新建maven父工程architecture1 -- quickstart pom.xml 中的packaging jar 改为pom 父工程

新建父工程的webapp 类型maven module 父工程选择开始创建 的父工程com.exayong.architecture1.architecture1web

一些公共的东西 common  quickstart 包名com.exayong.architecture1.common
合并
总web.pom里加入要合并的war内容 属于 web的模块   放在build里面
<plugins>
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.4</version>
        <configuration>
            <overlays>
                <overlay>
                    <groupId>com.exayong</groupId>
                    <artifactId>goodsmgrweb</artifactId>
                </overlay>
                <overlay>
                    <groupId>com.exayong</groupId>
                    <artifactId>customermgr</artifactId>
                </overlay>
            </overlays>
        </configuration>
    </plugin>
</plugins>

在总的web pom里面加入要合并的war的依赖 后面type是war
<dependency>
    <groupId>com.exayong</groupId>
    <artifactId>customermgr</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <type>war</type>
</dependency>

配置完后测试一下 在总工程 run as maven isntall 会自动下载 成功后会在相关模块下的target下生成war包

原文地址:https://www.cnblogs.com/exayong/p/6504323.html