_remote.repositories文件
本地庫中的包都有一個_remote.repositories文件,示例:
#NOTE: This is an Aether internal implementation file, its format can be changed without prior notice.
#Fri Aug 10 10:04:28 CST 2018
spring-boot-starter-web-1.5.9.RELEASE.pom>test1-nexus-mirro=
spring-boot-starter-web-1.5.9.RELEASE.jar>test1-nexus-mirro=
spring-boot-starter-web-1.5.9.RELEASE.pom>test2-nexus-mirro=
spring-boot-starter-web-1.5.9.RELEASE.jar>test2-nexus-mirro=
這個文件存儲的是每次從私服或者中央倉庫下載的jar包的信息。
第3行:pom文件>私服ID名稱
第4行:jar文件>私服ID名稱
第5、6行:從另一個私服下載的記錄
假設我們更換了私服地址為nexus-abc,並且該私服不存在該資源,那么就會生成logback-parent-1.1.1.pom.lastUpdated文件;
也就是說,_remote.repositories文件,標示該資源的來源,如果你有這個_remote.repositories,那就會在訪問本地的同時,必須確保遠程上有才行(這里的遠程是setting文件中配置的鏡像或遠程倉庫,用id來進行關聯,詳情見標題2._remote…),否則就會報錯;
錯誤信息
Could not resolve dependencies for project com-hallo-mybatis:generator:jar:1.0-SNAPSHOT:
The following artifacts could not be resolved: com.tencent.tsf:spring-cloud-tsf-dependencies:pom:1.1.1-
RELEASE, com.tencent.tsf:spring-cloud-tsf-sleuth:jar:1.1.1-RELEASE, com.tencent.tsf:spring-cloud-tsf-
auth:jar:1.1.1-RELEASE: Failure to find com.tencent.tsf:spring-cloud-tsf-dependencies:pom:1.1.1-RELEASE in
<span style="color:#ab4642">http://***:8081/repository/public/ was cached in the local repository, resolution
will not be reattempted until the update interval of public has elapsed or updates are forced</span>
.jar.sha1文件
是jar的校驗文件
.pom
是pom管理描述文件
.pom.sha1
是pom的校驗文件
.lastUpdated
當遠程倉庫沒有該jar時,就會生成該文件,說明該jar下載失敗。如果本地倉庫有該jar,則刪除該文件和_remote.repositories文件,否則刪除該依賴之后,用命令強制下載該jar。
參考
https://zhuanlan.zhihu.com/p/59058778
https://www.cnblogs.com/mySummer/p/9453777.html
https://blog.csdn.net/lovepeacee/article/details/103094247