IDEA中创建maven web工程(一)

1、打开IDEA创建项目,选择MavenIDEA中创建maven web工程(一)

2、等待项目加载完之后,点击Project Structure,选择Modules

IDEA中创建maven web工程(一)
IDEA中创建maven web工程(一)
IDEA中创建maven web工程(一)

3、修改web.xml和webapp

IDEA中创建maven web工程(一)

4、设置Artifacts

IDEA中创建maven web工程(一)
IDEA中创建maven web工程(一)

5、配置Tomcat

IDEA中创建maven web工程(一)
IDEA中创建maven web工程(一)
IDEA中创建maven web工程(一)

注意:

war模式:将WEB工程以包的形式上传到服务器 。
war exploded模式:将WEB工程以当前文件夹的位置关系上传到服务器。

6、修改项目war包部署的路径

默认是在 你的项目路径\项目名\target下,
可以在Project Structure下的Artifacts下的Output directory修改
IDEA中创建maven web工程(一)
修改项目的部署路径为tomcat的webapps下:

IDEA中创建maven web工程(一)