指定运行的内存
java -Xms10m -Xmx200m -jar xxx.jar
spring boot 打包成war包:
让 SpringbootApplication 类继承 SpringBootServletInitializer 并重写 configure 方法,如下:
@SpringBootApplication public class SpringbootApplication extends SpringBootServletInitializer { @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { return application.sources(SpringbootApplication.class); } public static void main(String[] args) { SpringApplication.run(SpringbootApplication.class, args); } }
修改 pom.xml 文件,将 jar 改成 war,如下:
<packaging>war</packaging>
遇到的问题:
为spring boot 项目指定了日志路径,但是有时没有按照路径生成日志文件,所以改用tomcat进行部署。
原文地址:https://www.cnblogs.com/taiguyiba/p/9053746.html
时间: 2024-10-10 00:04:19