I have a Maven based Spring Boot project with 2 Application classes. One is my main Spring Boot app, the other is a standalone example app. When attempting to build with ‘mvn package’ I get this error:
[ERROR] Failed to execute goal [32morg.springframework.boot:spring-boot-maven-plugin:2.6.4:repackage[m [1m(repackage)[m on project [example-client[m: [1;31mExecution repackage of goal org.springframework.boot:spring-boot-maven-plugin:2.6.4:repackage failed: Unable to find a single main class from the following candidates [kh.aprs.botexample.APRSISBotExampleApplication, kh.aprs.clientexample.APRSISClientExampleApplication]
The 2 apps listed are my 2 apps, but only APRSISBotExampleApplication is the one I want to get packaged, so I need to tell Maven which is the the main app. This is configured with the <start-class> property, configured in a properties section like this:
<properties>
<start-class>your.package.YourApplication</start-class>
</properties>
This is described here.