maven多个war合并

maven多个war合并
 
第一步: 准备三个maven项目baseProject(主),baseTest1(从),baseTest2(从)
第二步: dependency的配置
 
<dependency>
<groupId>com.agnils</groupId>
<artifactId>baseTest1</artifactId>
<version>1.0</version>
<type>war</type>
<scope>runtime</scope>
</dependency>
 
第三步:plugin的配置
 
代码 :
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<configuration>
<overlays>
<overlay>
<groupId>com.agnils</groupId>
<artifactId>baseTest1</artifactId>
<excludes>
<exclude>WEB-INF/lib/*</exclude>
<exclude>WEB-INF/web.xml</exclude>
</excludes>
</overlay>
</overlays>
</configuration>
</plugin>
 
第四步:部署到tomcat中
这一步最重,也是最容易出错的。不能直接在eclipse中进行直接调试,此方法只是合并到war中,代码中并没有合并。所以单一的运行project都是不行的……(jetty & tomcat)。
要把合并好的war放到独立的server中
 
 
posted @ 2017-04-20 17:15  agnils  阅读(1915)  评论(0编辑  收藏  举报