title: Deploying a gradle app to Heroku
body: <p>I am learning how to use Heroku and i'm trying to deploy my gradle application. I don't know how to solve the problem. </p>
  
  <p>Here is my configuration.</p>
  
  <p><strong>system.properties</strong></p>
  
  <pre><code>java.runtime.version=1.7
  </code></pre>
  
  <p><strong>build.gradle</strong></p>
  
  <pre><code>...
  task wrapper(type: Wrapper) {
      gradleVersion = '1.6'
  }
  
  task stage(type: Copy, dependsOn: [clean, build]) {
      from jar.archivePath
      into project.rootDir 
      rename {
          'app.jar'
      }
  }
  stage.mustRunAfter(clean)
  
  clean &lt;&lt; {
      project.file('app.jar').delete()
  }
  </code></pre>
  
  <p><strong>Procfile</strong></p>
  
  <pre><code>web: java -Dserver.port=$PORT -jar app.jar
  </code></pre>
  
  <p><strong>Error message</strong></p>
  
  <pre><code>remote: -----&gt; Gradle app detected
  remote: -----&gt; Installing OpenJDK 1.7... done
  remote: -----&gt; Building Gradle app...
  remote:        WARNING: The Gradle buildpack is currently in Beta.
  remote: -----&gt; executing ./gradlew stage
  remote:        Error: Could not find or load main class     org.gradle.wrapper.GradleWrapperMain
  remote:  !     Failed to build app
  remote: 
  remote:  !     Push rejected, failed to compile Gradle app
  </code></pre>
  
  <p>I have the wrapper in git.
  I have no idea why it doesn't work.
  Thanks for your help.</p>