title: gradle unable to deduce layout error
body: <p>I am getting the following error when building a sprint boot based project using Gradle.   I tried building with --debug option but that resulted in the same error and no further insights.</p>
  
  <hr>
  
  <pre><code>:clean
  :compileJava
  :processResources
  Copy over the Env properties
  Copy env properties from src/main/resources to C:\project-portal\build/resources/main/local.application.properties
  :classes
  :findMainClass
  :war
  Creating exploded war file :: C:\project-portal\build/project-portal
  :bootRepackage FAILED
  </code></pre>
  
  <p>FAILURE: Build failed with an exception.</p>
  
  <ul>
  <li>What went wrong:
  Execution failed for task ':bootRepackage'.
  
  <blockquote>
    <p>Unable to deduce layout for 'C:\project-portal\build\libs\project-portal'</p>
  </blockquote></li>
  </ul>
  
  <p>What does it mean by 'Unable to deduce layout'?   Thanks!</p>
  
  <p>Update #1 to include the build.gradle:  </p>
  
  <pre><code>&lt;pre&gt;
  buildscript {
      repositories {
          mavenCentral()
      }
      dependencies {
          classpath("org.springframework.boot:spring-boot-gradle-plugin:1.3.2.RELEASE")
      }
  }
  
  apply plugin: 'java'
  apply plugin: 'eclipse'
  apply plugin: 'idea'
  apply plugin: 'spring-boot'
  apply plugin: 'war'
  
  def deployDir = ""
  def configDir=""
  
  def appWarName = "project-portal"
  
  configurations.create('myConfiguration')
  
  configurations.myConfiguration  {
      if("$appEnv"=='local') {
          configDir=localConfigDir
          deployDir=localDeployDir
      } else if("$appEnv"=='uat') {
          configDir=uatConfigDir
          deployDir=uatDeployDir
      }
      println "Config Dir :: $configDir"
      println "Deploy Dir :: $deployDir"
  }
  
  
  processResources {
      doLast {
          println "Copy over the Env properties"
          copy {
              println "Copy env properties from src/main/resources to $buildDir/resources/main/${appEnv}.application.properties"
              from "src/main/resources/${appEnv}.application.properties"
              into "$buildDir/resources/main/"
              rename { filename -&gt; filename.replace "${appEnv}.application.properties", 'application.properties'}
          }
      }
  }
  
  springBoot {
      mainClass= "com.company.Application"
  }
  
  bootRepackage {
      mainClass = 'com.company.Application'
  }
  
  jar {
      baseName = 'project-portal'
      version =  ''
      exclude('src/main/resources/*.properties')
  }
  
  repositories {
      mavenCentral()
  }
  
  sourceCompatibility = 1.7
  targetCompatibility = 1.7
  
  dependencies {
      //compile("org.springframework.boot:spring-boot-starter-parent")
      //compile("org.springframework.boot:spring-boot-starter")
      compile("org.springframework.boot:spring-boot-starter-web")
      providedRuntime 'org.springframework.boot:spring-boot-starter-tomcat'
  
      testCompile("junit:junit")
      testCompile("org.springframework.boot:spring-boot-starter-test")
  
      //hibernate
      //compile 'org.eclipse.persistence:javax.persistence:2.1.0'
      compile 'org.hibernate:hibernate-entitymanager:4.3.8.Final'
      compile 'org.hibernate:hibernate-core:4.3.8.Final'
      compile 'org.jboss.logging:jboss-logging:3.2.1.Final'
      compile 'org.springframework.data:spring-data-jpa'
  
      //Security
      compile("org.springframework.boot:spring-boot-starter-security")
  
      compile 'mysql:mysql-connector-java:5.1.34'
  
      //After bug
      compile 'aspectj:aspectjweaver:1.5.4'
  
  }
  
  task wrapper(type: Wrapper) {
      gradleVersion = '2.9-rc-1'
  }
  
  war {
      archiveName="$appWarName"
      doLast {
          println "Creating exploded war file :: $buildDir/$appWarName"
          ant.unzip(src: war.archivePath, dest: "$buildDir/$appWarName")
      }
  }
  
  task copyJar(type: Copy) {
       println "Copy lib to $buildDir/lib"
       it.dependsOn jar
       from "$buildDir/libs"
       into "$buildDir/web"
  }
  
  task deployApp(type: Copy) {
       println "Copy dependencyJar to $buildDir"
       it.dependsOn copyJar
       it.dependsOn war
       from "$buildDir/$appWarName/WEB-INF/lib"
       into "$buildDir/externalJars"
       from "$buildDir/libs"
       into "$buildDir/externalJars"
       from "$buildDir/$appWarName"
       into "$deployDir/$appWarName"
  }
  
  &lt;/pre&gt; 
  </code></pre>