我有以下复合版本
settings.gradle
rootProject.name='adhoc'
includeBuild '../my-app'
build.gradle
apply plugin: 'idea'
defaultTasks 'run'
task run {
dependsOn gradle.includedBuild('my-app').task(':run')
}
task checkAll {
dependsOn gradle.includedBuild('my-app').task(':check')
}
../ my-app / settings.gradle
rootProject.name = 'my-app'
../ my-app / build.gradle
plugins {
id 'java'
}
group "org.sample"
version "1.0"
task wrapper(type: Wrapper) {
gradleVersion = '5.0'
}
运行gradle
时我会得到
A problem occurred evaluating project ':my-app'.
> Cannot add task 'wrapper' as a task with that name already exists.
发生了什么,我该如何解决?