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 插件它应该使用哪个类作为主类?
main
在你的 pom 中添加你的开始类:
<properties> <!-- The main class to start by executing java -jar --> <start-class>com.mycorp.starter.HelloWorldApplication</start-class> </properties>
或者
<build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <mainClass>com.mycorp.starter.HelloWorldApplication</mainClass> </configuration> </plugin> </plugins> </build>