IDEA中Maven中mysql-connector-java或者其他依赖包下载不了的问题的解决办法
今天安装依赖包浪费了很多的时间,看了很多的博客才得到了解决,接下来总结一些.
1.首先将Settings -> Build,Execution,Deployment -> Build Tools -> Maven -> Ignored Files 去掉
2. 之后将一些勾打上 Settings -> Build,Execution,Deployment -> Build Tools -> Maven -> Importing,如下图:
3.右击Maven项目,操作如下图:
点击Open’settings.xml’ , 刚开始这个位置是Create ‘settings.xml’ ,打开之后添加在里面添加镜像服务器:
<!-- 第一种镜像--> <mirrors>
<span class="token operator"><</span>mirror<span class="token operator">></span> <span class="token operator"><</span>id<span class="token operator">></span>nexus<span class="token operator"><</span>/id<span class="token operator">></span> <span class="token operator"><</span>name<span class="token operator">></span>internal nexus repository<span class="token operator"><</span>/name<span class="token operator">></span>
<!– <url>http://repo.maven.apache.org/maven2</url>–>
<url> http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
第二种镜像
<mirrors>
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>
http://maven.aliyun.com/nexus/content/groups/public/
</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
两种镜像都可以,这是我从参考其他博客综合得到的,
感谢这位博客
https://blog.csdn.net/jwcxs_m/article/details/80076909
还有这位博客以及评论区的那位大佬(问题在这里得到真正解决)
https://blog.csdn.net/Jamel_LiToo/article/details/83933060.
4.最后还要做一些处理(选其一,或者都尝试)
1.把pom.xml中对应的依赖先删除,然后刷新右侧,之后再把依赖粘贴到pom.xml中,再次刷新右侧就好了
2.从本地仓库将对应的包删除掉,然后让maven重新下载
问题解决,没报错