From 052d972311ab8aaba88e0bcc329e2658945cb465 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 a7079510..83a11868 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 BootstrapRegistryIniti @Override @SuppressWarnings("unchecked") public void initialize(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