title: Maven/Spring not running jmeter tests correctly
body: <p>I'm trying to execute jmeter performance tests automatically for a spring application.</p>
  
  <p>If I run the application and then execute the jmeter tests after everything works perfectly fine.</p>
  
  <p>But if I run <code>mvn -e -X verify</code> without starting the application separately then this happens:</p>
  
  <pre><code>2016-12-20 14:01:17.303  INFO 2024 --- [lication.main()] com.nttdata.iam.Application              : Started Application in 12.102 seconds (JVM running for 31.259)
  [DEBUG] Spring application is not ready yet, waiting 500ms (attempt 26)
  [DEBUG] Spring application is not ready yet, waiting 500ms (attempt 27)
  </code></pre>
  
  <p>which leads to </p>
  
  <pre><code>[INFO] ------------------------------------------------------------------------
  [ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.4.2.RELEASE:start (start-app-before-jmeter) on project iam-demo-microservice: Spring application did not start before the configured timeout (30000ms -&gt; [Help 1]
  org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.4.2.RELEASE:start (start-app-before-jmeter) on project iam-demo-microservice: Spring application did not start before the configured timeout (30000ms
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
      at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
      at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
      at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
      at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
      at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
  Caused by: org.apache.maven.plugin.MojoExecutionException: Spring application did not start before the configured timeout (30000ms
      at org.springframework.boot.maven.StartMojo.waitForSpringApplication(StartMojo.java:176)
      at org.springframework.boot.maven.StartMojo.runWithMavenJvm(StartMojo.java:150)
      at org.springframework.boot.maven.AbstractRunMojo.run(AbstractRunMojo.java:234)
      at org.springframework.boot.maven.AbstractRunMojo.execute(AbstractRunMojo.java:170)
      at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
      ... 20 more
  [ERROR] 
  [ERROR] 
  [ERROR] For more information about the errors and possible solutions, please read the following articles:
  [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
  2016-12-20 15:17:38.820  INFO 1284 --- [       Thread-5] ationConfigEmbeddedWebApplicationContext : Closing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@5fa74304: startup date [Tue Dec 20 15:17:08 CET 2016]; root of context hierarchy
  2016-12-20 15:17:38.820  INFO 1284 --- [       Thread-5] o.s.j.e.a.AnnotationMBeanExporter        : Unregistering JMX-exposed beans on shutdown
  2016-12-20 15:17:38.820  INFO 1284 --- [       Thread-5] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
  </code></pre>
  
  <p>I've been googling and trying to figure it out for a while now and I am stumped why it doesn't work.</p>
  
  <p>The build part of my pom.xml: </p>
  
  <pre><code>&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;id&gt;start-app-before-jmeter&lt;/id&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;start&lt;/goal&gt;
                      &lt;/goals&gt;
                      &lt;phase&gt;pre-integration-test&lt;/phase&gt;
                      &lt;configuration&gt;
                          &lt;fork&gt;false&lt;/fork&gt;
                      &lt;/configuration&gt;
                  &lt;/execution&gt;
                  &lt;execution&gt;
                      &lt;id&gt;post-integration-test&lt;/id&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;stop&lt;/goal&gt;
                      &lt;/goals&gt;
                      &lt;phase&gt;post-integration-test&lt;/phase&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
          &lt;/plugin&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;com.lazerycode.jmeter&lt;/groupId&gt;
              &lt;artifactId&gt;jmeter-maven-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.0.3&lt;/version&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;id&gt;jmeter-tests&lt;/id&gt;
                      &lt;phase&gt;integration-test&lt;/phase&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;jmeter&lt;/goal&gt;
                      &lt;/goals&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
              &lt;configuration&gt;
                  &lt;testResultsTimestamp&gt;false&lt;/testResultsTimestamp&gt;
                  &lt;testFilesIncluded&gt;
                      &lt;jMeterTestFile&gt;SimpleCustomerTestPlan.jmx&lt;/jMeterTestFile&gt;
                  &lt;/testFilesIncluded&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  </code></pre>