title: Heroku jar deployment of Spring Boot with Maven Application giving code=H10
body: <p>I'm receiving the code error H10 for my deploy, when i try to access it.
  I read that this happens because i have to set a dynamic port to the application.
  I've tried all the configurations presented on Heroku's devcenter but with no lucky.</p>
  
  <p>Here is my pom.xml:</p>
  
  <pre><code>`   
  
  
  &lt;groupId&gt;dogbook&lt;/groupId&gt;
          &lt;artifactId&gt;dog-book&lt;/artifactId&gt;
          &lt;version&gt;1.0&lt;/version&gt;
          &lt;packaging&gt;jar&lt;/packaging&gt;
  
          &lt;name&gt;dog-book&lt;/name&gt;
          &lt;description&gt;Dog Book Backend&lt;/description&gt;
  
          &lt;parent&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
              &lt;version&gt;1.5.4.RELEASE&lt;/version&gt;
              &lt;relativePath /&gt;
          &lt;/parent&gt;
  
          &lt;properties&gt;
              &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
              &lt;project.reporting.outputEncoding&gt;UTF-8&lt;/project.reporting.outputEncoding&gt;
              &lt;java.version&gt;1.8&lt;/java.version&gt;
              &lt;start-class&gt;br.dogbook.Application&lt;/start-class&gt;
              &lt;full-artifact-name&gt;target/${project.artifactId}-${project.version}.jar&lt;/full-artifact-name&gt;
          &lt;/properties&gt;
  
          &lt;dependencies&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-boot-starter-actuator&lt;/artifactId&gt;
              &lt;/dependency&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
              &lt;/dependency&gt;
  
              &lt;dependency&gt;
                  &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
                  &lt;scope&gt;test&lt;/scope&gt;
              &lt;/dependency&gt;
  
              &lt;dependency&gt;
                  &lt;groupId&gt;io.jsonwebtoken&lt;/groupId&gt;
                  &lt;artifactId&gt;jjwt&lt;/artifactId&gt;
                  &lt;version&gt;0.7.0&lt;/version&gt;
              &lt;/dependency&gt;
  
              &lt;dependency&gt;
                  &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-boot-devtools&lt;/artifactId&gt;
                  &lt;optional&gt;true&lt;/optional&gt;
              &lt;/dependency&gt;
  
              &lt;dependency&gt;
                  &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
                  &lt;artifactId&gt;resteasy-jackson-provider&lt;/artifactId&gt;
                  &lt;version&gt;1.1.GA&lt;/version&gt;
                  &lt;scope&gt;compile&lt;/scope&gt;
              &lt;/dependency&gt;
  
          &lt;/dependencies&gt;
  
          &lt;build&gt;
              &lt;plugins&gt;
                  &lt;plugin&gt;
                      &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                      &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
                      &lt;executions&gt;
                          &lt;execution&gt;
                              &lt;goals&gt;
                                  &lt;goal&gt;build-info&lt;/goal&gt;
                              &lt;/goals&gt;
                          &lt;/execution&gt;
                      &lt;/executions&gt;
                  &lt;/plugin&gt;
                  &lt;plugin&gt;
                      &lt;groupId&gt;pl.project13.maven&lt;/groupId&gt;
                      &lt;artifactId&gt;git-commit-id-plugin&lt;/artifactId&gt;
                      &lt;configuration&gt;
                          &lt;dotGitDirectory&gt;../.git&lt;/dotGitDirectory&gt;
                      &lt;/configuration&gt;
                  &lt;/plugin&gt;
  
                  &lt;plugin&gt;
                  &lt;groupId&gt;com.heroku.sdk&lt;/groupId&gt;
                  &lt;artifactId&gt;heroku-maven-plugin&lt;/artifactId&gt;
                  &lt;version&gt;1.2.2&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;appName&gt;dog-book&lt;/appName&gt;
                      &lt;includeTarget&gt;false&lt;/includeTarget&gt;
                      &lt;includes&gt;
                          &lt;include&gt;${basedir}/${full-artifact-name}&lt;/include&gt;
                      &lt;/includes&gt;
                      &lt;jdkVersion&gt;1.8&lt;/jdkVersion&gt;
                      &lt;processTypes&gt;
                          &lt;web&gt;java $JAVA_OPTS -jar ${full-artifact-name}&lt;/web&gt;
                      &lt;/processTypes&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
                  &lt;plugin&gt;
                      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                      &lt;artifactId&gt;maven-dependency-plugin&lt;/artifactId&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.3&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;
  `
  </code></pre>
  
  <p>And my main/resources/application.yml:</p>
  
  <pre><code>`
  server:
     port: 8080
  
  ---
    spring:
       profiles: heroku
    server:
      port: ${PORT}
  `
  </code></pre>
  
  <p>That's the complete error: (UPDATED)</p>
  
  <pre><code>`
  
  2017-10-25T04:22:38.012290+00:00 heroku[web.1]: State changed from starting to crashed
      2017-10-25T09:51:04.226590+00:00 heroku[web.1]: State changed from crashed to starting
      2017-10-25T09:51:06.553784+00:00 heroku[web.1]: Starting process with command `java -Dserver.port=44562 -jar target/dog-book-1.0.jar`
      2017-10-25T09:51:07.883843+00:00 app[web.1]: Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them.
      2017-10-25T09:51:07.884774+00:00 app[web.1]: Error: Unable to access jarfile target/dog-book-1.0.jar
      2017-10-25T09:51:07.966920+00:00 heroku[web.1]: State changed from starting to crashed
      2017-10-25T09:51:07.954716+00:00 heroku[web.1]: Process exited with status 1
      2017-10-25T10:50:16.461375+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=dog-book.herokuapp.com request_id=945fe406-6784-4a03-8ec3-cd997da8b023 fwd="189.34.55.2" dyno= connect= service= status=503 bytes= protocol=https
      2017-10-25T10:50:17.185622+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=dog-book.herokuapp.com request_id=01ce7010-cd8d-49f1-a039-f628f0e8e829 fwd="189.34.55.2" dyno= connect= service= status=503 bytes= protocol=https
      2017-10-25T11:02:09.761721+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=dog-book.herokuapp.com request_id=035c33ce-0340-4695-9c46-0f825bf20a24 fwd="189.34.55.2" dyno= connect= service= status=503 bytes= protocol=https
      2017-10-25T11:02:10.575906+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=dog-book.herokuapp.com request_id=a52d39bb-f402-4fec-b2f4-9c6888893706 fwd="189.34.55.2" dyno= connect= service= status=503 bytes= protocol=https
  </code></pre>
  
  <p>`</p>
  
  <p>I've already configured the Procfile with no extension as well.</p>
  
  <p><code>web: $JAVA_OPTS -Dserver.port=$PORT -jar target/dog-book-1.0.jar</code> </p>
  
  <p>And still the same.</p>
  
  <p>Any ideas ?</p>