Запуск spring cloud eureka с No spring.config.import set

Установил spring boot и spring cloud.

PS C:\spring\spring-2.4.4> spring --version
Spring CLI v2.4.4
PS C:\spring\spring-2.4.4> spring cloud --version
Spring Cloud CLI v3.0.2
PS C:\spring\spring-2.4.4> java -version
java version "15.0.1" 2020-10-20

при запуске командой spring cloud eureka

22:28:13.974 [Thread-2] DEBUG org.springframework.boot.diagnostics.LoggingFailureAnalysisReporter - Application failed to start due to an exception
org.springframework.cloud.config.client.ConfigServerConfigDataMissingEnvironmentPostProcessor$ImportException: No spring.config.import set
        at org.springframework.cloud.config.client.ConfigServerConfigDataMissingEnvironmentPostProcessor.postProcessEnvironment(ConfigServerConfigDataMissingEnvironmentPostProcessor.java:60)
        at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEnvironmentPreparedEvent(EnvironmentPostProcessorApplicationListener.java:100)
        at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEvent(EnvironmentPostProcessorApplicationListener.java:86)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:131)
        at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:82)
        at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:63)
        at java.util.ArrayList.forEach(ArrayList.java:1257)
        at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:117)
        at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:111)
        at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:62)
        at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:362)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:320)
        at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:144)
        at org.springframework.cloud.deployer.thin.ContextRunner$1.run(ContextRunner.java:63)
        at java.lang.Thread.run(Thread.java:748)
22:28:13.976 [Thread-2] ERROR org.springframework.boot.diagnostics.LoggingFailureAnalysisReporter -

***************************
APPLICATION FAILED TO START
***************************

Description:

No spring.config.import property has been defined

Action:

Add a spring.config.import=configserver: property to your configuration.
        If configuration is not required add spring.config.import=optional:configserver: instead.
        To disable this check, set spring.cloud.config.enabled=false or
        spring.cloud.config.import-check.enabled=false.

не очень ясно. это нужно jar которые скачались при установке spring cloud изменить? ии где или проперти задать?


Ответы (1 шт):

Автор решения: PavelSerebriakov

Согласно этой документации в Spring Cloud начиная с версии 2020.0.0-M4 (Ilford) загрузчик bootstrap отключен по умолчанию. Для того, чтобы активировать загрузку bootstrap, добавь в pom файл модуля следующую зависимость:

<dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-bootstrap</artifactId>
</dependency>
→ Ссылка