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

引入Spring Boot Starter Data JPA后出现SpringDataWebSettings类找不到异常,需补充哪个Maven依赖?

引入Spring Boot Starter Data JPA后出现SpringDataWebSettings类找不到异常,需补充哪个Maven依赖?

Hey, I’ve run into this exact issue before—let’s work through it together!

The spring-boot-starter-data-jpa dependency you added handles core JPA data access functionality, but it doesn’t include Spring Data’s web-related components. The missing org.springframework.data.web.config.SpringDataWebSettings class lives in the Spring Data Web module, which isn’t part of the JPA starter by default.

To fix this, you have two reliable options, and I’d recommend the first one for better compatibility with your Spring Boot setup:

  • Option 1: Use the Spring Boot Starter for Data REST
    This starter packages all necessary Spring Data web components and keeps versions aligned with your existing Spring Boot 2.4.0 setup. Add this to your pom.xml:

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-rest</artifactId>
        <version>2.4.0</version>
    </dependency>
    

    Note: If your project inherits from the Spring Boot parent POM (spring-boot-starter-parent), you can skip the <version> tag—Spring Boot will manage the version automatically.

  • Option 2: Directly add the Spring Data Web dependency
    If you don’t need all the features from the Data REST starter, you can add just the standalone web module:

    <dependency>
        <groupId>org.springframework.data</groupId>
        <artifactId>spring-data-web</artifactId>
        <version>2.4.0.RELEASE</version>
    </dependency>
    

After adding either dependency, run mvn clean install to refresh your project’s dependencies, and that ClassNotFoundException should disappear!

备注:内容来源于stack exchange,提问作者coosta

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.04.14 11:52:59