一、新建项目
File->New->Project

二、选择项目类型
Maven->选中 Create from archetype(未选中不能选中wepapp)->选择结尾为archetype-wepapp的选项->点击Next

三、填写GroupId和ArtifactId,点击Next

四、选择Maven home路径,点击左下角的+号新增一键值对, 键名为archetypeCatalog,值为internal,点击ok,点击Next

五、输入项目名,选择项目存放路径,点击Finish,到这里项目就创建完成了

六、点击Project Structure进行配置


选中Facets,点击+号

滚到底部选择Web

这时弹窗选择刚才创建的项目 点击OK

这会儿界面变成下面这样,圈住的这两个地方,都需要编辑下,选中后,点击箭头指示的钢笔即可编辑
顶部的路径也就是Deployment Descriptors的路径,选择
/Users/aositeluoke/Computer/JavaWebContainer/newArtfactId/src/main/webapp/WEB-INF/web.xml,也就是在当前项目下的/src/main/webapp/WEB-INF/web.xml这个文件
底部的路径:Web Resource Directories的路径
选/newArtfactId/src/main/webapp即可

点击左侧的Artifacts

点击+号,选择Web Application:Exploded->选择From Modules->选择创建好的项目,点击ok,配置完成

点击Apply 点击OK 路径配置就结束了

七、Tomcat服务器部署,还没有安装的需要自己安装下
点击下拉箭头,点击Edit Configurations

点击左上角的+号->Tocat Server(注意:不是TomEE Server)->Local

输入一个名称

把项目部署到Tomcat服务器

如果有弹窗选择项目,请选择刚创建好的项目就好,到这里部署到Tomcat服务器也就完成了,启动服务器就会打开默认的页面
点击运行

成功运行

网友评论