现在,当我注释掉compile project('product-cache-client')它会转到下一个并且对此有所了解。
我试图将它添加到该模块中的gradle.settings中,如下所示:
include('client') include('cache')但我仍然得到同样的错误。 我甚至尝试将其添加到gradle.settings
project('lib/cache').projectDir = "$rootDir/lib/cache" as File并且仍然得到相同的结果。
Gradle 4.4
主gradle.build文件:
subprojects { dependencies { compile project('client') compile project('cache') } repositories{ jcenter() mavenCentral() } } configure(subprojects){ apply plugin: 'maven' apply plugin: 'java' apply plugin: 'idea' apply plugin: 'eclipse' } repositories { } buildscript { ext { sourceCompatibility = 1.8 targetCompatibility = 1.8 } } dependencies { jcenter() mavenCentral() } dependencies { compile project('client') compile project('-cache ')Now when I comment out compile project('product-cache-client') it moves to the next one and compains about that.
I tried to add it to gradle.settings in that module like so:
include('client') include('cache')But I still get the same error. I even tried adding this to the gradle.settings
project('lib/cache').projectDir = "$rootDir/lib/cache" as FileAnd still get the same result.
Gradle 4.4
main gradle.build file:
subprojects { dependencies { compile project('client') compile project('cache') } repositories{ jcenter() mavenCentral() } } configure(subprojects){ apply plugin: 'maven' apply plugin: 'java' apply plugin: 'idea' apply plugin: 'eclipse' } repositories { } buildscript { ext { sourceCompatibility = 1.8 targetCompatibility = 1.8 } } dependencies { jcenter() mavenCentral() }最满意答案
在你的父级构建的顶部添加java插件,对我来说这是可行的:
应用插件:'java'
这里推荐 - 第二个答案找不到方法compile()用于参数Gradle并且还用'repositories'切换'依赖关系' - 至少在你编写的build.gradle的示例中,它们被切换。
Add the java plugin on top of your parent build, for me this works:
apply plugin:'java'
It is recommended here - the second answer Could not find method compile() for arguments Gradle And also switch the 'dependencies' with 'repositories' - at least in the sample of build.gradle you wrote here they are switched.
更多推荐
发布评论