小编典典

Spring Boot程序找不到主类

spring-boot

我有一个程序在Eclipse中作为Spring boot App运行。该程序运行良好。然后我做了以下工作:

右键单击项目->运行方式-> Maven测试。

这是偶然的。然后,当我尝试再次将该程序作为Spring Boot应用程序运行时,它在下面抛出了以下错误。

Error: Could not find or load main class com.bt.collab.alu.api.webapp.Application

如何将应用程序指向主类?谢谢


阅读 548

收藏
2020-05-30

共1个答案

小编典典

主类可在pom.xml中配置

<properties>
    <start-class>com.bt.collab.alu.api.webapp.Application</start-class>
</properties>
2020-05-30