Spring Boot – Which main class to start

Spring Boot project contains multiple main classes; If you try tro run, it will fail to start or package for deployment with the below error message

How to fix this using Maven?

pom.xml

  1.      Define the main class in <start-class> under properties
Or

2.     Define the main class in <mainClass> under configurartion in the spring-boot-maven-plugin

 

 

harinathk
 

Click Here to Leave a Comment Below 0 comments