文章目录
文章持续更新中。。。
1. 更新Gradle仓库或者迁移本地Maven仓库后报错
错误信息:If the artifact you are trying to retrieve can be found in the repository but without metadata in ‘Maven POM’ format, you need to adjust the ‘metadataSources { … }’ of the repository declaration.
原因:这是由于多模块构建后,会在根目录下形成临时文件,依赖库迁移后对应的临时文件索引没有删除导致的
解决方案:
# 在根目录下 build.gradle中添加如下内容(这个内容归属于all projects)
task clean(type: Delete) {
delete rootProject.buildDir
}
2. Gradle配置使用mavenLocal()后,假如添加新的依赖,在Maven仓库中不可见
原因:Gradle的设计者认为Gradle应该保持自己的仓库缓存,所以如果Gradle使用Maven仓库也只是在Maven仓库检索已下载的依赖&