title: Spring boot and maven exec plugin issue
body: <p>I've created a bare-bone Maven project, completely empty except the <code>pom.xml</code>.</p>
  
  <p>With this pom (note that <code>parent</code> element is commented-out):</p>
  
  <pre><code>&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;springboot-test&lt;/groupId&gt;
    &lt;artifactId&gt;springboot-test&lt;/artifactId&gt;
    &lt;version&gt;1.0.0-SNAPSHOT&lt;/version&gt;
  
  &lt;!--    &lt;parent&gt; --&gt;
  &lt;!--        &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt; --&gt;
  &lt;!--        &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt; --&gt;
  &lt;!--        &lt;version&gt;1.1.9.RELEASE&lt;/version&gt; --&gt;
  &lt;!--    &lt;/parent&gt; --&gt;
  
    &lt;build&gt;
      &lt;plugins&gt;
        &lt;plugin&gt;
          &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
          &lt;version&gt;3.2&lt;/version&gt;
          &lt;configuration&gt;
            &lt;source&gt;1.7&lt;/source&gt;
            &lt;target&gt;1.7&lt;/target&gt;
          &lt;/configuration&gt;
        &lt;/plugin&gt;
      &lt;/plugins&gt;
    &lt;/build&gt;
  
  &lt;/project&gt;
  </code></pre>
  
  <p>Sample run:</p>
  
  <pre><code>$ mvn exec:java -Dexec.mainClass=test
  [INFO] Scanning for projects...
  [INFO]
  [INFO] ------------------------------------------------------------------------
  [INFO] Building springboot-test 1.0.0-SNAPSHOT
  [INFO] ------------------------------------------------------------------------
  [INFO]
  [INFO] --- exec-maven-plugin:1.3.2:java (default-cli) @ springboot-test ---
  [WARNING] Warning: killAfter is now deprecated. Do you need it ? Please comment on MEXEC-6.
  [WARNING]
  java.lang.ClassNotFoundException: test
          at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
          at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
          at java.security.AccessController.doPrivileged(Native Method)
          at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
          at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:281)
          at java.lang.Thread.run(Thread.java:745)
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD FAILURE
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 0.480 s
  [INFO] Finished at: 2014-12-05T13:45:34-05:00
  [INFO] Final Memory: 8M/176M
  [INFO] ------------------------------------------------------------------------
  [ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.3.2:java (default-cli) on project springboot-test: An exception occured while executing the Java class. test -&gt; [Help 1]
  [ERROR]
  [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
  [ERROR] Re-run Maven using the -X switch to enable full debug logging.
  [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 expected (there's no clas <code>test</code> in this project).</p>
  
  <p>Using this pom (i.e. just un-commenting <code>parent</code>):</p>
  
  <pre><code>&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;springboot-test&lt;/groupId&gt;
    &lt;artifactId&gt;springboot-test&lt;/artifactId&gt;
    &lt;version&gt;1.0.0-SNAPSHOT&lt;/version&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.1.9.RELEASE&lt;/version&gt;
    &lt;/parent&gt;
  
    &lt;build&gt;
      &lt;plugins&gt;
        &lt;plugin&gt;
          &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
          &lt;version&gt;3.2&lt;/version&gt;
          &lt;configuration&gt;
            &lt;source&gt;1.7&lt;/source&gt;
            &lt;target&gt;1.7&lt;/target&gt;
          &lt;/configuration&gt;
        &lt;/plugin&gt;
      &lt;/plugins&gt;
    &lt;/build&gt;
  
  &lt;/project&gt;
  </code></pre>
  
  <p>Sample run:</p>
  
  <pre><code>$ mvn exec:java -Dexec.mainClass=test
  [INFO] Scanning for projects...
  [INFO]
  [INFO] ------------------------------------------------------------------------
  [INFO] Building springboot-test 1.0.0-SNAPSHOT
  [INFO] ------------------------------------------------------------------------
  [INFO]
  [INFO] &gt;&gt;&gt; exec-maven-plugin:1.2.1:java (default-cli) &gt; validate @ springboot-test &gt;&gt;&gt;
  [INFO]
  [INFO] &lt;&lt;&lt; exec-maven-plugin:1.2.1:java (default-cli) &lt; validate @ springboot-test &lt;&lt;&lt;
  [INFO]
  [INFO] --- exec-maven-plugin:1.2.1:java (default-cli) @ springboot-test ---
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD FAILURE
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 0.550 s
  [INFO] Finished at: 2014-12-05T13:45:27-05:00
  [INFO] Final Memory: 12M/178M
  [INFO] ------------------------------------------------------------------------
  [ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:java (default-cli) on project springboot-test: The parameters 'mainClass' for goal org.codehaus.mojo:exec-maven-plugin:1.2.1:java are missing or invalid -&gt; [Help 1]
  [ERROR]
  [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
  [ERROR] Re-run Maven using the -X switch to enable full debug logging.
  [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/PluginParameterException
  </code></pre>
  
  <p>Same thing happens with exec-maven-plugin:1.3.2:</p>
  
  <pre><code>$ mvn org.codehaus.mojo:exec-maven-plugin:1.3.2:java -Dexec.mainClass=test
  [INFO] Scanning for projects...
  [INFO]
  [INFO] ------------------------------------------------------------------------
  [INFO] Building springboot-test 1.0.0-SNAPSHOT
  [INFO] ------------------------------------------------------------------------
  [INFO]
  [INFO] --- exec-maven-plugin:1.3.2:java (default-cli) @ springboot-test ---
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD FAILURE
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 0.400 s
  [INFO] Finished at: 2014-12-05T13:52:46-05:00
  [INFO] Final Memory: 6M/157M
  [INFO] ------------------------------------------------------------------------
  [ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.3.2:java (default-cli) on project springboot-test: The parameters 'mainClass' for goal org.codehaus.mojo:exec-maven-plugin:1.3.2:java are missing or invalid -&gt; [Help 1]
  [ERROR]
  [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
  [ERROR] Re-run Maven using the -X switch to enable full debug logging.
  [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/PluginParameterException
  </code></pre>
  
  <p>Additional information:</p>
  
  <pre><code>$ java -version
  java version "1.8.0_11"
  Java(TM) SE Runtime Environment (build 1.8.0_11-b12)
  Java HotSpot(TM) 64-Bit Server VM (build 25.11-b03, mixed mode)
  $ mvn -v
  Apache Maven 3.2.2 (45f7c06d68e745d05611f7fd14efb6594181933e; 2014-06-17T09:51:42-04:00)
  Maven home: C:\dev\bin\apache-maven-3.2.2
  Java version: 1.8.0_11, vendor: Oracle Corporation
  Java home: C:\progra~1\java\jdk1.8.0_11\jre
  Default locale: en_US, platform encoding: Cp1252
  OS name: "windows 7", version: "6.1", arch: "amd64", family: "dos"
  </code></pre>
  
  <p>Questions:</p>
  
  <ul>
  <li>Why is this failing / how to fix?</li>
  <li>Why is this failing when <code>parent</code> is added? How is <code>exec-maven-plugin</code> influenced by this?</li>
  </ul>
  
  <p>(As a side note, I love the fact that Windows 7 belongs to faimly: "dos", I'm waiting for family: "cp/m" to be implemented for Windows 8.1)</p>