首先看一下pom文件
<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/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>www.liandisys.com.cn</groupId> <artifactId>QuickStart</artifactId> <packaging>war</packaging> <version>1.0.0.0-SNAPSHOT</version> <name>QuickStart</name> <properties> <struts2.version>2.3.16</struts2.version> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> <dependencies> <dependency> <groupId>org.apache.struts</groupId> <artifactId>struts2-core</artifactId> <version>${struts2.version}</version> </dependency> <dependency> <groupId>org.apache.struts</groupId> <artifactId>struts2-config-browser-plugin</artifactId> <version>${struts2.version}</version> </dependency> <dependency> <groupId>org.apache.struts</groupId> <artifactId>struts2-convention-plugin</artifactId> <version>${struts2.version}</version> </dependency> <dependency> <groupId>org.apache.struts</groupId> <artifactId>struts2-junit-plugin</artifactId> <version>${struts2.version}</version> <scope>test</scope> </dependency> <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> <version>1.1.3</version> </dependency> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.17</version> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.5</version> <scope>test</scope> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <version>2.4</version> <scope>provided</scope> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>jsp-api</artifactId> <version>2.0</version> <scope>provided</scope> </dependency> </dependencies> <build> <finalName>QuickStart</finalName> <sourceDirectory>src/main/java</sourceDirectory> <resources> <resource> <directory>src/main/resources</directory> </resource> </resources> <defaultGoal>package</defaultGoal> <directory>target</directory> <outputDirectory>target/classes</outputDirectory> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.6</source> <target>1.6</target> <fork>true</fork> <verbose>true</verbose> <encoding>UTF-8</encoding> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-eclipse-plugin</artifactId> <version>2.8</version> <configuration> <buildcommands> <java.lang.String>org.eclipse.jdt.core.javabuilder</java.lang.String> <java.lang.String>org.eclipse.wst.common.project.facet.core.builder</java.lang.String> </buildcommands> <classpathContainers> <buildcommand>org.eclipse.jdt.launching.JRE_CONTAINER</buildcommand> <buildcommand>org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v6.0</buildcommand> <buildcommand>org.eclipse.jst.j2ee.internal.web.container/${project.artifactId}</buildcommand> <buildcommand>org.eclipse.jst.j2ee.internal.module.container</buildcommand> </classpathContainers> <downloadSources>true</downloadSources> <projectnatures> <projectnature>org.eclipse.jdt.core.javanature</projectnature> <projectnature>org.eclipse.wst.common.project.facet.core.nature</projectnature> <projectnature>org.eclipse.wst.common.modulecore.ModuleCoreNature</projectnature> <projectnature>org.eclipse.jem.workbench.JavaEMFNature</projectnature> </projectnatures> <useProjectReferences>true</useProjectReferences> <wtpversion>2.0</wtpversion> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.1.1</version> <configuration> <warSourceDirectory>${warSourceDirectory}</warSourceDirectory> <warSourceExcludes>${warSourceExcludes}</warSourceExcludes> <webResources> <resource> <directory>${resource-directory}</directory> <targetPath>${resource-targetPath}</targetPath> </resource> </webResources> <warName>${warName}</warName> </configuration> </plugin> </plugins> </build> <profiles> <profile> <id>development</id> <properties> <warName>QuickStart</warName> <warSourceDirectory>${basedir}/src/main/webapp</warSourceDirectory> <warSourceExcludes></warSourceExcludes> <resource-directory>src/main/resources</resource-directory> <resource-targetPath>WEB-INF/classes</resource-targetPath> </properties> <activation> <activeByDefault>true</activeByDefault> </activation> <build> <resources> <resource> <directory>src/main/resources</directory> </resource> </resources> </build> </profile> </profiles> </project>
第一个段落的
<groupId>www.liandisys.com.cn</groupId>
<artifactId>QuickStart</artifactId>
<name>QuickStart</name>
需要merge进来项目本身的
最后一个段落的
<warName>QuickStart</warName>
也需要,为了以防万一最好用工具merge