Gradle复合构建`无法添加任务'包装器',因为该名称的任务已经存在。

时间:2018-12-24 08:42:01

标签: gradle gradlew

我有以下复合版本

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.

发生了什么,我该如何解决?

0 个答案:

没有答案