Spring Boot useTestClasspath throws CannotLoadBeanClassException and ClassNotFoundException
<p>I have a maven project with a test class located at <code>src/test/java/MyDevClass</code> which is intended for development/testing purposes only. I would like to use it when I start <a href="http://docs.spring.io/spring-boot/docs/current/maven-plugin/run-mojo.html" rel="noreferrer">spring-boot-maven-plugin</a> with the command line <code>mvn spring-boot:run</code>.</p>

<p>So, my <code>pom.xml</code> contains:</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;configuration&gt;
                &lt;!-- TODO: Will create a maven profile and have useTestClasspath only for development/testing --&gt;
                &lt;useTestClasspath&gt;true&lt;/useTestClasspath&gt;
            &lt;/configuration&gt;
        &lt;/plugin&gt;
    &lt;/plugins&gt;
&lt;/build&gt;
</code></pre>

<p>But, I get the following error:</p>

<pre><code>org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [MyDevClass]
Caused by: java.lang.ClassNotFoundException: MyDevClass
</code></pre>

<p>Intriguing enough, I have another project using <a href="http://tomcat.apache.org/maven-plugin-2.1/tomcat7-maven-plugin/plugin-info.html" rel="noreferrer">tomcat7-maven-plugin</a> and it works fine:</p>

<pre><code>        &lt;plugin&gt;
            &lt;groupId&gt;org.apache.tomcat.maven&lt;/groupId&gt;
            &lt;artifactId&gt;tomcat7-maven-plugin&lt;/artifactId&gt;
            &lt;version&gt;2.0&lt;/version&gt;
            &lt;configuration&gt;
                &lt;useTestClasspath&gt;true&lt;/useTestClasspath&gt;
            &lt;/configuration&gt;
        &lt;/plugin&gt;
</code></pre>

<p><strong><em>What I am missing?</em></strong></p>