Spring Boot 程序找不到主类 [英] Spring Boot Program cannot find main class

查看:33
本文介绍了Spring Boot 程序找不到主类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个程序,它在 Eclipse 中作为 Spring 启动应用程序运行.该程序运行良好.然后我做了以下事情:

I have a program which runs as a Spring boot App in eclipse. The program was running fine. Then i did the following:

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

Right click on project -> Run As -> Maven Test .

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

This was accidental. When i then tried to run the program as a spring boot app again, it threw the following error below.

错误:无法找到或加载主类 com.bt.collab.alu.api.webapp.Application

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

How do i point the application back to my main class? Thanks

推荐答案

主类可在 pom.xml 中配置

Main class is configurable in pom.xml

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

这篇关于Spring Boot 程序找不到主类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆