东方通部署WAR包
项目打包
1.启动类
@RestController
public class Application extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application){
return application.sources(Application.class);
}
}
2.pom.xml
<!-- 打包方式为war包 -->
<packaging>war</packaging>
<!-- &禁止springboot 内嵌tomcat启动 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<finalName>ROOT</finalName>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<!--如果想在没有web.xml文件的情况下构建WAR,请设置为false。-->
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<plugins>
3.前端放resource/static目录下
部署应用
目前踩的坑
1.内存溢出
<!-- 进入东方通部署目录 -->
cd bin/
vi external.vmoptions
调整参数 XX:MaxMetaspaceSize
2.遇到如下情况需调整参数
|