标签:移除 oid let inf 如何 over configure com code
1.在pom文件下添加
<packaging>war</packaging>
2.在pom下移除tomcat插件
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<!-- 移除嵌入式tomcat插件 -->
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
3.添加server-api依赖,(此时运行会报错,把<scope>provided</scope>去掉才能运行)
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>
4.修改启动类
@SpringBootApplication
public class GuangdongApplication extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
// 注意这里要指向原先用main方法执行的Application启动类
return builder.sources(GuangdongApplication.class);
}
public static void main(String[] args) {
SpringApplication.run(GuangdongApplication.class, args);
}
}
5.点击菜单栏的=Bulid-Bulid Project
6.点击View勾选Tool Buttoms
7.点击侧边的Maven按钮- package
8.当控制栏下出现BUILD SUCCESS说明打包成功
9.在target目录下即可找到生成的war包
10.war包可任意命名,然后放到tomcat目录下的webapps目录下即可部署
标签:移除 oid let inf 如何 over configure com code
原文地址:https://www.cnblogs.com/superman-21/p/13018942.html