天天看点

idea+mave+tomcat运行web项目

idea+maven+tomcat运行web项目

1、  创建一个modlue

a)        选择mave-archetype-webapp

idea+mave+tomcat运行web项目

b)        输入对应的三个坐标

idea+mave+tomcat运行web项目

c)        对应的mave信息

idea+mave+tomcat运行web项目

d)        输入module的名字

idea+mave+tomcat运行web项目

e)        Finish之后,点击右上角的import changes

idea+mave+tomcat运行web项目

f)         如此,webapp的module建好了

idea+mave+tomcat运行web项目

2、  配置tomcat

a)        选择“run”---“Edit Configurations”

idea+mave+tomcat运行web项目

b)        点击“+“-----”Tomcat Server“------” Local“

idea+mave+tomcat运行web项目

c)        输入tomcat名称,选择tomcat服务器所在位置

idea+mave+tomcat运行web项目

d)        选择“Deployement“标签,点击”+“------”Artifact“

idea+mave+tomcat运行web项目

e)        把对应的项目的war导入

idea+mave+tomcat运行web项目

f)         最后结果如下所示

idea+mave+tomcat运行web项目

3、  运行项目

a)        打包项目

idea+mave+tomcat运行web项目

b)        运行项目,直接点击右上角的那个三角形,直接运行

idea+mave+tomcat运行web项目

c)        最后运行效果

idea+mave+tomcat运行web项目