springboot 项目部署后 404的问题

是因为打包的时候,没有把webapp打包进去

pom.xml 在build 里加入下面的依赖即可

<!-- resources插件,在打jar包时可以将webapp目录下的文件进行打包 -->
        <resources>
            <resource>
                <!-- 指定resources插件处理哪个目录下的资源文件 -->
                <directory>src/main/webapp</directory>
                <!--注意此次必须要放在此目录下才能被访问到 -->
                <targetPath>META-INF/resources</targetPath>
                <includes>
                    <include>**/**</include>
                </includes>
            </resource>
            <!-- 将项目中的配置文件,打包至classes下面 -->
            <resource>
                <directory>src/main/resources</directory>
            </resource>
        </resources>
原文地址:https://www.cnblogs.com/kinome/p/11508949.html