概述
maven依赖资源网站:https://mvnrepository.com
1、maven本地下载网址:maven
2、配置环境
![](https://file2.kaopuke.com:8081/files_image/2023062822/d4304db9020bfa858b55f898966ab4d9.png)
![](https://file2.kaopuke.com:8081/files_image/2023062822/0e2074eac4b6a6e8e530a4456e5d4f2d.png)
3、配置本地仓库
1.新建一个文件夹localRepository
![](https://file2.kaopuke.com:8081/files_image/2023062822/3d8090656a22c1f90e933efa5b378a03.png)
2.设置本地仓库。
进入conf目录,里面有一个settings.xml(全局配置文件),打开并找到localRepository ,在下方添加自己设置的本地仓库。如果没有设置本地仓库,会使用本地的默认仓库 C:Users用户名.m2。从maven获取jar包的时候,maven首先会从本地仓库中查找,有则直接返回。如果没有会从远程仓库中获取,并且保存。
![](https://file2.kaopuke.com:8081/files_image/2023062822/38f7ec395fb4a680ddfb882dda114020.png)
4.配置阿里云镜像
maven下载jar包是从国外下载,所以会很慢,所以要配置一个阿里云的镜像。
https://developer.aliyun.com/mvn/guide
1.在settings.xml中 大概在148行 找到mirrors
添加 :
<mirror>
<id>aliyunmaven</id>
<mirrorOf>*</mirrorOf>
<name>阿里云公共仓库</name>
<url>https://maven.aliyun.com/repository/public</url>
</mirror>
5.配置jdk版本:大概在 188行
<profiles>
<profile>
<id>jdk-1.8</id>
<activation>
<activeByDefault>true</activeByDefault>
<jdk>1.8</jdk>
</activation>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
</properties>
</profile>
</profiles>
6.在IDEA 和 Eclipse 中如何配置maven
注意:记得替换为自己的目录:
(1)IDEA
![](https://file2.kaopuke.com:8081/files_image/2023062822/b3cd4e4437958f0ef923ffb3b20dc1e0.png)
![](https://file2.kaopuke.com:8081/files_image/2023062822/762d2bb4d725aca46f6580d413354464.png)
(2)Eclipse
![](https://file2.kaopuke.com:8081/files_image/2023062822/4d676d75d9325ff0c3ed8f8c44985239.png)
![](https://file2.kaopuke.com:8081/files_image/2023062822/a36e21fcc97037c56dd8bba1498a7997.png)
![](https://file2.kaopuke.com:8081/files_image/2023062822/38d51af88fe477acd5146d18067007f2.png)
最后
以上就是潇洒树叶为你收集整理的maven的下载安装 以及Eclipse和IDEA如何配置maven的全部内容,希望文章能够帮你解决maven的下载安装 以及Eclipse和IDEA如何配置maven所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复