Execution default of goal
org.springframework.boot:spring-boot-maven-plugin:1.0.1.RELEASE:repackage
failed:
Unable to find a single main class from the following candidates
我的项目有多个带有 main
方法的类。我该如何告诉Spring Boot Maven插件应该使用哪个类作为主类?
Execution default of goal
org.springframework.boot:spring-boot-maven-plugin:1.0.1.RELEASE:repackage
failed:
Unable to find a single main class from the following candidates
我的项目有多个带有 main
方法的类。我该如何告诉Spring Boot Maven插件应该使用哪个类作为主类?
plugins {
id 'org.springframework.boot' version '2.3.3.RELEASE'
id 'io.spring.dependency-management' version '1.0.10.RELEASE'
id 'application'
}
application {
mainClassName = 'com.example.ExampleApplication'
}
gradle run
可以运行应用程序,并且Gradle会自动配置类路径。该插件还将应用程序打包为TAR和/或ZIP文件,包括特定于操作系统的启动脚本。