我已经按照这些步骤将打包从罐子转换为战争。
但是,当我检查我的项目文件夹或生成的build文件夹时,并没有生成war文件,只有war文件夹附带了MANIFEST.MF文件
http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#build-tool-plugins-gradle-packaging
我在gradle构建文件中所做的更改
apply plugin: 'war'
configurations {
providedRuntime
}
dependencies {
providedRuntime('org.springframework.boot:spring-boot-starter-tomcat')
}添加了一个新的ServletInitializer类
public class ServletInitializer extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(DemoApplication.class);
}
}https://stackoverflow.com/questions/44567372
复制相似问题