title: Deploy a SpringBoot / Angular 4 on Google App Engine with maven
body: <p>I try to deploy an application on GoogleCloud (free account at the moment).
  FrontEnd (Angular) and BackEnd (Java/JPA/SpringBoot) are build with maven in a single .jar.</p>
  
  <p>Locally, on my server with Jenkins and with Google Shell : </p>
  
  <blockquote>
    <p>mvn spring-boot:run => <strong>working fine</strong></p>
  </blockquote>
  
  <p>But when i try to deploy</p>
  
  <blockquote>
    <p>mvn appengine:deploy => <strong>502 error</strong></p>
  </blockquote>
  
  <p>Deploy is mark as success. But when i check logs (gcloud app logs tail -s default) SpringBoot deployment seems freezing, restarting, freezing again, ...
  And what's making me crazy... Sometimes it's working ... just few minutes before SpringBoot restarting again. </p>
  
  <p>So, i need some advices to find what's wrong.</p>
  
  <p>Here's my pom.xml</p>
  
  <p>
  https://maven.apache.org/xsd/maven-4.0.0.xsd"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"></p>
  
  <pre><code>&lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
  &lt;artifactId&gt;back-office&lt;/artifactId&gt;
  &lt;name&gt;back-office&lt;/name&gt;
  &lt;description&gt;Back Office&lt;/description&gt;
  
  &lt;parent&gt;
      &lt;groupId&gt;fr.test&lt;/groupId&gt;
      &lt;artifactId&gt;mon-parent&lt;/artifactId&gt;
      &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
  &lt;/parent&gt;
  
  &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-mail&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.thymeleaf&lt;/groupId&gt;
          &lt;artifactId&gt;thymeleaf-spring4&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;nz.net.ultraq.thymeleaf&lt;/groupId&gt;
          &lt;artifactId&gt;thymeleaf-layout-dialect&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;net.sf.jasperreports&lt;/groupId&gt;
          &lt;artifactId&gt;jasperreports&lt;/artifactId&gt;
          &lt;version&gt;6.1.0&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;!-- BOOT --&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;!-- PERSISTENCE --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-data-jpa&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;mysql&lt;/groupId&gt;
          &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;!-- SECURITY --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-security&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.nimbusds&lt;/groupId&gt;
          &lt;artifactId&gt;nimbus-jose-jwt&lt;/artifactId&gt;
          &lt;version&gt;4.39.2&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;joda-time&lt;/groupId&gt;
          &lt;artifactId&gt;joda-time&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;fr.test&lt;/groupId&gt;
          &lt;artifactId&gt;front-office&lt;/artifactId&gt;
          &lt;version&gt;${project.version}&lt;/version&gt;
          &lt;scope&gt;runtime&lt;/scope&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  
  &lt;repositories&gt;
    ....
  &lt;/repositories&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;/plugin&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;com.google.cloud.tools&lt;/groupId&gt;
              &lt;artifactId&gt;appengine-maven-plugin&lt;/artifactId&gt;
              &lt;version&gt;1.3.1&lt;/version&gt;
        &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p></p>
  
  <p>And here's my app.yaml config (in src/main/appengine)</p>
  
  <pre><code># [START runtime]
  runtime: java
  env: flex
  
  handlers:
  - url: /.*
    script: this field is required, but ignored
  
  runtime_config:  # Optional
    jdk: openjdk8
   # server: jetty9
  
  manual_scaling:
    instances: 1
  # [END runtime]
  </code></pre>