Build:Download maven-metadata.xml...错误的解决

博客讲述了Android项目前一天还能正常打包构建,次日构建时卡在Download maven-metadata.xml数小时。经排查,错误信息为{ url “https://jitpack.io” } can't download,原因是项目build.gradle仓库配置中少了www,修改后重新构建成功。

        前一天项目还能好好的打包构建,今天突然一直Build:Download maven-metadata.xml...卡住好几个小时,然后往上各种找解决方案 ,但是都没有什么作用

其实造成这个错误的原因有很多,解决的方式也可能不一样,因为本人项目中通过 gradlew assembleDebug -info 排查错误信息的时候出现提示信息是

 { url “https://jitpack.io” } can't download
 

然后导致build一直卡在Download maven-metadata.xml过不去

突然看到jitpack.io官网的说明文档:

Add it in your root build.gradle at the end of repositories:

	allprojects {
		repositories {
			...
			maven { url 'https://www.jitpack.io' }
		}
	}

而本项目中的build.gradle中时这样的:

maven { url 'https://jitpack.io' }

细心的童鞋应该注意到了,我的仓库配置中少了www.

将 repositories 中的配置修改成

maven { url 'https://www.jitpack.io' }
allprojects 中的配置也要修改:
maven { url 'https://www.jitpack.io' }

修改完成后重新构建就好了。

D:\Users\jdk\bin\java.exe -Dmaven.multiModuleProjectDirectory=C:\Users\lenovo\AppData\Local\Temp\archetype1tmp -Djansi.passthrough=true -Dmaven.home=D:\download\maven\apache-maven-3.9.10 -Dclassworlds.conf=D:\download\maven\apache-maven-3.9.10\bin\m2.conf "-Dmaven.ext.class.path=D:\download\IDEA\IntelliJ IDEA 2024.3.4\plugins\maven\lib\maven-event-listener.jar" "-javaagent:D:\download\IDEA\IntelliJ IDEA 2024.3.4\lib\idea_rt.jar=9885" -Dfile.encoding=UTF-8 -Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8 -classpath D:\download\maven\apache-maven-3.9.10\boot\plexus-classworlds-2.9.0.jar;D:\download\maven\apache-maven-3.9.10\boot\plexus-classworlds.license org.codehaus.classworlds.Launcher -Didea.version=2024.3.4 -s D:\download\maven\apache-maven-3.9.10\conf\settings.xml -Dmaven.repo.local=D:\download\maven\repository -DinteractiveMode=false -DgroupId=cn.edu.zjut -DartifactId=untitled -Dversion=1.0-SNAPSHOT -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-webapp -DarchetypeVersion=1.0 org.apache.maven.plugins:maven-archetype-plugin:RELEASE:generate [INFO] Scanning for projects... [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 0.072 s [INFO] Finished at: 2025-11-26T23:01:06+08:00 [INFO] ------------------------------------------------------------------------ [ERROR] Plugin org.apache.maven.plugins:maven-archetype-plugin:RELEASE or one of its dependencies could not be resolved: [ERROR] Failed to resolve version for org.apache.maven.plugins:maven-archetype-plugin:jar:RELEASE: Could not find metadata org.apache.maven.plugins:maven-archetype-plugin/maven-metadata.xml in local (D:\download\maven\repository) [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException 进程已结束,退出代码为 1
最新发布
11-27
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值