【发布时间】: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”下的内容,问题就解决了。基本上我,
- 关闭了我的 STS
- 删除了我本地maven repo的所有内容
- 打开 STS
- 更新项目 (
Maven -> Update Project)
现在我的问题是,有人可以解释这里发生了什么吗?有没有办法防止这类问题。这占用了我很多时间。有没有办法使用 Spring Initializr 创建项目而没有这些问题?
【问题讨论】:
标签: maven spring-boot spring-batch