提示Unable to find a single main class from the following candidates错误的原因是会从所有代码里面扫描包括main方法的类,找到多个类就报错了. 解决办法是在pom.xml指定启动的类: <properties> <start-class>com.corp.MyApplication</start-class> <project.build.sourceEncoding>UTF-8</pro…
在启动SpringBoot项目是报错 Unable to find a single main class from the following candidates [boot.myboot.SampleController, boot.myboot.App] 意思 是从这两个类中找不到要执行那个main方法 执行spring-boot:run -X打印出Debug日志 [ERROR] Failed to execute goal org.springframework.boot:spring…
关于start-class,spring boot官方手册是这么说明的: The plugin rewrites your manifest, and in particular it manages the Main-Class and Start-Class entries, so if the defaults don't work you have to configure those there (not in the jar plugin). The Main-Class in th…