问题描述 在使用Maven来构建Spring项目的时候,使用下面代码来读取Spring配置文件。 ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("/com/lin/test1/spring_config.xml"); 在编译之后,报错: 原因: 在编译后的文件目录中找不到xml配置文件: 解决方法: 在pom.xml文件中增加配置: