Во время настройки интеграции SpringBoot и Swagger произошла следующая ошибка:
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-12-10 15:14:16.587 ERROR 6536 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
APPLICATION FAILED TO START
***************************
Description:
Parameter 0 of method linkDiscoverers in org.springframework.hateoas.config.HateoasConfiguration required a single bean, but 15 were found:
- modelBuilderPluginRegistry: defined in null
- modelPropertyBuilderPluginRegistry: defined in null
- typeNameProviderPluginRegistry: 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
- 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
Process finished with exit code 1
После анализа и проверки я наконец обнаружил, что это версия SpringBoot и Swagger. Обратите внимание, что версия двух версий, версия проекта springboot низкая, а соответствующая версия swagger не может быть слишком высокой, и наоборот, чтобы избежать ошибок проекта. Моя версия springboot - 2.4.0 , Версия swagger - 2.2.2, и при запуске проекта будет сообщено о следующей ошибке: (Решение этой проблемы состоит в прямой замене версии swagger в файле pom на 2.9.2)