title: Gradle composite build `Cannot add task 'wrapper' as a task with that name already exists.`
body: <p>I have the following composite build</p>
  
  <p>settings.gradle</p>
  
  <pre><code>rootProject.name='adhoc'
  
  includeBuild '../my-app'
  </code></pre>
  
  <p>build.gradle</p>
  
  <pre><code>apply plugin: 'idea'
  
  defaultTasks 'run'
  
  task run {
      dependsOn gradle.includedBuild('my-app').task(':run')
  }
  
  task checkAll {
      dependsOn gradle.includedBuild('my-app').task(':check')
  }
  </code></pre>
  
  <p>../my-app/settings.gradle</p>
  
  <pre><code>rootProject.name = 'my-app'
  </code></pre>
  
  <p>../my-app/build.gradle</p>
  
  <pre><code> plugins {
       id 'java'
   }
  
   group "org.sample"
   version "1.0"
  
   task wrapper(type: Wrapper) {
       gradleVersion = '5.0'
   }
  </code></pre>
  
  <p>When I run <code>gradle</code> I get</p>
  
  <pre><code>A problem occurred evaluating project ':my-app'.
  &gt; Cannot add task 'wrapper' as a task with that name already exists.
  </code></pre>
  
  <p>What is happening, and how can I fix this?</p>