【问题标题】:File dependencies in Gradle?Gradle中的文件依赖项?
【发布时间】:2012-07-19 12:53:13
【问题描述】:

我正在尝试使用 gradle 和这些说明指定一些 jar 依赖项:

http://gradle.org/docs/current/userguide/dependency_management.html#sub:file_dependencies

我有以下项目:

test
 -> libs
     -> svnant.jar
 -> build.gradle

build.gradle 包含的位置:

dependencies {
  runtime files('libs/svnant.jar')
  runtime fileTree(dir: 'libs', include: '*.jar')
}

当我从 windows cmd 运行 gradle 时,我得到:

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\...\test\build.gradle' line: 16

* What went wrong:
A problem occurred evaluating root project 'test'.
> Could not find method runtime() for arguments [file collection] on root project 'test'.

我错过了什么?

【问题讨论】:

    标签: gradle


    【解决方案1】:

    如果您应用 java 插件(或自行声明配置),您只会获得 runtime 配置。

    【讨论】:

    • 如何与插件com.android.application一起使用?他们不能一起工作。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-09-13
    • 1970-01-01
    • 2014-07-03
    • 1970-01-01
    • 2015-02-17
    • 2020-08-27
    相关资源
    最近更新 更多