嗯。。我写的这些基本都是在网上看的别人的,然后自己再总结一下,不求帮助到别人,只希望自己能够掌握这些知识。
首先先从官网下载http://maven.apache.org/download.cgi
![a40ec2b6e7e14aff610fa1cc930bb1cc.png](https://img-blog.csdnimg.cn/img_convert/a40ec2b6e7e14aff610fa1cc930bb1cc.png)
![875239430eb9b25e65ea5628d3d1ba30.png](https://img-blog.csdnimg.cn/img_convert/875239430eb9b25e65ea5628d3d1ba30.png)
![b33b26e1eeb44022b0a7b025208904cf.png](https://img-blog.csdnimg.cn/img_convert/b33b26e1eeb44022b0a7b025208904cf.png)
下载完成后,解压到自己喜欢的目录下,最好全是英文也没有空格。然后把conf下的settings.xml复制到eclipse里进行修改。
![f2fd652b041feb09965f7c97b4f7365d.png](https://img-blog.csdnimg.cn/img_convert/f2fd652b041feb09965f7c97b4f7365d.png)
在<settings>标签下添加<localRepository>C:wdmavenapache-maven-3.6.0repository</localRepository>就是自己repository所在的目录。
![e25d398c21acf7bf0294273374cd38db.png](https://img-blog.csdnimg.cn/img_convert/e25d398c21acf7bf0294273374cd38db.png)
然后在<mirrors>标签下加上镜像
![d81447891254ee85d5f613815e0aa541.png](https://img-blog.csdnimg.cn/img_convert/d81447891254ee85d5f613815e0aa541.png)
配置好了之后保存一下把原来的settings.xml覆盖,再来配置环境
![73198a484bf62e5553b9c58f091c0e55.png](https://img-blog.csdnimg.cn/img_convert/73198a484bf62e5553b9c58f091c0e55.png)
![ffcd8d0543c6587a19e18de76b123238.png](https://img-blog.csdnimg.cn/img_convert/ffcd8d0543c6587a19e18de76b123238.png)
这就完成了下载与配置了,然后打开cmd输入mvn -version进行验证。
![0103f5945ee7b42e3089edbc573f4b1e.png](https://img-blog.csdnimg.cn/img_convert/0103f5945ee7b42e3089edbc573f4b1e.png)
出现这种结果就说明安装成功了。
接下来就进行Eclipse的配置
![b74e33d5e62152261f4038a309ca5846.png](https://img-blog.csdnimg.cn/img_convert/b74e33d5e62152261f4038a309ca5846.png)
![46a6823e09fd846dd5528745f2db94c9.png](https://img-blog.csdnimg.cn/img_convert/46a6823e09fd846dd5528745f2db94c9.png)
完成这些就配置好了,在这里我们就创建一个maven工程顺便解决一个问题。
首先创建一个Maven Project过程
![9d2bf5b96d50bc14161bbec158470cc7.png](https://img-blog.csdnimg.cn/img_convert/9d2bf5b96d50bc14161bbec158470cc7.png)
然后点上这个沟
![e928dd7a690bdf7d70618d7910dd3032.png](https://img-blog.csdnimg.cn/img_convert/e928dd7a690bdf7d70618d7910dd3032.png)
![2067bd04ab6764e62968e51bc9d8a2e5.png](https://img-blog.csdnimg.cn/img_convert/2067bd04ab6764e62968e51bc9d8a2e5.png)
这时会报错,因为缺少web.xml
![ec98c31962aa71c8c2e2e8d69d9a74a9.png](https://img-blog.csdnimg.cn/img_convert/ec98c31962aa71c8c2e2e8d69d9a74a9.png)
有一个方法可以直接生成web.xml
![1a19ae77937a8c29db34c10cf5037d3c.png](https://img-blog.csdnimg.cn/img_convert/1a19ae77937a8c29db34c10cf5037d3c.png)
到这里就大功告成了,可以点根烟庆祝一下了。