maven 搭建多war包聚合项目

来源:互联网 发布:淘宝中学生书包女韩版 编辑:程序博客网 时间:2024/05/22 06:15

这里写图片描述

思路:最主要的是主war文件要引入其他war,指明type是war。然后用插件来声明让子类war的文件都跑到主war下面

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">  <modelVersion>4.0.0</modelVersion>  <parent>    <groupId>com.qytx</groupId>    <artifactId>architecturel</artifactId>    <version>0.0.1-SNAPSHOT</version>  </parent>  <artifactId>architecturelweb</artifactId>  <packaging>war</packaging>  <dependencies>    <dependency>        <groupId>com.qytx</groupId>        <artifactId>customermgr</artifactId>        <version>0.0.1-SNAPSHOT</version>        <type>war</type>    </dependency>    <dependency>        <groupId>com.qytx</groupId>        <artifactId>goodsmgrweb</artifactId>        <version>0.0.1-SNAPSHOT</version>        <type>war</type>    </dependency>    <dependency>        <groupId>com.qytx</groupId>        <artifactId>cartmgr</artifactId>        <version>0.0.1-SNAPSHOT</version>        <type>war</type>    </dependency>    <dependency>        <groupId>com.qytx</groupId>        <artifactId>ordermgr</artifactId>        <version>0.0.1-SNAPSHOT</version>        <type>war</type>    </dependency>    <dependency>        <groupId>com.qytx</groupId>        <artifactId>storemgr</artifactId>        <version>0.0.1-SNAPSHOT</version>        <type>war</type>    </dependency>    <dependency>        <groupId>javax.servlet</groupId>        <artifactId>jsp-api</artifactId>        <version>2.0</version>    </dependency>  </dependencies>  <build>    <plugins>        <plugin>            <groupId>org.apache.maven.plugins</groupId>            <artifactId>maven-war-plugin</artifactId>            <version>2.4</version>            <configuration>                <overlays>                    <overlay>                        <groupId>com.qytx</groupId>                        <artifactId>customermgr</artifactId>                    </overlay>                    <overlay>                        <groupId>com.qytx</groupId>                        <artifactId>goodsmgrweb</artifactId>                    </overlay>                    <overlay>                        <groupId>com.qytx</groupId>                        <artifactId>cartmgr</artifactId>                    </overlay>                    <overlay>                        <groupId>com.qytx</groupId>                        <artifactId>ordermgr</artifactId>                    </overlay>                    <overlay>                        <groupId>com.qytx</groupId>                        <artifactId>storemgr</artifactId>                    </overlay>                </overlays>            </configuration>        </plugin>        <plugin>                <groupId>org.eclipse.jetty</groupId>                <artifactId>jetty-maven-plugin</artifactId>                <version>9.2.8.v20150217</version>                <configuration>                    <stopKey>shutdown</stopKey>                    <stopPort>9966</stopPort>                    <connectors>                        <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">                            <port>9999</port>                        </connector>                    </connectors>                    <scanIntervalSeconds>2</scanIntervalSeconds>                    <requestLog implementation="org.eclipse.jetty.server.NCSARequestLog">                        <filename>target/access-yyyy_mm_dd.log</filename>                        <filenameDateFormat>yyyy_MM_dd</filenameDateFormat>                        <logDateFormat>yyyy-MM-dd HH:mm:ss</logDateFormat>                        <logTimeZone>GMT+8:00</logTimeZone>                        <append>true</append>                        <logServer>true</logServer>                        <retainDays>120</retainDays>                        <logCookies>true</logCookies>                    </requestLog>                    <webApp>                        <contextPath>/</contextPath>                    </webApp>                </configuration>            </plugin>    </plugins>  </build></project>
原创粉丝点击