【问题标题】:Spring Boot batch App - Maven errorSpring Boot 批处理应用程序 - Maven 错误
【发布时间】:2017-07-28 04:40:16
【问题描述】:

我使用Spring Initializr 创建了一个 Spring boot 批处理 maven 项目。当我在我的 STS 上将下载的 zip 作为 maven 项目导入时,我遇到了以下问题,

Failure to transfer org.springframework.batch:spring-batch-infrastructure:jar:3.0.7.RELEASE from https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.springframework.batch:spring-batch-infrastructure:jar:3.0.7.RELEASE from/to central (https://repo.maven.apache.org/maven2): The operation was cancelled.

Spring Boot 版本 - 1.5.2

Java - 1.8

经过几个小时的更改和尝试,一旦我决定删除本地 maven 存储库“C:\Local.m2\repository”下的内容,问题就解决了。基本上我,

  1. 关闭了我的 STS
  2. 删除了我本地maven repo的所有内容
  3. 打开 STS
  4. 更新项目 (Maven -> Update Project)

现在我的问题是,有人可以解释这里发生了什么吗?有没有办法防止这类问题。这占用了我很多时间。有没有办法使用 Spring Initializr 创建项目而没有这些问题?

【问题讨论】:

    标签: maven spring-boot spring-batch


    【解决方案1】:

    这基本上是下载的问题,您无法确定何时会发生。

    使用“删除方法”,您无需删除所有 maven 存储库,只需删除面临问题的那个。

    但是错误信息告诉我们:

    在更新间隔之前不会重新尝试解析 Central 已过或强制更新

    当然,您不想等待,因此您可以强制从命令行运行 mvn clean install -U 更新,或者在 Run as -> Maven build... 上使用 STS 并在目标字段中写入 clean install -U-U means: force update!

    【讨论】:

      猜你喜欢
      • 2020-10-24
      • 1970-01-01
      • 2020-10-08
      • 2018-07-18
      • 2014-10-25
      • 2023-04-10
      • 2020-11-29
      • 2018-06-30
      • 2021-08-31
      相关资源
      最近更新 更多