I have a maven project with a test class located in src/test/java/MyDevClasswhich is for development / testing purposes only. I would like to use it when I run spring-boot-maven-plugin with the command line mvn spring-boot:run.
So my pom.xmlcontains:
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<useTestClasspath>true</useTestClasspath>
</configuration>
</plugin>
</plugins>
</build>
But I get the following error:
org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [MyDevClass]
Caused by: java.lang.ClassNotFoundException: MyDevClass
Interestingly, I have another project using tomcat7-maven-plugin and it works fine:
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.0</version>
<configuration>
<useTestClasspath>true</useTestClasspath>
</configuration>
</plugin>
What am I missing?
source
share