How to resolve Error: Could not find or load main class in SpringBoot application

How to resolve Error: Could not find or load main class in SpringBoot application

我有一个带有 maven 设置的 SpringBoot 应用程序。当我 运行 maven clean, install, generate-sources , build succeed 但是当我 运行 它作为 spring 引导应用程序时,它给出错误错误:无法找到或加载 main class

为了试用,我在同一个工作区中创建了简单的 java hello world 项目,它运行良好。所以这个问题与 class 路径变量或 JDK.

无关

你能告诉我我在 SpringBoot 应用程序中可能做错了什么吗?

请尝试在POM文件中给出主要class,如下所示。

[如果主要 class 是 'com.dev.webapp.Application' ]

<properties>
    <start-class>com.dev.webapp.Application</start-class>
</properties>