idea 找不到classpath 为resource下的xml

注入时不能自动找到在src/main/resources下的xml

@ContextConfiguration(locations = { "classpath:applicationContext.xml" })

这一行提示错误。

解决方法一:

resources右击,选择mark dirctory as test resources root

即可。

解决方法二:

pom.xml中可能被exclude,删掉就好

            <resource>

                <directory>src/main/resources/</directory>

                <excludes>

                    <exclude>local/*</exclude>

                    <exclude>dev/*</exclude>

                    <exclude>online/*</exclude>

                </excludes>

            </resource>        

 

posted @ 2018-04-09 19:30  枫树湾河桥  阅读(4204)  评论(0)    收藏  举报
Live2D