IntelliJ IDEA打包WAR并部署运行(mac osx)

来源:互联网 发布:幼儿淘宝海报怎么做 编辑:程序博客网 时间:2024/05/22 17:20

用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 

1 0
原创粉丝点击