title: Spring boot 2.3.4 with Swagger + Hateoas
body: <p>While trying to work with Hateoas and Swagger 2.9.0 The application is failed to start with this exception:</p>
  <pre><code>APPLICATION FAILED TO START
  ***************************
  
  Description:
  
  Parameter 0 of method linkDiscoverers in org.springframework.hateoas.config.HateoasConfiguration required a single bean, but 17 were found:
      - modelBuilderPluginRegistry: defined in null
      - modelPropertyBuilderPluginRegistry: defined in null
      - typeNameProviderPluginRegistry: defined in null
      - syntheticModelProviderPluginRegistry: defined in null
      - documentationPluginRegistry: defined in null
      - apiListingBuilderPluginRegistry: defined in null
      - operationBuilderPluginRegistry: defined in null
      - parameterBuilderPluginRegistry: defined in null
      - expandedParameterBuilderPluginRegistry: defined in null
      - resourceGroupingStrategyRegistry: defined in null
      - operationModelsProviderPluginRegistry: defined in null
      - defaultsProviderPluginRegistry: defined in null
      - pathDecoratorRegistry: defined in null
      - apiListingScannerPluginRegistry: defined in null
      - relProviderPluginRegistry: defined by method 'relProviderPluginRegistry' in class path resource [org/springframework/hateoas/config/HateoasConfiguration.class]
      - linkDiscovererRegistry: defined in null
      - entityLinksPluginRegistry: defined by method 'entityLinksPluginRegistry' in class path resource [org/springframework/hateoas/config/WebMvcEntityLinksConfiguration.class]
  
  
  Action:
  
  Consider marking one of the beans as @Primary, updating the consumer to accept multiple beans, or using @Qualifier to identify the bean that should be consumed
  </code></pre>
  <p>I saw some workarounds that should solve this prolbem :</p>
  <pre><code>
  @Configuration
  @EnableSwagger2
  @EnableHypermediaSupport(type=EnableHypermediaSupport.HypermediaType.HAL)
  public class AppConfig {
      
      @Bean
      public Docket api() {
          return new Docket(DocumentationType.SWAGGER_2).select().apis(RequestHandlerSelectors.any())
                  .paths(PathSelectors.any()).build();
      }
      
      @Primary
      @Bean
      public LinkDiscoverers discoverers() {
          List&lt;LinkDiscoverer&gt; plugins = new ArrayList&lt;&gt;();
          plugins.add(new CollectionJsonLinkDiscoverer());
          return new LinkDiscoverers(SimplePluginRegistry.create(plugins));
      }
  }
  </code></pre>
  <p>But it didn't work for me.
  Anyone knows how to deal with this problem ?
  Here is my build.gradle file :</p>
  <pre><code>plugins {
      id 'org.springframework.boot' version '2.3.4.RELEASE'
      id 'io.spring.dependency-management' version '1.0.10.RELEASE'
      id 'java'
  }
  
  group = 'com'
  version = '0.0.1-SNAPSHOT'
  sourceCompatibility = '1.8'
  
  repositories {
      mavenCentral()
  }
  
  dependencies {
      implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
      implementation 'org.springframework.boot:spring-boot-starter-web'
      implementation 'org.springframework.boot:spring-boot-starter-hateoas'
      runtimeOnly 'com.h2database:h2'
      compile group: 'io.springfox', name: 'springfox-swagger2', version: '2.9.2'
      compile group: 'io.springfox', name: 'springfox-swagger-ui', version: '2.9.2'
      compile group: 'org.springframework.plugin', name: 'spring-plugin-core', version: '1.2.0.RELEASE'
      testImplementation('org.springframework.boot:spring-boot-starter-test') {
          exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
      }
  }
  
  test {
      useJUnitPlatform()
  }
  </code></pre>
  <p>When I tried to change the Spring-plugin-core to 2.0.0 version I got this error also:</p>
  <pre><code>
  ***************************
  APPLICATION FAILED TO START
  ***************************
  
  Description:
  
  An attempt was made to call a method that does not exist. The attempt was made from the following location:
  
      springfox.documentation.spring.web.plugins.DocumentationPluginsManager.createContextBuilder(DocumentationPluginsManager.java:152)
  
  The following method did not exist:
  
      org.springframework.plugin.core.PluginRegistry.getPluginFor(Ljava/lang/Object;Lorg/springframework/plugin/core/Plugin;)Lorg/springframework/plugin/core/Plugin;
  
  The method's class, org.springframework.plugin.core.PluginRegistry, is available from the following locations:
  
      jar:file:/C:/Users/omera/.gradle/caches/modules-2/files-2.1/org.springframework.plugin/spring-plugin-core/2.0.0.RELEASE/95fc8c13037630f4aba9c51141f535becec00fe6/spring-plugin-core-2.0.0.RELEASE.jar!/org/springframework/plugin/core/PluginRegistry.class
  
  The class hierarchy was loaded from the following locations:
  
      org.springframework.plugin.core.PluginRegistry: file:/C:/Users/omera/.gradle/caches/modules-2/files-2.1/org.springframework.plugin/spring-plugin-core/2.0.0.RELEASE/95fc8c13037630f4aba9c51141f535becec00fe6/spring-plugin-core-2.0.0.RELEASE.jar
  
  
  Action:
  
  Correct the classpath of your application so that it contains a single, compatible version of org.springframework.plugin.core.PluginRegistry
  
  </code></pre>