[macrozheng/mall]请问怎么打包成war

2024-01-03 897 views
6

以下是我改的配置: 主pom.xml `

org.springframework.boot spring-boot-maven-plugin org.apache.maven.plugins maven-compiler-plugin 3.6.2 ${java.version} ${java.version} ${project.build.sourceEncoding} ` mall-admin中的pom.xml ` war ${project.artifactId} org.springframework.boot spring-boot-maven-plugin 2.1.1.RELEASE true repackage org.apache.maven.plugins maven-war-plugin 3.1.0 false ${project.artifactId} org.apache.maven.plugins maven-compiler-plugin ` 打包成war以后,放到tomcat里面,只有tomcat的部署日志,没有项目的运行日志 @macrozheng

回答

2

找到问题了:没有在启动类中继承SpringBootServletInitializer并重写configure,在启动类中加上如下代码就好了 @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { return application.sources(MallAdminApplication.class); }