打包:
1.自动打包:
File —> Project Structure —> Artifacts —> Add —> Web Application: Archive —> For ..war exploded
Build —> Build Artifacts… —> war —> Build
2.命令行打包:
进入要打包的项目目录:
cd /Users/yuukoiry/IdeaProjects/...
cd web/
打包命令:
jar -cvf xxx.war *
部署运行:
1.将war包复制到tomcat安装目录:/usr/local/apache-tomcat-9.0.0.M4/webapps/
2.终端操作:
cd /usr/local/apache-tomcat-9.0.0.M4/bin/
./startup.sh
3.打开浏览器:
http://localhost:8080/xxx/xx.jsp