SpringBoot无法访问webapp目录下的文件

springboot version:2.1.9-RELEASE

 

解决方案:

  在pom中添加此段 完美解决,代码的作用是让src/main/webapp在编译的时候在resoureces路径下也生成webapp的文件

 

    <build>
        <resources>
            <resource>
                <directory>src/main/webapp</directory>
                <targetPath>META-INF/resources</targetPath>
                <includes>
                    <include>**/**</include>
                </includes>
            </resource>
        </resources>
    </build>

 

posted @ 2019-11-16 10:12  Arebirth  阅读(3570)  评论(0编辑  收藏  举报