SpringBoot: Unable to find a single main class from the following candidates

后端 未结 11 1901
旧巷少年郎
旧巷少年郎 2020-12-13 00:06

I\'ve generated a Spring Boot web application using Spring Initializer, embedded Tomcat, Thymeleaf template engine.Technologies used: Spring Boot 1.4.2.RELEASE, Spring 4.3.4

11条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-13 01:00

    Define single main class via start-class property

    
          com.may.Application
    
    

    Alternatively, define the main class in the spring-boot-maven-plugin

    
        
            
                org.springframework.boot
                spring-boot-maven-plugin
                
                    com.may.Application
                
            
        
    
    

    Or via profiles

    
            
                profile1
                
                    com.may.Application1
                
            
            
                profile2
                
                    com.may.Application2
                
            
    
    
    
            
                
                    org.springframework.boot
                    spring-boot-maven-plugin
                    
                        
                            
                                repackage
                            
                            
                                ${spring.boot.mainclass}
                            
                        
                    
                
            
        
    

提交回复
热议问题