当前位置:网站首页>idea将web项目打包成war包并部署到服务器上运行
idea将web项目打包成war包并部署到服务器上运行
2022-07-03 11:54:00 【陌上桑花开花】
idea将web项目打包成war包并部署到服务器上运行
以下是工作案例总结:
1.首先idea配置服务器:tomcat服务器或者jetty服务器均可
2.idea配置环境设置:点击如下图标
接下来如下操作:
2.1设置project
2.2设置Modules
2.3设置Librabers
2.4设置Facets
2.5设置Artifacts(重点:注意先后顺序,先Exploded后Archive)
具体说明:
补充说明:
Name:是war包的名字,可以自己随意定义
Type:是类型,这里是Archive的类型,也就是war包的类型
Output directory:是war包存储的位置,可以随意修改,找一个好找的位置存储即可
Include in project build:如果把这个选项勾选,说明当当前的这个模块修改了代码或者啥的,重新编译了之后,这个war包也会同步更新修改
Output Layout:是输出布局,也就是war包的目录结构,这里选择了J2SE模块,自然war包最后的结构是和J2SE模块的webapps下的目录结构是一样的。
至于左下角的提示:META-INF/MANIFEST.MF文件没找到也不必理会,这个文件里主要存储了主类,也就是有main方法那个类的所在的位置
2.5设置jdk
3.编译打包:Build Artifacts...----Build
补充说明:
All Artifact:对所有模块进行操作
Build:进行编译打包
Rebuild:重现编译打包,会删除原来的war包,然后编译打包
Clean:清除war包
Edit:重新编辑war包的设置
执行编译后查看编译后war包:
备注:
war包的内容都是从exploded里面复制的,所以如果war包打包发现少东西了,一般都是这个exploded里少了,需要手动粘贴缺少的文件到exploded中,再重新打包。一般我们部署文件到浏览器进行测试的时候,都是部署exploed文件,因为这个文件有着war包一样的目录结构。
4.将war包放到服务器上(tomcat或者jetty服务器)
如何解压war包:如下命令:
unzip -o J2SE.war -d J2SE
更多linux常用命令请查看:Linux常用命令
边栏推荐
- Redis 笔记 01:入门篇
- (database authorization - redis) summary of unauthorized access vulnerabilities in redis
- Take you to the installation and simple use tutorial of the deveco studio compiler of harmonyos to create and run Hello world?
- Is it safe to open an account for online stock speculation? Who can answer
- Dart: self study system
- [combinatorics] permutation and combination (summary of permutation and combination content | selection problem | set permutation | set combination)
- 网络通讯之Socket-Tcp(一)
- Applet wxss introduction
- ES6新特性
- New features of ES6
猜你喜欢
ES6新特性
LeetCode 0556.下一个更大元素 III - 4步讲完
Integer int compare size
Shardingsphere sub database and sub table < 3 >
Cloud Computing future - native Cloud
Wechat applet pages always report errors when sending values to the background. It turned out to be this pit!
Talk about the state management mechanism in Flink framework
剑指Offer09. 用两个栈实现队列
PHP導出word方法(一mht)
If you can't learn, you have to learn. Jetpack compose writes an im app (II)
随机推荐
Wechat applet pages always report errors when sending values to the background. It turned out to be this pit!
Prompt unread messages and quantity before opening chat group
Swagger
PHP get the file list and folder list under the folder
在网上炒股开户可以吗?资金安全吗?
New features of ES6
Adult adult adult
Pragma pack syntax and usage
Implement verification code verification
Redis 笔记 01:入门篇
Eureka自我保护
(构造笔记)从类、API、框架三个层面学习如何设计可复用软件实体的具体技术
Kubectl_ Command experience set
wpa_ cli
regular expression
(construction notes) learn the specific technology of how to design reusable software entities from three levels: class, API and framework
Flutter: self study system
[download attached] password acquisition tool lazagne installation and use
[official MySQL document] deadlock
Use of atomicinteger