在IntelliJ IDEA配置Tomcat

一。配置tomcat
在IntelliJ IDEA配置Tomcat
打开IDEA,点击Run-Edit Configurations…
在IntelliJ IDEA配置Tomcat

点击“+”号,然后找到Tomcat Server,选择Local
在IntelliJ IDEA配置Tomcat

在Tomcat Server -> Unnamed -> Server -> Application server项目下,点击 Configuration ,找到本地 Tomcat 服务器(即前面的解压路径),再点击 OK按钮。可以把Unnamed修改成其他名字,如Tomcat 9
在IntelliJ IDEA配置Tomcat

然后转到旁边的Deployment选项卡,点击“+”号,选择Artifact,选择项目名称

在IntelliJ IDEA配置Tomcat
如下图所示,也可以修改一下Application context 路径的名字,改得简单一点,然后点击OK即可
在IntelliJ IDEA配置Tomcat

二。开始配置项目
配置 project structure
【F4】 或 项目右键 【Open Module Settings】或 右上角有个黑蓝色的框框 或 菜单栏【view】-【Open Module Settings】进入
在IntelliJ IDEA配置Tomcat
在IntelliJ IDEA配置Tomcat
在IntelliJ IDEA配置Tomcat
在IntelliJ IDEA配置Tomcat
在IntelliJ IDEA配置Tomcat
在IntelliJ IDEA配置Tomcat

在IntelliJ IDEA配置Tomcat
1.3.3 配置 Denpendencies
右面有个绿色小加号 - JARs or directories…
在IntelliJ IDEA配置Tomcat
在IntelliJ IDEA配置Tomcat
在IntelliJ IDEA配置Tomcat
在IntelliJ IDEA配置Tomcat
如果不配置Spring 那么会出现报错
SSM整合时IDE: File is included in 4 contexts
https://blog.****.net/qq_30225725/article/details/109663329
在IntelliJ IDEA配置Tomcat
选中弹出的项目 OK
在IntelliJ IDEA配置Tomcat