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

Spring Boot集成GraphQL时无法添加graphiql-spring-boot-starter依赖求助

解决graphiql-spring-boot-starter依赖找不到的问题
  • 检查版本兼容性
    com.graphql-java:graphiql-spring-boot-starter:5.0.2的版本可能与你当前使用的Spring Boot版本不兼容。Spring Boot 2.x通常适配该依赖的4.x系列版本,Spring Boot 3.x则需要适配6.x及以上版本,请根据你的Spring Boot版本调整依赖版本号。

  • 确认仓库配置
    确保你的构建工具(Maven/Gradle)配置了Maven中央仓库,该依赖托管在中央仓库中:

    • Maven(pom.xml):
      <repositories>
          <repository>
              <id>central</id>
              <url>https://repo.maven.apache.org/maven2</url>
          </repository>
      </repositories>
      
    • Gradle(settings.gradle):
      repositories {
          mavenCentral()
      }
      
  • 替换依赖坐标
    com.graphql-java下的graphiql starter已停止维护,建议切换到官方推荐的com.graphql-java-kickstart组的依赖,示例配置如下:

    • Maven:
      <dependency>
          <groupId>com.graphql-java-kickstart</groupId>
          <artifactId>graphiql-spring-boot-starter</artifactId>
          <version>12.0.0</version> <!-- Spring Boot 3.x用此版本,2.x适配9.x系列版本 -->
      </dependency>
      
    • Gradle:
      implementation 'com.graphql-java-kickstart:graphiql-spring-boot-starter:12.0.0'
      
  • 刷新依赖缓存
    执行构建工具的刷新命令,强制更新本地依赖缓存:

    • Maven:mvn clean install -U
    • Gradle:./gradlew clean build --refresh-dependencies

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.09 16:20:25