0
我有以下問題:有項目有自己的buildscript部分:搖籃:包括與buildscript作爲子項目項目
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
}
}
當我把它作爲一個子項目到另外一個(也具有類似buildscript節)我得到以下錯誤:因爲我需要得到2種情景工作
* What went wrong: A problem occurred evaluating project ':blablabla'.
> Cannot change dependencies of configuration ':blablabla:classpath' after it has been resolved.
這buildscript是必須對他們倆的:
- 當他們兩個都可以獨立建造時
- 當
blablabla
被視爲第一個子項目。
所以,問題是我如何重寫(或禁用)包含項目的buildscript部分?
編輯:
我有如下配置:
// mainProject's build.gradle
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
}
}
plugins {
id 'org.jetbrains.intellij' version "0.0.36"
}
// Some other irrelevant stuff
blablabla
小號build.gradle
// subProject's build.gradle
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
}
}
plugins {
id 'org.jetbrains.intellij' version "0.0.36"
}
// Some other irrelevant stuff
而且settings.gradle
:
// settings.gradle
include ":subProject"
怎麼樣你包括project2作爲project1的子項目? – RaGe
正確:在'settings.gradle'裏面我做:'include:blablabla' – alexeykudinkin
請問你能否提供一個重現問題的例子? – Opal