1.创建一个web项目
mvn archetype:generate -DgroupId=com.fkjava -DartifactId=struts2qs -Dpackage=com.fkjava.struts2qs -DarchetypeArtifactId="maven-archetype-webapp"
-DinteractiveMode=false
2.在struts2qs项目下的pom.xml文件中添加配置信息
<!-- 定义该项目所使用License -->
<licenses>
<license>
<name>Apache 2</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
<comments>A business-friendly OSS license</comments>
</license>
</licenses>
<!-- 声明该项目所属的组织 -->
<organization>
<name>CrazyIt</name>
<url>http://www.crazyit.org</url>
</organization>
<!-- 声明项目开发者 -->
<developers>
<developer>
<id>kongyeeku</id>
<name>kongyeeku</name>
<email>kongyeeku@gmai.com</email>
<url>http://www.crazyit.or</url>
<organization>CrazyIt</organization>
<!-- 声明开发者的角色 -->
<roles>
<role>developer</role>
</roles>
<timezone>+8</timezone>
</developer>
</developers>
<!-- 声明对项目有贡献的人 -->
<contributors>
<contributor>
<name>fkjava</name>
<email>fkjava@hotmail.com</email>
<url>http://www.fkjava.org</url>
<organization>疯狂软件教育中心</organization>
<roles>
<role>developer</role>
</roles>
</contributor>
</contributors>
<dependencies>
<!-- 配置该项目依赖Struts 2 -->
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<!-- 此处指定依赖的Struts 2版本 -->
<version>2.3.16.3</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<finalName>struts2qs</finalName>
</build>
3.打包项目,完成之后可根据提示信息找到打包后的项目
mvn package