在使用idea导入别人的工程后,发现工程里的引用包都无法使用,点开pom查看,提示
Failed to read artifact descriptor for xxx:jar
按照jar包的名字,在本地仓库里找到文件夹位置,打开lastUpdated文件,里面会写更新情况,
发现里面写了
http\://repo2.maven.org/maven2/.error=Could not transfer artifact ch.qos.logback\:logback-classic\:pom\:1.1.3 from/to repo2 (http\://repo2.maven.org/maven2/)\: Connect to repo2.maven.org\:80 [repo2.maven.org/151.101.24.209] failed\: Connection timed out\: connect
https\://github.com/ElectronicChartCentre/ecc-mvn-repo/raw/master/releases/.error=Could not transfer artifact ch.qos.logback\:logback-classic\:pom\:1.1.3 from/to ECC (https\://github.com/ElectronicChartCentre/ecc-mvn-repo/raw/master/releases)\: Received fatal alert\: protocol_version
说明从配置文件的2个镜像里都没找到这个资源,我从百度上找了几个新的镜像加入到配置文件中,
在idea中点击
file--settings--Build,Execution,Deployment---Maven
可以指定使用setting文件的位置
也可以直接在工程上点击右键,
直接打开setting文件,我本来用ue编辑器编辑好,发现还是不能成功更新,我就用idea直接打开,发现mirror内容报错,
Element 'mirror' cannot have character [children],because the type's content type is element
和之前的正确内容对比,也没发现问题,就把内容重新手敲了一遍,发现可以正确识别了,可能刚才里面有些字符不能识别
这个时候已经可以正确更新依赖了。