赞
踩
Spring boot打war部署到tomcat上
- 第一步 ``` @MapperScan("com.yglh.mapper") @SpringBootApplication public class YglhApplication extends SpringBootServletInitializer { public static void main(String[] args) { SpringApplication.run(YglhApplication.class, args); } @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { return builder.sources(YglhApplication.class); } } ``` - 第二步,pom ``` <packaging>war</packaging> ``` - maven插件执行、package打包 ``` [INFO] Webapp assembled in [1048 msecs] [INFO] Building war: D:\git\gitlab\2021\夜歌离火\teacherhelper-common\target\yglh-0.0.1-SNAPSHOT.war [INFO] [INFO] --- spring-boot-maven-plugin:2.1.3.RELEASE:repackage (repackage) @ yglh --- [INFO] Replacing main artifact with repackaged archive [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 8.573 s [INFO] Finished at: 2021-03-30T12:03:14+08:00 [INFO] ------------------------------------------------------------------------ ```
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。