title: Gradle build failed: Main class name has not been configured and it could not be resolved
body: <p>I am building a RESTful web service with Spring by following <a href="https://spring.io/guides/gs/rest-service/" rel="noreferrer">this</a> guide. I am using grable to build the app but my build is failing.</p>
  
  <p>I used the "build gradle" command on a Windows 10 machine.</p>
  
  <p>This is the gradle code:</p>
  
  <pre><code>buildscript {
      repositories {
          mavenCentral()
      }
      dependencies {
          classpath("org.springframework.boot:spring-boot-gradle-plugin:2.1.6.RELEASE")
      }
  }
  
  apply plugin: 'java'
  apply plugin: 'eclipse'
  apply plugin: 'idea'
  apply plugin: 'org.springframework.boot'
  apply plugin: 'io.spring.dependency-management'
  
  bootJar {
      baseName = 'gs-rest-service'
      version =  '0.1.0'
  }
  
  repositories {
      mavenCentral()
  }
  
  sourceCompatibility = 1.8
  targetCompatibility = 1.8
  
  dependencies {
      compile("org.springframework.boot:spring-boot-starter-web")
      testCompile('org.springframework.boot:spring-boot-starter-test')
  }
  </code></pre>
  
  <p>I am getting the following error:</p>
  
  <p>Execution failed for task ':bootJar'.</p>
  
  <blockquote>
    <p>Main class name has not been configured and it could not be resolved</p>
  </blockquote>