点击“Edit Configurations”,然后添加Tomcat Server,选择Remote 
Intellij部署Spring项目到远程服务器

然后配置我们的Remove服务器 
Intellij部署Spring项目到远程服务器
这里的host换成自己的服务器ip。 
然后是Remote staging Host的配置 
Intellij部署Spring项目到远程服务器
Type选择SFTP 
Root Path是到时将war包上传到服务器的路径。输入自己的服务器ip和密码,测试链接成功后点OK 
接着去配置Deployment 
Intellij部署Spring项目到远程服务器

最后到我们的服务器上启用1009端口 
使用vim /etc/profile编辑 
Intellij部署Spring项目到远程服务器
在文件最后添加如下代码 
hostname换成自己的服务器ip 
Intellij部署Spring项目到远程服务器 
修改完后 输入:wq保存,然后执行命令source /etc/profile是配置生效。 
重启tomcat 
Intellij部署Spring项目到远程服务器 
点击运行,Intellij就会自动打包并上传到服务器。

相关文章:

猜你喜欢
相关资源
相似解决方案