title: Spring and Gradle build: No such property: mainClassName for class: org.gradle.api.internal.project.DefaultProject_Decorated
body: <p>I have Spring Boot 1.1 and 1.3 project and occasionally during changes of <code>build.gradle</code> I got error</p>
  
  <blockquote>
    <p>No such property: mainClassName for class: </p>
    
    <p>FAILURE: Build failed with an exception.</p>
    
    <ul>
    <li><p>Where: Build file ... line: 43</p></li>
    <li><p>What went wrong: A problem occurred evaluating root project '...'.</p>
    
    <blockquote>
      <p>No such property: mainClassName for class: org.gradle.api.internal.project.DefaultProject_Decorated</p>
    </blockquote></li>
    </ul>
  </blockquote>
  
  <p>build.gradle</p>
  
  <pre><code>buildscript {
      repositories {
          jcenter()
          mavenCentral()
          maven {
              url 'https://plugins.gradle.org/m2/'
          }
      }
  
      dependencies {
          ...
          classpath 'org.springframework.boot:spring-boot-gradle-plugin:1.3.5.RELEASE' //1.1.7.RELEASE'
          ...
      }
  }
  
  // Application Plugins
  apply plugin: 'java'
  apply plugin: 'spring-boot'
  </code></pre>
  
  <p>Line 43 is <code>mainClassName = 'com....Main'</code></p>