1.使用maven模板:
1.新建project
2.项目类型选择maven,勾选create from archetype 选择maven webapp(注意不要选错一定要选带有maven的weba,next
![在这里插入图片描述](https://img-blog.csdnimg.cn/20200526084648666.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80NDAxOTg3NQ==,size_16,color_FFFFFF,t_70
3.项目名字,位置
4.首先配置maven本地仓库(我选的是默认本地仓库),为了解决maven下载慢问题我们添加键值对name:archetypeCatalog value:internal 接下来就是等待啦:
5.因为没有java文件夹所以新建:
新建名字叫java,和这两步相同在建一个resources
6.有的会发现新建完成之后没有办法直接建包写代码,java选sources root,
resoures选 resources Root
9.在pom.xml中加入相关依赖 pom.xml 漫长的加载
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
4.0.0
org.example
springmvc01
1.0-SNAPSHOT
war
springmvc01 Maven Webapp
http://www.example.com
UTF-8
1.8
1.8
5.0.2.RELEASE
org.springframework
spring-context
${spring.version}
org.springframework
spring-web
${spring.version}
org.springframework
spring-webmvc
${spring.version}
javax.servlet
servlet-api
2.5
provided
javax.servlet.jsp
jsp-api
2.0
provided
springmvc01
maven-clean-plugin
3.1.0
maven-resources-plugin
3.0.2
maven-compiler-plugin
3.8.0
maven-surefire-plugin
2.22.1
maven-war-plugin
3.2.2
maven-install-plugin
2.5.2
maven-deploy-plugin
2.8.2
8.创建完成后我们配置前端控制器 web.xml
123456789101112131415
Archetype Created Web Application
mvc
org.springframework.web.servlet.DispatcherServlet
mvc
/*
|