Gradle Eclipse遇到编译问题

时间:2018-05-17 16:22:30

标签: eclipse gradle buildship

在我的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运行任务时,我没有收到明确的信息。我得到: enter image description here

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

2 个答案:

答案 0 :(得分: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更好地选择与您的项目匹配的其他版本。

答案 1 :(得分:0)

您可以右键单击失败的任务(或在Mac上按住Ctrl键单击),然后选择"显示失败"。

或者您可以使用工具提示单击小屏幕控制台图标(位于屏幕截图的右上角)"导航到控制台以执行此操作"

相关问题