美文网首页Spring Boot实践记录
SpringBoot使用maven打包,加载不到配置文件原因

SpringBoot使用maven打包,加载不到配置文件原因

作者: Chinesszz | 来源:发表于2017-02-08 11:40 被阅读64次

病情

使用idea工具,测试没有问题,使用maven可以打包,但是运行,错误。

通过反编译分析,原因就是打包后的文件,没有包配置文件输入,解决办法

        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <includes>
                    <include>**/*.xml</include>
                    <include>**/*.properties</include>
                </includes>
            </resource>
            <resource>
                <directory>src/main/java</directory>
                <includes>
                    <include>**/*.properties</include>
                </includes>
            </resource>
        </resources>

相关文章

网友评论

    本文标题:SpringBoot使用maven打包,加载不到配置文件原因

    本文链接:https://www.haomeiwen.com/subject/dqpvittx.html