From 599ae49f8751a98cdc537d193b6a44ceeea596f3 Mon Sep 17 00:00:00 2001 From: spencergibb Date: Fri, 10 Dec 2021 12:23:50 -0500 Subject: [PATCH] Don't initialize spring.config.import bootstrapper if bootstrap on classpath. Fixes gh-288 --- .../configclient/ZookeeperConfigServerBootstrapper.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spring-cloud-zookeeper-discovery/src/main/java/org/springframework/cloud/zookeeper/discovery/configclient/ZookeeperConfigServerBootstrapper.java b/spring-cloud-zookeeper-discovery/src/main/java/org/springframework/cloud/zookeeper/discovery/configclient/ZookeeperConfigServerBootstrapper.java index 03c261d8..8c9fed77 100644 --- a/spring-cloud-zookeeper-discovery/src/main/java/org/springframework/cloud/zookeeper/discovery/configclient/ZookeeperConfigServerBootstrapper.java +++ b/spring-cloud-zookeeper-discovery/src/main/java/org/springframework/cloud/zookeeper/discovery/configclient/ZookeeperConfigServerBootstrapper.java @@ -45,7 +45,9 @@ public class ZookeeperConfigServerBootstrapper implements Bootstrapper { @Override @SuppressWarnings("unchecked") public void intitialize(BootstrapRegistry registry) { - if (!ClassUtils.isPresent("org.springframework.cloud.config.client.ConfigServerInstanceProvider", null)) { + if (!ClassUtils.isPresent("org.springframework.cloud.config.client.ConfigServerInstanceProvider", null) || + // don't run if bootstrap enabled, how to check the property? + ClassUtils.isPresent("org.springframework.cloud.bootstrap.marker.Marker", null)) { return; } // create curator