maven创建struts2项目

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



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值