【问题标题】:Dependency issue in gradle when external project got included包含外部项目时 gradle 中的依赖问题
【发布时间】:2016-05-06 09:56:54
【问题描述】:

当我在 gradle 中包含外部项目时遇到以下问题(我正在使用 Intellij IDEA)。

Could not resolve all dependencies for configuration ':build'.
> Could not find :<external-project>:.
  Searched in the following locations:
      file:/Users/<user>/.m2/repository//<external-project>//<external-project>-.pom
      file:/Users/<user>/.m2/repository//<external-project>//<external-project>-.jar

我在 settings.gradle 中有以下行:

包括“:” project(':').projectDir = new File(rootProject.projectDir, '../')

并且 build.gradle 有:compile ':external-project'

单独两个项目都正常工作,但是当我包含外部项目时,我遇到了依赖问题。

【问题讨论】:

  • 试试compile project(':external-project')
  • 你是宝石,RaGe :) 谢谢,它现在可以工作了。如果您可以将此作为答案,我可以投票并关闭此线程。

标签: java intellij-idea gradle


【解决方案1】:

在settings.gradle中添加项目的正确引用方式是:

compile project(':external-project')

【讨论】:

    猜你喜欢
    • 2014-07-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-02-12
    • 2013-11-05
    • 1970-01-01
    相关资源
    最近更新 更多