Search code examples
spring-data-jpajava-19springfox-boot-starter

spring boot - springfox-boot-starter integration giving 404 with no error


Java Version: 19.0.1 Springboot: 3.0.1

using dependency:

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

Swagger configuration class

@Configuration
public class SwaggerConfiguration {

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

There is no error, application is starting normally, but when visiting

http://localhost:8060/swagger-ui it is 404.

if I am using @EnableSwagger2 then it is showing error while starting application that decencies are not available.

I followed swagger-2-documentation-for-spring-rest-api, seems @EnableSwagger2 annotation is not required.


Solution

  • springfox-boot-starter version 3.0.0 seems not to support Spring Boot 3. Consider switching to SpringDoc v2 which does support it.