当前位置 博文首页 > aimian1615的博客:IntelliJ IDEA打包WAR并部署运行(mac osx)将W
用IntelliJ IDEA做web开发体验很好,但导出war包比eclipse麻烦了不少,以下是解决方案:
?
打包:
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?
---------------------
原文:https://blog.csdn.net/yuukoiry/article/details/52673237