idea更新maven索引失败

简介: idea更新maven索引失败

idea的maven索引更新不了,使得写依赖的时候非常的难受,百度了许多方法都尝试失败了,之后阅读一篇文章让我有了启发。文章


既然在idea中更新不了我是否可以按照该文章所说的那样,直接下载好maven的索引文件再放到相应的位置呢?说干就干,后来找了一下idea下载maven索引默认放置的索引文件位置都找不到(在用户下面没有idea的相应文件),这种方法只好作罢。注意我用的idea是2021版的。


接下来尝试了下一种方法,下载文件(http://repo1.maven.org/maven2/.index/nexus-maven-repository-index.propertieshttp://repo1.maven.org/maven2/.index/nexus-maven-repository-index.gz)时,出现


501 HTTPS Required. 
Use https://repo1.maven.org/maven2/
More information at https://links.sonatype.com/central/501-https-required


百度了一下,说出现的原因是:官方有原来的http更换成了https


解决方案:在本地maven 的setting.xml文件中镜像处加入:


<mirror>
<id>central</id>
<name>Maven Repository Switchboard</name>
<url>https://repo1.maven.org/maven2/</url>
<mirrorOf>central</mirrorOf>
</mirror>


之后也就在自己maven 的 settings.xml添加了配置,再在idea中更新maven索引,返现一直在运行中,有戏。虽然第一次没有成功并且下载时间挺长的,再更新了一次成功了,此刻再也压不住我心中的喜悦。


怎么说呢,这次问题的解决存在一定的巧合行,并且。。。。


不写了,看了时间凌晨5.36,睡觉睡觉。

相关文章
|
2月前
|
Java Maven
Maven【5】在IDEA环境中配置和使用Maven
Maven【5】在IDEA环境中配置和使用Maven
72 1
|
25天前
|
Java Maven Android开发
maven篇3:IDEA中集成maven
maven篇3:IDEA中集成maven
maven篇3:IDEA中集成maven
|
3天前
|
Java Maven
idea中maven项目pom文件Could not acquire lock(s)
idea中maven项目pom文件Could not acquire lock(s)
|
22天前
|
Java Maven Spring
【操作宝典】IntelliJ IDEA新建maven项目详细教程
【操作宝典】IntelliJ IDEA新建maven项目详细教程
33 1
|
9天前
|
Java Maven
【IDEA】常用快捷键和自定义方法补全(附如何设置IDEA全局配置,如Maven)
【IDEA】常用快捷键和自定义方法补全(附如何设置IDEA全局配置,如Maven)
14 0
|
9天前
|
Java Maven Kotlin
[AIGC] 请你写一遍博客介绍 “使用idea+kotinlin+springboot+maven 结合开发一个简单的接口“,输出markdown格式,用中文回答,请尽可能详细
[AIGC] 请你写一遍博客介绍 “使用idea+kotinlin+springboot+maven 结合开发一个简单的接口“,输出markdown格式,用中文回答,请尽可能详细
|
21天前
|
Java 应用服务中间件 Maven
使用IDEA搭建SpringMVC环境,Maven导入了依赖,但是运行报错 java.lang.ClassNotFoundException
使用IDEA搭建SpringMVC环境,Maven导入了依赖,但是运行报错 java.lang.ClassNotFoundException
14 1
|
23天前
|
Java Maven Spring
【IntelliJ IDEA】使用Maven方式构建Spring Boot Web 项目(超详细)2
【IntelliJ IDEA】使用Maven方式构建Spring Boot Web 项目(超详细)
18 2
|
23天前
|
Java Maven 开发工具
【IntelliJ IDEA】使用Maven方式构建Spring Boot Web 项目(超详细)1
【IntelliJ IDEA】使用Maven方式构建Spring Boot Web 项目(超详细)
22 2
|
1月前
|
Java Maven
idea编码GBK的不可映射字符Maven修改编码格式的多种方式
idea编码GBK的不可映射字符Maven修改编码格式的多种方式
22 1