idea将maven项目打包成war包并部署

1.将web项目通过maven打包成war包(pom文件中的打包方式为war)
在这里插入图片描述
2.将war包复制到tomcat的webapps目录下
在这里插入图片描述
3.修改server.xml,在Host配置段中添加如下内容

<Host name="localhost"  appBase="webapps" unpackWARs="true" autoDeploy="true">
	//......
	<Context path="/" docBase="springmvc_restful.war" debug="0" previledge="true" reloadable="true"/>
</Host>

4.运行tomcat/bin目录下的启动脚本文件startup.bat/startup.sh启动tomcat
5.通过url如http://localhost:8080/springmvc_restful/items/queryItems进行访问
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/u010286027/article/details/84844687