2017-03-07 80 views
0

我创建了一个使用Spring Initializr的Spring引导批处理maven项目。当我导入下载的zip作为我的STS Maven项目,我面临着以下问题,Spring Boot批处理应用程序 - 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.

春天引导版本 - 1.5.2

爪哇 - 1.8

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

  1. 闭上了STS
  2. 删除了我的本地Maven回购
  3. 打开STS
  4. 更新项目(Maven -> Update Project

现在我的问题是,所有的内容,有人能解释这里发生了什么吗?有没有办法来防止这类问题。这已经带走了我很多时间。有没有办法使用Spring Initializr创建项目而没有这些问题?

回答

1

这基本上是一个下载问题,你不能确定它何时会发生。

使用“删除方法”,你不需要删除所有的maven回购,只是面临问题的回购。

但错误信息告知的是:

分辨率将不会被重新尝试,直到 中央的更新间隔已过或更新被迫

你不想等待,当然,这样你可以强制更新命令行运行mvn clean install -U,或使用运行STS为 - > Maven构建......在目标领域写clean install -U-U means: force update!

相关问题