title: Gradle error with lack of mainClassName property in gradle build
body: <p>I have graddle configuration with two subprojects and when I want do <em>build</em> the project the following error is thrown:</p>
  
  <pre><code>Executing external task 'build'...
  :core:compileJava
  :core:processResources UP-TO-DATE
  :core:classes
  :core:jar
  :core:startScripts FAILED
  
  FAILURE: Build failed with an exception.
  
  * What went wrong:
  A problem was found with the configuration of task ':core:startScripts'.
  &gt; No value has been specified for property 'mainClassName'.
  </code></pre>
  
  <p>My configuration:
  ROOT - build.gradle:</p>
  
  <pre><code>subprojects {
  
      apply plugin: 'java'
      apply plugin: 'application'
  
      group = 'pl.morecraft.dev.morepianer'
  
      repositories {
          mavenLocal()
          mavenCentral()
      }
  
      run {
          main = project.getProperty('mainClassName')
      }
  
      jar {
          manifest {
              attributes 'Implementation-Title': project.getProperty('name'),
                      'Implementation-Version': project.getProperty('version'),
                      'Main-Class': project.getProperty('mainClassName')
          }
      }
  
  }
  
  task copyJars(type: Copy, dependsOn: subprojects.jar) {
      from(subprojects.jar)
      into project.file('/jars')
  }
  </code></pre>
  
  <p>ROOT - setting.gradle:</p>
  
  <pre><code>include 'app'
  include 'core'
  </code></pre>
  
  <p>APP PROJECT - build.gradle:</p>
  
  <p><code>EMPTY</code></p>
  
  <p>CORE PROJECT - build.gradle:</p>
  
  <pre><code>dependencies {
      compile 'com.google.dagger:dagger:2.4'
      compile 'com.google.dagger:dagger-compiler:2.4'
  }
  </code></pre>
  
  <p>AND BOTH SUBPROJECTS (SIMILAR) - gradle.properties:</p>
  
  <pre><code>version = 0.1-SNAPSHOT
  name = MorePianer Core Lib
  mainClassName = pl.morecraft.dev.morepianer.core.Core
  </code></pre>
  
  <p>I've tried to add the mainClassName property in many places, but it does not work. This is even stranger, that It worked a couple days ago as it is. I'm using gradle for first time and I'm thinking about switching back to maven.</p>