當我對項目進行打包時,報了以下錯誤:
Failure to find com.st:oscarJDBC16:pom:1.0.0 in http://maven.aliyun.com/nexus/content/groups/public/ was cached in the local repository, resolution will not be reattempted until the update interval of public has elapsed or updates are forced
簡單直譯:無法在http://maven.aliyun.com/nexus/content/groups/public/中找到com.st:oscarJDBC16:pom:1.0.0被緩存在本地存儲庫中,在public的更新間隔過去或強制更新之前,不會重新嘗試解析
為解決這個問題,查閱了比較多的信息如下:
1,
去自己的.m2 文件夾下把 xxx.lastUpdated文件全部刪掉,重新運行maven,ok!
或者在用maven時加 -U參數,就可以忽略xxx.lastUpdated..
這里,簡單排查,並不是這個原因導致的
2,
換下版本,或者換源試
換了多次,依舊報錯
3,
在repository的release或者snapshots版本中新增updatePolicy屬性,其中updatePolicy可以設置為”always”、”daily” (默認)、”interval:XXX” (分鍾)或”never”
<repositories> <repository> <id>io.spring.repo.maven.release</id> <url>http://repo.spring.io/release/</url> <releases> <enabled>true</enabled> <updatePolicy>always</updatePolicy> </releases> <snapshots><enabled>false</enabled></snapshots> </repository> </repositories>
依舊報錯
最終解決方案
之前的pom配置
修改為直讀jar包
問題解決!!!
如果有什么更好的方法或者建議,歡迎留言討論~~