【问题标题】:Gradle cannot sync Spring Boot projectGradle 无法同步 Spring Boot 项目
【发布时间】:2020-04-06 23:39:24
【问题描述】:

我正在尝试从 intelij 中的 start.spring.io 使用 gradle 导入新项目,但它无法下载任何依赖项或导入插件。我看到来源列表是空的。

知道怎么解决吗?

   $ ./gradlew build

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\Users\Jarek\Downloads\demo\build.gradle' line: 3

* What went wrong:
Plugin [id: 'org.springframework.boot', version: '2.2.2.RELEASE'] was not found in any of the following sources:

- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Plugin Repositories (could not resolve plugin artifact 'org.springframework.boot:org.springframework.boot.gradle.plugin:2.2.2.RELEASE')
  Searched in the following repositories:
    Gradle Central Plugin Repository

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

【问题讨论】:

  • 坐在代理后面?刷新缓存了吗?
  • 在代理之后,我不这么认为。是家庭网络。刷新缓存?您的意思是使用无效缓存重新启动想法。不工作。这真的很奇怪。我在 ssd 上安装了新系统,maven 运行良好。
  • 从命令行(在 IntelliJ 之外)运行 Gradle 构建是否有效?
  • 它也不起作用,但它的原因真的很混乱。
  • 该插件可从门户获得,因此它应该可以工作。您可以尝试使用--refresh-dependencies 运行您的构建吗?如果这没有帮助,使用--debug 运行的输出可能会帮助您找出问题所在。

标签: spring-boot gradle intellij-idea


【解决方案1】:

(Screenshot from Intellij IDE) The Toggle Offline mode button is the last to the right on the botton bottom tray

您可能已为您的 gradle 切换到离线模式。请关闭离线模式并在您的 IDE 终端上运行./gradlew build

【讨论】:

    猜你喜欢
    • 2015-11-08
    • 2016-04-22
    • 1970-01-01
    • 1970-01-01
    • 2018-09-29
    • 2019-01-06
    • 1970-01-01
    相关资源
    最近更新 更多