一丶 新增maven 依赖,一级 build
<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>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <version>3.1.0</version> <scope>provided</scope></dependency> 二丶 新增 build
<plugin> <artifactId>maven-war-plugin</artifactId> <version>2.6</version> <configuration> <!--如果想在没有web.xml文件的情况下构建WAR,请设置为false。--> <failOnMissingWebXml>false</failOnMissingWebXml> </configuration></plugin> 三丶 跟目录下,新增 FlowBootstrap 类
四丶 FlowBootStap类
@ServletComponentScanpublic class FlowBootstrap extends SpringBootServletInitializer { @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { // 注意这里要指向原先用main方法执行的Application启动类 return builder.sources(FlowApplication.class); }} 五丶 FlowApplication启动类
@SpringBootApplication@EnableTransactionManagement // 开启事务@MapperScan("io.shulie.center.flow.core.mapper")public class FlowApplication { public static void main(String[] args) { SpringApplication.run(FlowApplication.class, args); } }
原文地址:https://www.cnblogs.com/quzhongren/p/11734852.html
时间: 2024-11-12 02:07:31