title: publishing to mavenLocal using build.gradle.kts
body: <p>I'm trying to publish an artifact to <code>~/.m2</code> (maven-local) and as a Gradle newbie, i'm not sure what i'm missing</p>
  
  <p>All the examples i've seen so far suggests using a <code>publishing</code> block which throws deprecation warnings when i run any Gradle commands.
  Also including the <code>maven-publish</code> plugin without any <code>publishing</code> block causes the same warnings.</p>
  
  <pre><code>repositories {
      mavenLocal()
      jcenter()
  }
  
  plugins {
      `maven-publish`
      kotlin("jvm") version("1.3.10")
      id("org.jetbrains.dokka") version "0.9.16"
  }
  </code></pre>
  
  <blockquote>
    <p>As part of making the publishing plugins stable, the 'deferred
    configurable' behavior of the 'publishing {}' block has been
    deprecated. In Gradle 5.0 the
    'enableFeaturePreview('STABLE_PUBLISHING')' flag will be removed and
    the new behavior will become the default. Please add
    'enableFeaturePreview('STABLE_PUBLISHING')' to your settings file and
    do a test run by publishing to a local repository. If all artifacts
    are published as expected, there is nothing else to do. If the
    published artifacts change unexpectedly, please see the migration
    guide for more details:
    <a href="https://docs.gradle.org/4.10.2/userguide/publishing_maven.html#publishing_maven:deferred_configuration" rel="nofollow noreferrer">https://docs.gradle.org/4.10.2/userguide/publishing_maven.html#publishing_maven:deferred_configuration</a>.</p>
  </blockquote>
  
  <p>If it actually published to maven-local, i might have ignored the warning for now, but it's not publishing at all, neither does <code>gradle publishToMavenLocal</code>, it simply says <code>BUILD SUCCESSFUL in __s</code> with the above warning.</p>
  
  <p>Trying the recommended route (according to the link) of adding the <code>publishing</code> block inside a <code>subprojects</code> block causes lots of red in intellij</p>
  
  <p><a href="https://i.stack.imgur.com/dOwBr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dOwBr.png" alt="enter image description here"></a></p>
  
  <p>Not sure if that's Kotlin DSL or not ... trying something else that was shown on the Kotlin DSL version of the Gradle Docs:</p>
  
  <p><a href="https://i.stack.imgur.com/QF8Zd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QF8Zd.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/a9AIn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/a9AIn.png" alt="enter image description here"></a></p>
  
  <p>Any idea what i'm missing?</p>
  
  <p>Here's my Gradle version and other relevant info (IntelliJ has Kotlin 3.1.0)</p>
  
  <pre><code>gradle -version
  
  ------------------------------------------------------------
  Gradle 4.10.2
  ------------------------------------------------------------
  
  Build time:   2018-09-19 18:10:15 UTC
  Revision:     b4d8d5d170bb4ba516e88d7fe5647e2323d791dd
  
  Kotlin DSL:   1.0-rc-6
  Kotlin:       1.2.61
  Groovy:       2.4.15
  Ant:          Apache Ant(TM) version 1.9.11 compiled on March 23 2018
  JVM:          1.8.0_151 (Oracle Corporation 25.151-b12)
  OS:           Mac OS X 10.14.1 x86_64
  </code></pre>