Springboot 导成 war

1.pom.xml


war


         
            org.springframework.boot
            spring-boot-starter-web
            
             
                
                    org.springframework.boot
                    spring-boot-starter-tomcat
                
             
        

        
            org.apache.tomcat
            tomcat-servlet-api
            8.5.9
            provided
         

    
        invengoaccess
        
            
                org.springframework.boot
                spring-boot-maven-plugin
            
        
    

2.Application

import org.jboss.logging.Logger;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.support.SpringBootServletInitializer;



@SpringBootApplication
public class Application extends SpringBootServletInitializer {
  //public class Application{
    private static Logger logger = Logger.getLogger(Application.class);

    /**
     * Start
     */
    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
        logger.info("SpringBoot Start Success");
    }
}

3.遇到的问题

java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.Lifec

原因是--- 有jar包冲突(这边是mybatis 冲突)


            org.springframework.boot
            spring-boot-starter-jdbc
        
        
            org.springframework.boot
            spring-boot-starter-actuator
        
    
        
            org.springframework.boot
            spring-boot-starter-amqp
        
        
            org.springframework.boot
            spring-boot-starter-test
            test
        

        
            org.mybatis.spring.boot
            mybatis-spring-boot-starter
            1.3.1
        
    
        

你可能感兴趣的:(Springboot 导成 war)