| | |
| | | package com.yssh; |
| | | |
| | | import java.net.UnknownHostException; |
| | | |
| | | import org.springframework.boot.SpringApplication; |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | | import org.springframework.scheduling.annotation.EnableAsync; |
| | | import org.springframework.scheduling.annotation.EnableScheduling; |
| | | |
| | | import com.yssh.utils.ServletInitializer; |
| | | import org.springframework.boot.builder.SpringApplicationBuilder; |
| | | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; |
| | | import springfox.documentation.swagger2.annotations.EnableSwagger2; |
| | | |
| | | /** |
| | | * @author wMeng |
| | | * @ClassName Application |
| | | * @Description TODO |
| | | * @date 2022/10/30 13:00 |
| | | * @Version 1.0 |
| | | * 排除Security:, exclude = {SecurityAutoConfiguration.class, SecurityFilterAutoConfiguration.class} |
| | | * |
| | | * jar -> war:继承 SpringBootServletInitializer,实现 configure 函数 |
| | | */ |
| | | @SpringBootApplication |
| | | @EnableScheduling |
| | | @EnableAsync(proxyTargetClass=true) |
| | | public class Application extends ServletInitializer { |
| | | |
| | | public static void main(String[] args) throws UnknownHostException { |
| | | @EnableSwagger2 |
| | | @SpringBootApplication(scanBasePackages = {"com.yssh.*"}) |
| | | public class Application extends SpringBootServletInitializer { |
| | | public static void main(String[] args) { |
| | | SpringApplication.run(Application.class, args); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | protected SpringApplicationBuilder configure(SpringApplicationBuilder springApplicationBuilder) { |
| | | return springApplicationBuilder.sources(Application.class); |
| | | } |
| | | } |