You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

IntelliJ IDEA 2022.3社区版运行配置无Spring Boot选项求助

多模块Spring Boot项目运行配置无Spring Boot选项的解决办法

先核对模块的依赖与配置

  • 确认当前开发的子模块是Spring Boot应用模块:打开该模块的pom.xml,必须包含Spring Boot父依赖或正确的依赖管理,比如:
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>你的Spring Boot版本号</version>
        <relativePath/>
    </parent>
    
    同时要有spring-boot-starter-web这类核心启动依赖,还要配置spring-boot-maven-plugin插件,否则IDE无法识别为Spring Boot项目。
  • 父模块如果是聚合模块(packaging为pom),不要在父模块中引入Spring Boot的启动依赖,避免子模块依赖冲突。

IDE层面的修复步骤

  • 重新导入Maven项目:右键项目 → Maven → Reimport,等依赖加载完成后重启IDE,很多时候是依赖未同步导致识别失败。
  • 启用官方Spring Boot插件:不要禁用IDE自带的Spring Boot插件!第三方Spring插件可暂时关闭,但官方插件必须保持启用状态,可去插件市场确认插件状态。
  • 手动添加框架支持:打开项目结构(快捷键Ctrl+Alt+Shift+S),查看当前模块的Framework标签是否有Spring Boot,若无则点击Add Framework Support,手动选择Spring Boot添加。
  • 清理IDE缓存:
    • IntelliJ IDEA:File → Invalidate Caches... → 勾选Clear file system cache and local history → 点击Invalidate and Restart。
    • Eclipse:Project → Clean,刷新项目(F5)后重启IDE。

其他排查点

  • 子模块的packaging必须是jar或war,不能是pom——pom是父/聚合模块的类型,无法作为Spring Boot应用运行。
  • 检查Spring Boot版本与IDE版本是否兼容:比如Spring Boot 3.x需要IntelliJ IDEA 2022.2及以上版本,版本不匹配会导致识别失败。

内容的提问来源于stack exchange,提问作者Geogrio

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.16 10:47:44