pom文件的方式需要修改的是
<packaging>war</packaging>
<profiles> <profile> <id>command</id> <build> <directory>build</directory> </build> </profile> </profiles> <build> <finalName>Service</finalName> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.7</source> <target>1.7</target> <encoding>UTF-8</encoding> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <configuration> <archive> <addMavenDescriptor>false</addMavenDescriptor> </archive> <webResources> <resource> <directory>profiles/${profile.id}</directory> <targetPath>/</targetPath> <filtering>true</filtering> </resource> </webResources> <warSourceDirectory>${basedir}/WebRoot</warSourceDirectory> <!-- <warSourceExcludes> css/**,images/**,js/**,wap/css/**,wap/images/**,wap/js/** </warSourceExcludes> --> <webXml>${basedir}/WebRoot/WEB-INF/web.xml</webXml> <ignoreWebxml>false</ignoreWebxml> <encoding>UTF-8</encoding> </configuration> </plugin> </plugins> </build>
这里需要将那个web.xml拷贝到相应的目录下
该插件有待后续研究