1、新建一个空的project,并在新的窗口中打开


2、设置project的结构
在Project Settings中选择Project,设置sdk版本,设置完后选择应用(apply)
3、创建基于maven构建的web项目
在Project Settings中选择model,在第二个框中点击加号,新建model。选择创建maven项目,然后选择“create from archetype”,然后输入webapp搜索,会出现webapp项目,然后选择“maven-archetype-webapp ”,点击next。
设置maven项目的groupId和artifact,然后点击next,点击finish完成。

web项目创建成功入下图,并选择应用(apply)。

4、设置项目的facets
在Project Settings中选择facets,在中间框中点击加号,选择web,在弹出的窗口中选择刚刚创建的web项目。

5、设置项目的artifacts。
在Project Setting中的Model中,选择右下角感叹号旁边的按钮“Create Artifact”,选择应用(Apply)。然后点击Ok完成设置。

web项目创建完成如下图
6、设置web项目运行部署配置。
点击build项目中下的下拉菜单,弹出“Run/Debug Configurations”对话框,点击”+“新建Configuration,选择”Tomcat Server“->”Local“。
设置ServerName,在Deployment面板中,点击右侧”+”,在弹出的菜单中选择Artifact,最后选择应用(Apply)。


设置完成如下图。

点击右侧运行按钮运行tomcat项目。