zoukankan      html  css  js  c++  java
  • SpringBoot打war包

    排除Tomcat

            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-web</artifactId>
                            <exclusions>
                                <exclusion>
                                    <groupId>org.springframework.boot</groupId>
                                    <artifactId>spring-boot-starter-tomcat</artifactId>
                                </exclusion>
                            </exclusions>
            </dependency>
            <dependency>
               <groupId>org.springframework.boot</groupId>
               <artifactId>spring-boot-starter-tomcat</artifactId>
               <scope>provided</scope>
            </dependency>
    

    主启动类

    
    @Slf4j
    @EnableAsync//开启异步任务
    @EnableScheduling//开启定时任务
    @EnableTransactionManagement//开启基于注解的事务
    @SpringBootApplication
    @MapperScan("com.botao.cms.dao")//扫描
    public class CMSApplication extends SpringBootServletInitializer {
        @Bean
        public RestTemplate getRestTemplate() {
            return new RestTemplate();
        }
    
    
        public static void main(String[] args) {
            SpringApplication.run(CMSApplication.class, args);
        }
    
        @Override
        protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
            return builder.sources(CMSApplication.class);
        }
    }
    
  • 相关阅读:
    字符,字符串,字节
    111
    串口通信
    字符编码
    枚举和结构体
    参数数组
    .Net垃圾回收机制
    try{ } catch{ } finally{ }
    LVS 工作原理图文讲解
    自动化运维工具—Ansible常用模块二
  • 原文地址:https://www.cnblogs.com/botaoJava/p/14531229.html
Copyright © 2011-2022 走看看