title: grails 3.3.9, plugin wont compile after adding the settings.gradle
body: <p>I have grails 3.3.9 installed on Mac.</p>
  
  <p>If I create a normal application, e.g. using:</p>
  
  <pre><code>grails create-app myapp
  </code></pre>
  
  <p>I can create domain classes, views etc, run the app and see the web pages.</p>
  
  <p>However, I need two different web apps (one for the internal backoffice, and one for the customer facing public website).  The solution is to create a core plugin which contains only the domain objects and service layer which is then called by the two web apps, and later API apps etc. also.</p>
  
  <p>I followed the official instructions <a href="https://docs.grails.org/latest/guide/plugins.html" rel="nofollow noreferrer">here</a> </p>
  
  <p>i.e.:</p>
  
  <pre><code>$ grails create-plugin core --profile=plugin --features=hibernate5,events
  $ Grails create-app myapp
  $ create settings.gradle with: include "myapp","core"
  $ edit build.grandle of myapp and add:
  
  grails {
      plugins {
          compile project(':core')
      }
  }
  </code></pre>
  
  <p>Now when I try to compile either, or run any grails command (such as grails create-service) I get this:</p>
  
  <pre><code>| Resolving Dependencies. Please wait...
  FAILURE: Build failed with an exception.
  * Where:
  Build file '/Users/me/dev/grails_projects/tst/core/build.gradle' line: 17
  
  * What went wrong:
  A problem occurred evaluating project ':core'.
  &gt; Failed to apply plugin [id 'org.grails.grails-plugin']
     &gt; Could not find method runtimeOnly() for arguments [io.methvin:directory-watcher] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
  
  * Try:
  Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
  </code></pre>
  
  <p>If I remove the settings.gradle, I can compile the plugin.  If I add it back, compile (or any grails command such as create-domain-class) fails with the above error.</p>
  
  <p>Here is the build.gradle:</p>
  
  <pre><code>buildscript {
      repositories {
          mavenLocal()
          maven { url "https://repo.grails.org/grails/core" }
      }
      dependencies {
          classpath "org.grails:grails-gradle-plugin:$grailsVersion"
          classpath "org.grails.plugins:hibernate5:${gormVersion-".RELEASE"}"
      }
  }
  
  version "0.1"
  group "core"
  
  apply plugin:"eclipse"
  apply plugin:"idea"
  apply plugin:"org.grails.grails-plugin"
  apply plugin:"org.grails.grails-plugin-publish"
  </code></pre>
  
  <p>The offending line 17 is:</p>
  
  <pre><code>apply plugin:"org.grails.grails-plugin"
  </code></pre>
  
  <p>I also tried creating the plugin with the name "corex" instead of core just in case that was a reserved word. Got same results - plugin wont compile.</p>
  
  <p>Note, the project directory structure looks like this:</p>
  
  <pre><code>settings.gradle
  myapp
     build.gradle
     etc.
  core
     build.gradle.
     etc.
  </code></pre>
  
  <p>I also tried several variations of the line in settings.gradle, including:</p>
  
  <ol>
  <li>include 'myapp', 'core'</li>
  <li>include 'core', 'myapp'</li>
  <li>include ":myapp", ":core"</li>
  </ol>
  
  <p>Any ideas?</p>
  
  <h1>UPDATE 1</h1>
  
  <p>I just tried this with 3.3.8 and it seems to work.  So it would appear to be a bug in 3.3.9 which prevents using modular apps.</p>