title: Heroku can't find webapp-runner.jar
body: <p>I've got a Spring web app which I want to deploy to Heroku. Here's the pom.xml:</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt;
  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
  ...
  
  &lt;dependencies&gt;
  
      ...(spring, hibernate, junit, freemarker)
  
  &lt;/dependencies&gt;
  
  &lt;build&gt;
  
      &lt;!-- static final name for easy integration with IDEs --&gt;
      &lt;finalName&gt;web-app&lt;/finalName&gt;
  
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
              &lt;version&gt;3.6.0&lt;/version&gt;
  
              &lt;configuration&gt;
                  &lt;source&gt;1.8&lt;/source&gt;
                  &lt;target&gt;1.8&lt;/target&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
  
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.3&lt;/version&gt;
  
              &lt;configuration&gt;
                  &lt;warSourceDirectory&gt;web&lt;/warSourceDirectory&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
  
          &lt;!-- webapp-runner.jar for running the app --&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-dependency-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.8&lt;/version&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;phase&gt;package&lt;/phase&gt;
                      &lt;goals&gt;&lt;goal&gt;copy&lt;/goal&gt;&lt;/goals&gt;
                      &lt;configuration&gt;
                          &lt;artifactItems&gt;
                              &lt;artifactItem&gt;
                                  &lt;groupId&gt;com.github.jsimone&lt;/groupId&gt;
                                  &lt;artifactId&gt;webapp-runner&lt;/artifactId&gt;
                                  &lt;version&gt;8.5.11.2&lt;/version&gt;
                                  &lt;destFileName&gt;webapp-runner.jar&lt;/destFileName&gt;
                              &lt;/artifactItem&gt;
                          &lt;/artifactItems&gt;
                      &lt;/configuration&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
          &lt;/plugin&gt;
  
  
      &lt;/plugins&gt;
  &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>Here is the Procfile in project root directory:</p>
  
  <pre><code>web:    java $JAVA_OPTS -jar target/dependency/webapp-runner.jar --port $PORT target/*.war
  </code></pre>
  
  <p>Everything is fine locally, and I successfully push it to heroku. Git output:</p>
  
  <pre><code>remote: Compressing source files... done.        
  remote: Building source:        
  remote: 
  remote: -----&gt; JVM Common app detected        
  remote: -----&gt; Installing OpenJDK 1.8... done        
  remote: -----&gt; Discovering process types        
  remote:        Procfile declares types -&gt; web        
  remote: 
  remote: -----&gt; Compressing...        
  remote:        Done: 49.1M        
  remote: -----&gt; Launching...        
  ...
  remote: Verifying deploy... done.        
  </code></pre>
  
  <p>But then heroku logs tells me:</p>
  
  <pre><code>Error: Unable to access jarfile target/dependency/webapp-runner.jar
  </code></pre>
  
  <p>I tried to clean and run the exact command in the Procfile, and everything went just fine on my local machine. So what can be a problem here?</p>