Java Gradle项目报错Warning:project ‘xxx’: Web Facets/Artifacts will not be …
公司项目使用Gradle构建管理的,前些天刷新了一下项目依赖,出现以下错误:
错误代码:
Warning:project ‘xxx’: Web Facets/Artifacts will not be configured properly
Details: org.gradle.api.artifacts.ResolveException: Could not resolve all dependencies for configuration ‘xxx:runtimeClasspath’.
Caused by: org.gradle.internal.resolve.ModuleVersionResolveException: Could not resolve com.xxx:1.0.+.
Required by:
project :xxx > project :xxx
project :xxx > project :xxx > com.xxx:1.0.0-SNAPSHOT
Caused by: org.gradle.internal.resolve.ModuleVersionResolveException: Could not resolve xxx:1.0.0-SNAPSHOT.
Caused by: java.lang.RuntimeException: Could not load module metadata from D:\Develop\JavaTools.gradle\caches\modules-2\metadata-2.23\descriptors\com.xxx\xxx\1.0.0-SNAPSHOT\b29197ee0a4beae39e910c94a052b286\descriptor.bin
Caused by: java.lang.IllegalArgumentException: Unexpected metadata type found.
错误分析:
本地仓库与私服或者云仓库版本冲突。
解决思路:
删除本地仓库对应的文件,重新下载依赖。
解决步骤:
删除.gradle\caches\modules-2\files-2.1下相关的依赖文件夹以及文件(PS:只删除报错的依赖文件,不是删除该目录下所有文件);
删除.gradle\caches\modules-2\metadata-2.xx下相关的依赖文件夹以及文件(PSS:只删除报错的依赖文件,不是删除该目录下所有文件);
然后使用Gradle刷新项目,使项目重私服或者云仓库重新下载一遍依赖.jar文件即可解决。
————————————————
版权声明:本文为CSDN博主「DAKANG❤」的原创文章,遵循CC 4.0 by-sa版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/yujikang123/article/details/86674593