title: Spring application build failure
body: <p>I am not able to figure out what is wrong while running <strong>mvn spring-boot:run</strong> command. <strong>mvn clean install</strong> gives a build success but for <strong>mvn spring-boot:run</strong> i get a build failure.
  This is my error log in my console when i run <strong>mvn spring-boot:run -X</strong>.</p>
  
  <pre><code>    [WARNING]
      java.lang.reflect.InvocationTargetException
              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.springframework.boot.maven.AbstractRunMojo$LaunchRunner.run(AbstractRunMojo.java:506)
              at java.lang.Thread.run(Thread.java:745)
      Caused by: java.lang.NoClassDefFoundError: org/springframework/core/env/EnvironmentCapable
              at java.lang.ClassLoader.defineClass1(Native Method)
              at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
              at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
              at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
              at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
              at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
              at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
              at java.security.AccessController.doPrivileged(Native Method)
              at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
              at com.example.DemoApplication.main(DemoApplication.java:10)
              ... 6 more
      Caused by: java.lang.ClassNotFoundException: org.springframework.core.env.EnvironmentCapable
              at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
              ... 18 more
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 10.024 s
      [INFO] Finished at: 2016-12-11T15:24:36+05:30
      [INFO] Final Memory: 23M/223M
      [INFO] ------------------------------------------------------------------------
      [ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.4.2.RELEASE:run (default-cli) on project demo: An exception occurred while running. null: InvocationTargetException: org/springframework/core/env/EnvironmentCapable: org.springframework.core.env.EnvironmentCapable -&gt; [Help 1]
      org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.4.2.RELEASE:run (default-cli) on project demo: An exception occurred while running. null
              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: An exception occurred while running. null
              at org.springframework.boot.maven.AbstractRunMojo$IsolatedThreadGroup.rethrowUncaughtException(AbstractRunMojo.java:475)
              at org.springframework.boot.maven.RunMojo.runWithMavenJvm(RunMojo.java:92)
              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
      Caused by: java.lang.reflect.InvocationTargetException
              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.springframework.boot.maven.AbstractRunMojo$LaunchRunner.run(AbstractRunMojo.java:506)
              at java.lang.Thread.run(Thread.java:745)
      Caused by: java.lang.NoClassDefFoundError: org/springframework/core/env/EnvironmentCapable
              at java.lang.ClassLoader.defineClass1(Native Method)
              at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
              at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
              at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
              at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
              at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
              at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
              at java.security.AccessController.doPrivileged(Native Method)
              at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
              at com.example.DemoApplication.main(DemoApplication.java:10)
              ... 6 more
      Caused by: java.lang.ClassNotFoundException: org.springframework.core.env.EnvironmentCapable
              at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
              ... 18 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
  </code></pre>
  
  <p>This is my pom.xml . I have also removed pom.xml from the active maven profiles in eclipse ide, cause it was given as one of the solutions in this link <a href="https://stackoverflow.com/questions/28192761/spring-maven-clean-error-the-requested-profile-pom-xml-could-not-be-activate">Spring Maven clean error - The requested profile &quot;pom.xml&quot; could not be activated because it does not exist</a></p>
  
  <pre><code>      &lt;?xml version="1.0" encoding="UTF-8"?&gt;
        &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/xsd/maven-4.0.0.xsd"&gt;
        &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
        &lt;groupId&gt;com.example&lt;/groupId&gt;
        &lt;artifactId&gt;demo&lt;/artifactId&gt;
        &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
        &lt;packaging&gt;jar&lt;/packaging&gt;
  
        &lt;name&gt;Test&lt;/name&gt;
        &lt;description&gt;Demo project for Spring Boot&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.4.2.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;com.example.DemoApplication&lt;/start-class&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&lt;/artifactId&gt;
            &lt;/dependency&gt;
  
  
        &lt;/dependencies&gt;
  
        &lt;build&gt;
        &lt;pluginManagement&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;!-- &lt;plugin&gt;
                    &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
                    &lt;artifactId&gt;exec-maven-plugin&lt;/artifactId&gt;
                &lt;/plugin&gt;  --&gt;   
            &lt;/plugins&gt;
            &lt;/pluginManagement&gt;
  
        &lt;/build&gt;
        &lt;/project&gt;
  </code></pre>