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>

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM