Spring Data Jpa Spring Boot - springfox-boot-starter集成提供404,无错误

cidc1ykv  于 2023-03-12  发布在  Spring
关注(0)|答案(1)|浏览(193)

Java版本:19.0.1Spring Boot:3.0.1
使用依赖项:

<dependency>
  <groupId>io.springfox</groupId>
  <artifactId>springfox-boot-starter</artifactId>
  <version>3.0.0</version>
</dependency>

Swagger 配置等级

@Configuration
public class SwaggerConfiguration {

  @Bean
  public Docket api() {
    return new Docket(DocumentationType.SWAGGER_2)
      .select()
      .apis(RequestHandlerSelectors.any())
      .paths(PathSelectors.any())
      .build();
  }

没有错误,应用程序正常启动,但访问时
http://localhost:8060/swagger-ui它是404。
如果我使用的是@EnableSwagger2,那么它在启动应用程序时显示错误,即decencies不可用。
我遵循了swagger-2-documentation-for-spring-rest-api,似乎不需要@EnableSwagger2注解。

wd2eg0qa

wd2eg0qa1#

springfox-boot-starter版本3.0.0似乎不支持Sping Boot 3。请考虑切换到支持Spring Boot 3的SpringDoc v2

相关问题