maven下含有jsp的spring boot项目如何打包?

2024-12-03 09:35:22
推荐回答(1个)
回答1:

新建一个类或者让主方法的类继承SpringBootServletInitializer ,重写configure方法,

@Override  
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {  
        return application.sources(application.Class);  
    }  
    
    private static Class applicationClass = ServletInitializer.class;

pom添加依赖





packaging改成war