我正在使用以下目录结构创建新闻下载gradle项目。
news-feed (root)
|-bbc-plugin (sub-project)
我想将jsoup库用于我的子项目,所以我将依赖项添加到我的root build.gradle文件中,如下所示。
import org.gradle.api.artifacts.*
apply plugin: 'base' // To add "clean" task to the root project.
apply plugin: 'application'
mainClassName = 'newsFeed.MainMenu'
subprojects {
apply from: rootProject.file('common.gradle')
apply plugin: 'java'
dependencies {
compile 'org.jsoup:jsoup:1.10.3'
}
}
dependencies {
compile project(':bbc-plugin')
}
由于错误
,我无法构建项目* What went wrong:
Could not resolve all files for configuration ':bbc-plugin:compileClasspath'.
> Can't resolve external dependency org.jsoup:jsoup:1.10.3 because no repositories are defined.
Required by:
project :bbc-plugin
是否有办法在根构建文件中指定依赖项而无需在每个子项目的build.gradle文件中指定?