Java高级架构师(一)第02节:分模块、分工程管理

本节课程的目标在于:利用Maven构建分工程、分模块的空项目。

 --------

基本的构建大致相同,有一个强调调点:

在总web的pom里边(architecture01web中),加入要合并的war内容:

  <plugin>
                    <artifactId>maven-war-plugin</artifactId>
                    <version>3.2.0</version>
                    <configuration>
                        <overlays>
                            <overlay>
                                <groupId>com.sishuok</groupId>
                                <artifactId>customermgr</artifactId>
                            </overlay>
                            <overlay>
                                <groupId>com.sishuok</groupId>
                                <artifactId>goodsmgrweb</artifactId>
                            </overlay>
                        </overlays>
                </configuration>
                </plugin>

在总web的pom里边(architecture01web中),加入要合并的war的依赖:

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.11</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.sishuok</groupId>
            <artifactId>customermgr</artifactId>
            <version>1.0-SNAPSHOT</version>
            <type>war</type>
        </dependency>

  最后:Maven Install 查看目录结构。

原文地址:https://www.cnblogs.com/sunrunzhi/p/10097831.html