Package a spring boot application including JSPs and static resources

前端 未结 5 2158
面向向阳花
面向向阳花 2020-12-29 11:46

I want to package a spring-boot application as jar, and I do so with mvn package.

This produces a jar which does not contain any /WEB-INF/jsp

5条回答
  •  被撕碎了的回忆
    2020-12-29 12:11

    I had the same problem you had. I tried the answer above that you marked correct but it didn't work for me.

    This worked ... change the pom.xml to ...

    war
    

    ... this will causes maven to create a WAR file that is executable like so ...

    java -jar yourwarfile.war
    

    I found this solution with this similar question here ...

    WEB-INF not included in WebApp using SpringBoot, Spring-MVC and Maven

提交回复
热议问题