【IDEA】创建的 maven 项目,右键 new --> XML Configuration File 时,无 Spring Config 选项

问题描述:

  创建的maven项目,右键 New -> XML Configuration File 时,无 Spring Config 选项。即没有下图中的选项:

  

解决方法:

  导入 spring 相关的依赖,比如:spring-context-support 或者 spring-webmvc,如下图:

  

查看效果:

  

  如果 Spring Config 选项依旧没有出现,那么使用终极大杀招:

如果导入他人已经写好的项目时,发现导入的项目与自己的整个项“格格不入”时,这时可以删除整个项目在 IDEA 中的配置数据,其文件夹是 .idea
然后删除缓存索引数据并重启 IEDA(File -> Invalidate Caches / Restart...),再重新加载该项目,重新生成新的 .idea 文件 和 缓存索引数据。即可解决问题!

猜你喜欢

转载自www.cnblogs.com/chenmingjun/p/10920813.html