【问题标题】:Gradle Eclipse getting compile issuesGradle Eclipse 出现编译问题
【发布时间】:2018-05-18 05:41:41
【问题描述】:

在我的 build.gradle 文件中,我有一个错误的依赖项

compile('org.springframework.boot:spring-boot-starter234')

当我这样做时

gradle build

我明白了:

FAILURE: Build failed with an exception.

* What went wrong:
Could not resolve all files for configuration ':compileClasspath'.
> Could not find org.springframework.boot:spring-boot-starter234:.
  Required by:
      project :

但是在 Eclipse 中,当我运行任务时,我没有收到明确的消息。我只是得到:

注意:我已刷新 Gradle 项目并收到相同的消息

【问题讨论】:

    标签: eclipse gradle buildship


    【解决方案1】:

    我假设您使用 mavenCentraljcenter 作为存储库。在您的构建脚本中,它们都没有带有 groupId org.springframework.boot 和 artifactId spring-boot-starter234 的工件,其中包含以下行:

    compile('org.springframework.boot:spring-boot-starter234')
    

    因此,gradle 找不到它。 spring-boot-starter 的一种可能的正确依赖关系可能是:

    compile('org.springframework.boot:spring-boot-starter:2.0.2.RELEASE')
    

    或从Maven Repository 中选择与您的项目更匹配的另一个版本。

    【讨论】:

      【解决方案2】:

      您可以右键单击失败的任务(或在 Mac 上按住 ctrl 单击)并选择“显示失败”。

      或者您可以单击带有工具提示“导航到此执行的控制台”的小控制台图标(在屏幕截图的右上角)

      【讨论】:

      • 问题是关于尝试获取有关失败的更多信息,所以这完美地回答了它 - 谢谢
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-08-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多