小男孩‘自慰网亚洲一区二区,亚洲一级在线播放毛片,亚洲中文字幕av每天更新,黄aⅴ永久免费无码,91成人午夜在线精品,色网站免费在线观看,亚洲欧洲wwwww在线观看

分享

Maven錯誤:was cached in the local repository, resolution will not be reattempted until the update

 hongjing_z 2019-04-08

問題及原因

今天在測試使用Spring BOM的時候,總發(fā)現(xiàn)項(xiàng)目無法打包成功。查看Maven的錯誤日志發(fā)現(xiàn):

Non-resolvable import POM: Failure to find org.springframework:spring‐framework‐bom:pom:4.3.5.RELEASE in http://repo./release/ was cached in the local repository, resolution will not be reattempted until the update interval of io.spring.repo.maven.release has elapsed or updates are forced @ line 29, column 19 -> [Help 2]

隨即在StackOverFlow上查看了問題,發(fā)現(xiàn)主要是因?yàn)?strong>Maven默認(rèn)會使用本地緩存的庫來編譯工程,而上次下載的庫失敗導(dǎo)致的。

解決辦法

  1. 刪除~/.m2/repository/對應(yīng)目錄或目錄下的*.lastUpdated文件,然后再次運(yùn)行maven命令
  2. maven命令后加-U,如mvn package -U
  3. 在repository的release或者snapshots版本中新增updatePolicy屬性,其中updatePolicy可以設(shè)置為”always”、”daily” (默認(rèn))、”interval:XXX” (分鐘)或”never”
<repositories>
    <repository>
      <id>io.spring.repo.maven.release</id>
      <url>http://repo./release/</url>
      <releases>
        <enabled>true</enabled>
        <updatePolicy>always</updatePolicy>
      </releases>
      <snapshots><enabled>false</enabled></snapshots>
    </repository>
  </repositories>

參考資源

  1. http:///questions/4856307/when-maven-says-resolution-will-not-be-reattempted-until-the-update-interval-of/41391500#41391500
  2. http://maven./ref/3.3.9/maven-settings/settings.html

    本站是提供個人知識管理的網(wǎng)絡(luò)存儲空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點(diǎn)擊一鍵舉報。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評論

    發(fā)表

    請遵守用戶 評論公約

    類似文章 更多