title: Issue when deploying Vaadin 14 app on Heroku
body: <p>I have a problem when deploying Vaadin 14 app (Spring Boot) on Heroku. This is Heroku logs:</p>
  
  <pre><code>2019-10-23T19:34:19.005415+00:00 app[web.1]: 2019-10-23 19:34:19.004 ERROR 4 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]
       : Exception sending context initialized event to listener instance of class [com.vaadin.flow.spring.VaadinServletContextInitialize
  r$DevModeServletContextListener]
  2019-10-23T19:34:19.005427+00:00 app[web.1]:
  2019-10-23T19:34:19.005432+00:00 app[web.1]: java.lang.IllegalStateException: Running project in development mode with no access to fol
  der '/tmp/build_1eb1799fb4903b1c64716231dcb4a093'.
  2019-10-23T19:34:19.005435+00:00 app[web.1]: Build project in production mode instead, see https://vaadin.com/docs/v14/flow/production/
  tutorial-production-mode-basic.html
  2019-10-23T19:34:19.005436+00:00 app[web.1]: at com.vaadin.flow.server.DeploymentConfigurationFactory.verifyFolderExists(DeploymentConf
  igurationFactory.java:283) ~[flow-server-2.0.14.jar!/:2.0.14]
  2019-10-23T19:34:19.005438+00:00 app[web.1]: at com.vaadin.flow.server.DeploymentConfigurationFactory.readBuildInfo(DeploymentConfigura
  tionFactory.java:222) ~[flow-server-2.0.14.jar!/:2.0.14]
  2019-10-23T19:34:19.005439+00:00 app[web.1]: at com.vaadin.flow.server.DeploymentConfigurationFactory.createInitParameters(DeploymentCo
  nfigurationFactory.java:166) ~[flow-server-2.0.14.jar!/:2.0.14]
  2019-10-23T19:34:19.005441+00:00 app[web.1]: at com.vaadin.flow.server.DeploymentConfigurationFactory.createPropertyDeploymentConfigura
  tion(DeploymentConfigurationFactory.java:126) ~[flow-server-2.0.14.jar!/:2.0.14]
  2019-10-23T19:34:19.005445+00:00 app[web.1]: at com.vaadin.flow.spring.VaadinServletContextInitializer$SpringStubServletConfig.createDe
  ploymentConfiguration(VaadinServletContextInitializer.java:747) ~[vaadin-spring-12.0.6.jar!/:na]
  2019-10-23T19:34:19.005447+00:00 app[web.1]: at com.vaadin.flow.spring.VaadinServletContextInitializer$DevModeServletContextListener.co
  ntextInitialized(VaadinServletContextInitializer.java:289) ~[vaadin-spring-12.0.6.jar!/:na]
  2019-10-23T19:34:19.005449+00:00 app[web.1]: at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4680) [tomc
  at-embed-core-9.0.22.jar!/:9.0.22]
  2019-10-23T19:34:19.00545+00:00 app[web.1]: at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5143) [tomca
  t-embed-core-9.0.22.jar!/:9.0.22]
  2019-10-23T19:34:19.005451+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [tomcat-embed-core
  -9.0.22.jar!/:9.0.22]
  2019-10-23T19:34:19.005452+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384) [tomcat
  -embed-core-9.0.22.jar!/:9.0.22]
  2019-10-23T19:34:19.005454+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374) [tomcat
  -embed-core-9.0.22.jar!/:9.0.22]
  2019-10-23T19:34:19.005456+00:00 app[web.1]: at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_222-heroku]
  2019-10-23T19:34:19.005457+00:00 app[web.1]: at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java
  :75) [tomcat-embed-core-9.0.22.jar!/:9.0.22]
  2019-10-23T19:34:19.005458+00:00 app[web.1]: at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134) [
  na:1.8.0_222-heroku]
  2019-10-23T19:34:19.00546+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909) [tomcat-emb
  ed-core-9.0.22.jar!/:9.0.22]
  2019-10-23T19:34:19.005461+00:00 app[web.1]: at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:841) [tomcat-embe
  d-core-9.0.22.jar!/:9.0.22]
  2019-10-23T19:34:19.005462+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [tomcat-embed-core
  -9.0.22.jar!/:9.0.22]
  2019-10-23T19:34:19.005464+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384) [tomcat
  -embed-core-9.0.22.jar!/:9.0.22]
  2019-10-23T19:34:19.005465+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374) [tomcat
  -embed-core-9.0.22.jar!/:9.0.22]
  2019-10-23T19:34:19.005466+00:00 app[web.1]: at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_222-heroku]
  2019-10-23T19:34:19.005467+00:00 app[web.1]: at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java
  :75) [tomcat-embed-core-9.0.22.jar!/:9.0.22]
  2019-10-23T19:34:19.005469+00:00 app[web.1]: at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134) [
  na:1.8.0_222-heroku]
  2019-10-23T19:34:19.00547+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909) [tomcat-emb
  ed-core-9.0.22.jar!/:9.0.22]
  2019-10-23T19:34:19.005472+00:00 app[web.1]: at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262) [tomcat-
  embed-core-9.0.22.jar!/:9.0.22]
  2019-10-23T19:34:19.005473+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [tomcat-embed-core
  -9.0.22.jar!/:9.0.22]
  2019-10-23T19:34:19.005474+00:00 app[web.1]: at org.apache.catalina.core.StandardService.startInternal(StandardService.java:421) [tomca
  t-embed-core-9.0.22.jar!/:9.0.22]
  2019-10-23T19:34:19.005475+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [tomcat-embed-core
  -9.0.22.jar!/:9.0.22]
  2019-10-23T19:34:19.005485+00:00 app[web.1]: at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:932) [tomcat-
  embed-core-9.0.22.jar!/:9.0.22]
  2019-10-23T19:34:19.005487+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [tomcat-embed-core
  -9.0.22.jar!/:9.0.22]
  </code></pre>
  
  <p>Due to logs the problem is in production mode. But I've set Heroku SPRING_PROFILES_ACTIVE environment variable to production.</p>
  
  <pre><code>heroku config:set SPRING_PROFILES_ACTIVE=production
  </code></pre>
  
  <p>Here is the pom.xml (build and profiles part):</p>
  
  <pre><code>&lt;build&gt;
      &lt;defaultGoal&gt;spring-boot:run&lt;/defaultGoal&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;!-- Clean build and startup time for Vaadin apps sometimes may exceed
                   the default Spring Boot's 30sec timeout.  --&gt;
              &lt;configuration&gt;
                  &lt;wait&gt;500&lt;/wait&gt;
                  &lt;maxAttempts&gt;240&lt;/maxAttempts&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
  
          &lt;!--
              Take care of synchronizing java dependencies and imports in
              package.json and main.js files.
              It also creates webpack.config.js if not exists yet.
          --&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;com.vaadin&lt;/groupId&gt;
              &lt;artifactId&gt;vaadin-maven-plugin&lt;/artifactId&gt;
              &lt;version&gt;${vaadin.version}&lt;/version&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;prepare-frontend&lt;/goal&gt;
                      &lt;/goals&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
          &lt;/plugin&gt;
  
          &lt;plugin&gt;
              &lt;groupId&gt;com.github.eirslett&lt;/groupId&gt;
              &lt;artifactId&gt;frontend-maven-plugin&lt;/artifactId&gt;
              &lt;!-- Use the latest released version:
              https://repo1.maven.org/maven2/com/github/eirslett/frontend-maven-plugin/ --&gt;
              &lt;version&gt;1.8.0&lt;/version&gt;
  
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;!-- optional: you don't really need execution ids, but it looks nice in your build log. --&gt;
                      &lt;id&gt;install node and npm&lt;/id&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;install-node-and-npm&lt;/goal&gt;
                      &lt;/goals&gt;
                      &lt;!-- optional: default phase is "generate-resources" --&gt;
                      &lt;phase&gt;generate-resources&lt;/phase&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
              &lt;configuration&gt;
                  &lt;nodeVersion&gt;v10.16.2&lt;/nodeVersion&gt;
  
                  &lt;!-- optional: with node version greater than 4.0.0 will use npm provided by node distribution --&gt;
                  &lt;!--                    &lt;npmVersion&gt;2.15.9&lt;/npmVersion&gt;--&gt;
  
                  &lt;!-- optional: where to download node and npm from. Defaults to https://nodejs.org/dist/ --&gt;
                  &lt;!--                    &lt;downloadRoot&gt;http://myproxy.example.org/nodejs/&lt;/downloadRoot&gt;--&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  
  &lt;profiles&gt;
      &lt;profile&gt;
          &lt;id&gt;production&lt;/id&gt;
          &lt;properties&gt;
              &lt;vaadin.productionMode&gt;true&lt;/vaadin.productionMode&gt;
          &lt;/properties&gt;
          &lt;dependencies&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;com.vaadin&lt;/groupId&gt;
                  &lt;artifactId&gt;flow-server-production-mode&lt;/artifactId&gt;
              &lt;/dependency&gt;
          &lt;/dependencies&gt;
          &lt;build&gt;
              &lt;plugins&gt;
                  &lt;plugin&gt;
                      &lt;groupId&gt;com.vaadin&lt;/groupId&gt;
                      &lt;artifactId&gt;vaadin-maven-plugin&lt;/artifactId&gt;
                      &lt;version&gt;${vaadin.version}&lt;/version&gt;
                      &lt;executions&gt;
                          &lt;execution&gt;
                              &lt;goals&gt;
                                  &lt;goal&gt;prepare-frontend&lt;/goal&gt;
                                  &lt;goal&gt;build-frontend&lt;/goal&gt;
                              &lt;/goals&gt;
                          &lt;/execution&gt;
                      &lt;/executions&gt;
                  &lt;/plugin&gt;
              &lt;/plugins&gt;
          &lt;/build&gt;
      &lt;/profile&gt;
  &lt;/profiles&gt;
  </code></pre>
  
  <p>What am I doing wrong? I had no such problems deploying Vaadin 13 app on Heroku.</p>
  
  <p><strong>EDIT PROBLEM SOLVED</strong>
  Problem solved by running command </p>
  
  <pre><code>mvn clean package -Pproduction heroku:deploy
  </code></pre>