diff --git a/.flattened-pom.xml b/.flattened-pom.xml
new file mode 100644
index 000000000..66602fa5a
--- /dev/null
+++ b/.flattened-pom.xml
@@ -0,0 +1,134 @@
+
+
+ 4.0.0
+
+ org.springframework.cloud
+ spring-cloud-build
+ 4.1.0-SNAPSHOT
+
+
+ org.springframework.cloud
+ spring-cloud-zookeeper
+ 4.1.0-SNAPSHOT
+ pom
+ Spring Cloud Zookeeper
+ Spring Cloud Zookeeper
+ https://spring.io/spring-cloud/spring-cloud-zookeeper
+
+ Pivotal Software, Inc.
+ https://www.spring.io
+
+
+
+ Apache License, Version 2.0
+ https://www.apache.org/licenses/LICENSE-2.0
+ Copyright 2014-2021 the original author or authors.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied.
+
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+
+
+
+ dsyer
+ Dave Syer
+ dsyer at pivotal.io
+ Pivotal Software, Inc.
+ https://www.spring.io
+
+ lead
+
+
+
+ sgibb
+ Spencer Gibb
+ sgibb at pivotal.io
+ Pivotal Software, Inc.
+ https://www.spring.io
+
+ lead
+
+
+
+ mgrzejszczak
+ Marcin Grzejszczak
+ mgrzejszczak at pivotal.io
+ Pivotal Software, Inc.
+ https://www.spring.io
+
+ developer
+
+
+
+ rbaxter
+ Ryan Baxter
+ rbaxter at pivotal.io
+ Pivotal Software, Inc.
+ https://www.spring.io
+
+ developer
+
+
+
+ omaciaszeksharma
+ Olga Maciaszek-Sharma
+ omaciaszeksharma at pivotal.io
+ Pivotal Software, Inc.
+ https://www.spring.io
+
+ developer
+
+
+
+
+ scm:git:git://github.com/spring-cloud/spring-cloud-zookeeper.git
+ scm:git:ssh://git@github.com/spring-cloud/spring-cloud-zookeeper.git
+ https://github.com/spring-cloud/spring-cloud-zookeeper
+
+
+
+ spring
+
+
+
+ false
+
+
+ true
+
+ spring-snapshots
+ Spring Snapshots
+ https://repo.spring.io/snapshot
+
+
+
+ false
+
+ spring-milestones
+ Spring Milestones
+ https://repo.spring.io/milestone
+
+
+
+ false
+
+ spring-releases
+ Spring Releases
+ https://repo.spring.io/release
+
+
+
+
+
diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md
deleted file mode 100644
index eb9a16ae6..000000000
--- a/.github/CONTRIBUTING.md
+++ /dev/null
@@ -1,45 +0,0 @@
-
-# Contributing
-
-Spring Cloud is released under the non-restrictive Apache 2.0 license,
-and follows a very standard Github development process, using Github
-tracker for issues and merging pull requests into master. If you want
-to contribute even something trivial please do not hesitate, but
-follow the guidelines below.
-
-## Sign the Contributor License Agreement
-Before we accept a non-trivial patch or pull request we will need you to sign the
-[Contributor License Agreement](https://cla.pivotal.io/sign/spring).
-Signing the contributor's agreement does not grant anyone commit rights to the main
-repository, but it does mean that we can accept your contributions, and you will get an
-author credit if we do. Active contributors might be asked to join the core team, and
-given the ability to merge pull requests.
-
-## Code of Conduct
-This project adheres to the Contributor Covenant [code of
-conduct](https://github.com/spring-cloud/spring-cloud-build/blob/master/docs/src/main/asciidoc/code-of-conduct.adoc). By participating, you are expected to uphold this code. Please report
-unacceptable behavior to spring-code-of-conduct@pivotal.io.
-
-## Code Conventions and Housekeeping
-None of these is essential for a pull request, but they will all help. They can also be
-added after the original pull request but before a merge.
-
-* Use the Spring Framework code format conventions. If you use Eclipse
- you can import formatter settings using the
- `eclipse-code-formatter.xml` file from the
- [Spring Cloud Build](https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-dependencies-parent/eclipse-code-formatter.xml) project. If using IntelliJ, you can use the
- [Eclipse Code Formatter Plugin](https://plugins.jetbrains.com/plugin/6546) to import the same file.
-* Make sure all new `.java` files to have a simple Javadoc class comment with at least an
- `@author` tag identifying you, and preferably at least a paragraph on what the class is
- for.
-* Add the ASF license header comment to all new `.java` files (copy from existing files
- in the project)
-* Add yourself as an `@author` to the .java files that you modify substantially (more
- than cosmetic changes).
-* Add some Javadocs and, if you change the namespace, some XSD doc elements.
-* A few unit tests would help a lot as well -- someone has to do it.
-* If no-one else is using your branch, please rebase it against the current master (or
- other target branch in the main project).
-* When writing a commit message please follow [these conventions](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html),
- if you are fixing an existing issue please add `Fixes gh-XXXX` at the end of the commit
- message (where XXXX is the issue number).
diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md
deleted file mode 100644
index 0bc5ef4fa..000000000
--- a/.github/ISSUE_TEMPLATE.md
+++ /dev/null
@@ -1,20 +0,0 @@
-
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
deleted file mode 100644
index aeafef9d3..000000000
--- a/.github/ISSUE_TEMPLATE/bug_report.md
+++ /dev/null
@@ -1,17 +0,0 @@
----
-name: Bug report
-about: Create a report to help us improve
-title: ''
-labels: ''
-assignees: ''
-
----
-
-**Describe the bug**
-Please provide details of the problem, including the version of Spring Cloud that you
-are using.
-
-**Sample**
-If possible, please provide a test case or sample application that reproduces
-the problem. This makes it much easier for us to diagnose the problem and to verify that
-we have fixed it.
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
deleted file mode 100644
index bbcbbe7d6..000000000
--- a/.github/ISSUE_TEMPLATE/feature_request.md
+++ /dev/null
@@ -1,20 +0,0 @@
----
-name: Feature request
-about: Suggest an idea for this project
-title: ''
-labels: ''
-assignees: ''
-
----
-
-**Is your feature request related to a problem? Please describe.**
-A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
-
-**Describe the solution you'd like**
-A clear and concise description of what you want to happen.
-
-**Describe alternatives you've considered**
-A clear and concise description of any alternative solutions or features you've considered.
-
-**Additional context**
-Add any other context or screenshots about the feature request here.
diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml
new file mode 100644
index 000000000..6114dd1c6
--- /dev/null
+++ b/.github/workflows/deploy-docs.yml
@@ -0,0 +1,53 @@
+name: Deploy Docs
+run-name: ${{ format('{0} ({1})', github.workflow, github.event.inputs.build-refname || 'all') }}
+on:
+ workflow_dispatch:
+ inputs:
+ build-refname:
+ description: Enter git refname to build (e.g., 5.7.x).
+ required: false
+ push:
+ branches: docs-build
+env:
+ GRADLE_ENTERPRISE_SECRET_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }}
+permissions:
+ contents: write
+jobs:
+ build:
+ if: github.repository_owner == 'spring-cloud'
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+ with:
+ fetch-depth: 5
+ - name: Set up JDK 17
+ uses: actions/setup-java@v3
+ with:
+ java-version: '17'
+ distribution: 'temurin'
+ - name: Set up refname build
+ if: github.event.inputs.build-refname
+ run: |
+ git fetch --depth 1 https://github.com/$GITHUB_REPOSITORY ${{ github.event.inputs.build-refname }}
+ export BUILD_REFNAME=${{ github.event.inputs.build-refname }}
+ echo "BUILD_REFNAME=$BUILD_REFNAME" >> $GITHUB_ENV
+ export BUILD_VERSION=$(git cat-file --textconv FETCH_HEAD:pom.xml | python3 -c "import xml.etree.ElementTree as xml; from sys import stdin; print(xml.parse(stdin).getroot().find('{http://maven.apache.org/POM/4.0.0}version').text)")
+ echo BUILD_VERSION=$BUILD_VERSION >> $GITHUB_ENV
+ - name: Run Antora
+ run: |
+ ./mvnw --no-transfer-progress -B antora
+ - name: Publish Docs
+ uses: spring-io/spring-doc-actions/rsync-antora-reference@v0.0.11
+ with:
+ docs-username: ${{ secrets.DOCS_USERNAME }}
+ docs-host: ${{ secrets.DOCS_HOST }}
+ docs-ssh-key: ${{ secrets.DOCS_SSH_KEY }}
+ docs-ssh-host-key: ${{ secrets.DOCS_SSH_HOST_KEY }}
+ site-path: target/antora/site
+ - name: Bust Cloudflare Cache
+ uses: spring-io/spring-doc-actions/bust-cloudflare-antora-cache@v0.0.11
+ with:
+ context-root: spring-cloud-zookeeper
+ cloudflare-zone-id: ${{ secrets.CLOUDFLARE_ZONE_ID }}
+ cloudflare-cache-token: ${{ secrets.CLOUDFLARE_CACHE_TOKEN }}
diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml
deleted file mode 100644
index 98bf13c3d..000000000
--- a/.github/workflows/maven.yml
+++ /dev/null
@@ -1,37 +0,0 @@
-# This workflow will build a Java project with Maven
-# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
-
-name: Build
-
-on:
- push:
- branches: [ main, 3.1.x ]
- pull_request:
- branches: [ main, 3.1.x ]
-
-jobs:
- build:
-
- runs-on: ubuntu-latest
-
- steps:
- - uses: actions/checkout@v2
- - name: Set up JDK
- uses: actions/setup-java@v2
- with:
- distribution: 'temurin'
- java-version: '17'
- - name: Cache local Maven repository
- uses: actions/cache@v2
- with:
- path: ~/.m2/repository
- key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
- restore-keys: |
- ${{ runner.os }}-maven-
- - name: Build with Maven
- run: ./mvnw clean install -B -U -Pspring -Dmaven.test.redirectTestOutputToFile=true
- - name: Publish Test Report
- uses: mikepenz/action-junit-report@v2
- if: always() # always run even if the previous step fails
- with:
- report_paths: '**/surefire-reports/TEST-*.xml'
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index 84d578d91..6be8a4a16 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,19 +1,22 @@
-*~
-#*
-*#
-.#*
-.classpath
-.project
+target/
.settings/
-.factorypath
+.project
+.classpath
+*.orig
.springBeans
-target/
-_site/
-.idea
-*.iml
-*.swp
-*.log
-.checkstyle
+.factorypath
+.sts4-cache
+.ant-targets-build.xml
+src/ant/.ant-targets-upload-dist.xml
+*.sonar4clipse*
.DS_Store
-.vscode/
-.flattened-pom.xml
+*.iml
+*.ipr
+*.iws
+/.idea/
+*.graphml
+node
+node_modules
+build
+package.json
+package-lock.json
diff --git a/.java-version b/.java-version
deleted file mode 100644
index 98d9bcb75..000000000
--- a/.java-version
+++ /dev/null
@@ -1 +0,0 @@
-17
diff --git a/.mvn/maven.config b/.mvn/maven.config
deleted file mode 100644
index a68299056..000000000
--- a/.mvn/maven.config
+++ /dev/null
@@ -1 +0,0 @@
--P spring
diff --git a/.mvn/wrapper/MavenWrapperDownloader.java b/.mvn/wrapper/MavenWrapperDownloader.java
new file mode 100644
index 000000000..b901097f2
--- /dev/null
+++ b/.mvn/wrapper/MavenWrapperDownloader.java
@@ -0,0 +1,117 @@
+/*
+ * Copyright 2007-present the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import java.net.*;
+import java.io.*;
+import java.nio.channels.*;
+import java.util.Properties;
+
+public class MavenWrapperDownloader {
+
+ private static final String WRAPPER_VERSION = "0.5.6";
+ /**
+ * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
+ */
+ private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
+ + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
+
+ /**
+ * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
+ * use instead of the default one.
+ */
+ private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
+ ".mvn/wrapper/maven-wrapper.properties";
+
+ /**
+ * Path where the maven-wrapper.jar will be saved to.
+ */
+ private static final String MAVEN_WRAPPER_JAR_PATH =
+ ".mvn/wrapper/maven-wrapper.jar";
+
+ /**
+ * Name of the property which should be used to override the default download url for the wrapper.
+ */
+ private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
+
+ public static void main(String args[]) {
+ System.out.println("- Downloader started");
+ File baseDirectory = new File(args[0]);
+ System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
+
+ // If the maven-wrapper.properties exists, read it and check if it contains a custom
+ // wrapperUrl parameter.
+ File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
+ String url = DEFAULT_DOWNLOAD_URL;
+ if(mavenWrapperPropertyFile.exists()) {
+ FileInputStream mavenWrapperPropertyFileInputStream = null;
+ try {
+ mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
+ Properties mavenWrapperProperties = new Properties();
+ mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
+ url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
+ } catch (IOException e) {
+ System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
+ } finally {
+ try {
+ if(mavenWrapperPropertyFileInputStream != null) {
+ mavenWrapperPropertyFileInputStream.close();
+ }
+ } catch (IOException e) {
+ // Ignore ...
+ }
+ }
+ }
+ System.out.println("- Downloading from: " + url);
+
+ File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
+ if(!outputFile.getParentFile().exists()) {
+ if(!outputFile.getParentFile().mkdirs()) {
+ System.out.println(
+ "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
+ }
+ }
+ System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
+ try {
+ downloadFileFromURL(url, outputFile);
+ System.out.println("Done");
+ System.exit(0);
+ } catch (Throwable e) {
+ System.out.println("- Error downloading");
+ e.printStackTrace();
+ System.exit(1);
+ }
+ }
+
+ private static void downloadFileFromURL(String urlString, File destination) throws Exception {
+ if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
+ String username = System.getenv("MVNW_USERNAME");
+ char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
+ Authenticator.setDefault(new Authenticator() {
+ @Override
+ protected PasswordAuthentication getPasswordAuthentication() {
+ return new PasswordAuthentication(username, password);
+ }
+ });
+ }
+ URL website = new URL(urlString);
+ ReadableByteChannel rbc;
+ rbc = Channels.newChannel(website.openStream());
+ FileOutputStream fos = new FileOutputStream(destination);
+ fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
+ fos.close();
+ rbc.close();
+ }
+
+}
diff --git a/.mvn/wrapper/maven-wrapper.jar b/.mvn/wrapper/maven-wrapper.jar
index 5fd4d5023..2cc7d4a55 100644
Binary files a/.mvn/wrapper/maven-wrapper.jar and b/.mvn/wrapper/maven-wrapper.jar differ
diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties
index 6686a643d..642d572ce 100644
--- a/.mvn/wrapper/maven-wrapper.properties
+++ b/.mvn/wrapper/maven-wrapper.properties
@@ -1,18 +1,2 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# https://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.0/apache-maven-3.9.0-bin.zip
-wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar
+distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
+wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
diff --git a/.sdkmanrc b/.sdkmanrc
deleted file mode 100644
index 415f90832..000000000
--- a/.sdkmanrc
+++ /dev/null
@@ -1,3 +0,0 @@
-# Enable auto-env through the sdkman_auto_env config
-# Add key=value pairs of SDKs to use below
-java=17.0.1-tem
diff --git a/.settings.xml b/.settings.xml
deleted file mode 100644
index 248255ff7..000000000
--- a/.settings.xml
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
- repo.spring.io
- ${env.CI_DEPLOY_USERNAME}
- ${env.CI_DEPLOY_PASSWORD}
-
-
-
-
-
- spring
- true
-
-
- spring-snapshots
- Spring Snapshots
- https://repo.spring.io/snapshot
-
- true
-
-
-
- spring-milestones
- Spring Milestones
- https://repo.spring.io/libs-milestone-local
-
- false
-
-
-
- spring-releases
- Spring Releases
- https://repo.spring.io/release
-
- false
-
-
-
-
-
- spring-snapshots
- Spring Snapshots
- https://repo.spring.io/snapshot
-
- true
-
-
-
- spring-milestones
- Spring Milestones
- https://repo.spring.io/libs-milestone-local
-
- false
-
-
-
-
-
-
diff --git a/LICENSE.txt b/LICENSE.txt
deleted file mode 100644
index 62589edd1..000000000
--- a/LICENSE.txt
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- https://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- https://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/README.adoc b/README.adoc
index ba34bba3e..e0fd60033 100644
--- a/README.adoc
+++ b/README.adoc
@@ -1,629 +1,23 @@
-////
-DO NOT EDIT THIS FILE. IT WAS GENERATED.
-Manual changes to this file will be lost when it is generated again.
-Edit the files in the src/main/asciidoc/ directory instead.
-////
+= Spring Cloud Zookeeper Docs Build
+You're currently viewing the Antora playbook branch.
+The playbook branch hosts the docs build that is used to build and publish the production docs site.
-image::https://travis-ci.org/spring-cloud/spring-cloud-zookeeper.svg?branch=master[Build Status, link=https://travis-ci.org/spring-cloud/spring-cloud-zookeeper]
+The Spring Cloud Zookeeper reference docs are built using https://antora.org[Antora].
+This README covers how to build the docs in a software branch as well as how to build the production docs site locally.
+== Building the Site
+You can build the entire site by invoking the following on the docs-build branch and then viewing the site at `target/site/index.html`
-:doctype: book
-:idprefix:
-:idseparator: -
-:toc: left
-:toclevels: 4
-:tabsize: 4
-:numbered:
-:sectanchors:
-:sectnums:
-:icons: font
-:hide-uri-scheme:
-:docinfo: shared,private
-
-:sc-ext: java
-:project-full-name: Spring Cloud Zookeeper
-
-This project provides Zookeeper integrations for Spring Boot applications through
-autoconfiguration and binding to the Spring Environment and other Spring programming model
-idioms. With a few annotations, you can quickly enable and configure the common patterns
-inside your application and build large distributed systems with Zookeeper based
-components. The provided patterns include Service Discovery and Configuration. The project
-also provides client-side load-balancing via integration with Spring Cloud LoadBalancer.
-
-
-:doctype: book
-:idprefix:
-:idseparator: -
-:toc: left
-:toclevels: 4
-:tabsize: 4
-:numbered:
-:sectanchors:
-:sectnums:
-:icons: font
-:hide-uri-scheme:
-:docinfo: shared,private
-
-:sc-ext: java
-:project-full-name: Spring Cloud Zookeeper
-
-== Quick Start
-
-This quick start walks through using Spring Cloud Zookeeper for Service Discovery and Distributed Configuration.
-
-First, run Zookeeper on your machine. Then you can access it and use it as a Service Registry and Configuration source with Spring Cloud Zookeeper.
-
-=== Discovery Client Usage
-
-To use these features in an application, you can build it as a Spring Boot application that depends on `spring-cloud-zookeeper-core` and `spring-cloud-zookeeper-discovery`.
-The most convenient way to add the dependency is with a Spring Boot starter: `org.springframework.cloud:spring-cloud-starter-zookeeper-discovery`.
-We recommend using dependency management and `spring-boot-starter-parent`.
-The following example shows a typical Maven configuration:
-
-[source,xml,indent=0]
-.pom.xml
-----
-
-
- org.springframework.boot
- spring-boot-starter-parent
- {spring-boot-version}
-
-
-
-
-
- org.springframework.cloud
- spring-cloud-starter-zookeeper-discovery
-
-
- org.springframework.boot
- spring-boot-starter-test
- test
-
-
-
-
-
- org.springframework.cloud
- spring-cloud-dependencies
- ${spring-cloud.version}
- pom
- import
-
-
-
-
-
-
- org.springframework.boot
- spring-boot-maven-plugin
-
-
-
-
-----
-
-The following example shows a typical Gradle setup:
-
-[source,groovy,indent=0]
-.build.gradle
-----
-plugins {
- id 'org.springframework.boot' version ${spring-boot-version}
- id 'io.spring.dependency-management' version ${spring-dependency-management-version}
- id 'java'
-}
-
-repositories {
- mavenCentral()
-}
-
-dependencies {
- implementation 'org.springframework.cloud:spring-cloud-starter-zookeeper-discovery'
- testImplementation 'org.springframework.boot:spring-boot-starter-test'
-}
-dependencyManagement {
- imports {
- mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
- }
-}
-----
-
-WARNING: Depending on the version you are using, you might need to adjust Apache Zookeeper version used in your project.
-You can read more about it in the <>.
-
-Now you can create a standard Spring Boot application, such as the following HTTP server:
-
-----
-@SpringBootApplication
-@RestController
-public class Application {
-
- @GetMapping("/")
- public String home() {
- return "Hello World!";
- }
-
- public static void main(String[] args) {
- SpringApplication.run(Application.class, args);
- }
-
-}
-----
-
-When this HTTP server runs, it connects to Zookeeper, which runs on the default local port (2181).
-To modify the startup behavior, you can change the location of Zookeeper by using `application.properties`, as shown in the following example:
-
-----
-spring:
- cloud:
- zookeeper:
- connect-string: localhost:2181
-----
-
-You can now use `DiscoveryClient`, `@LoadBalanced RestTemplate`, or `@LoadBalanced WebClient.Builder` to retrieve services and instances data from Zookeeper, as shown in the following example:
-
-[source,java,indent=0]
-----
-@Autowired
-private DiscoveryClient discoveryClient;
-
-public String serviceUrl() {
- List list = discoveryClient.getInstances("STORES");
- if (list != null && list.size() > 0 ) {
- return list.get(0).getUri().toString();
- }
- return null;
-}
+[source,bash]
----
-
-=== Distributed Configuration Usage
-
-To use these features in an application, you can build it as a Spring Boot application that depends on `spring-cloud-zookeeper-core` and `spring-cloud-zookeeper-config`.
-The most convenient way to add the dependency is with a Spring Boot starter: `org.springframework.cloud:spring-cloud-starter-zookeeper-config`.
-We recommend using dependency management and `spring-boot-starter-parent`.
-The following example shows a typical Maven configuration:
-
-[source,xml,indent=0]
-.pom.xml
-----
-
-
- org.springframework.boot
- spring-boot-starter-parent
- {spring-boot-version}
-
-
-
-
-
- org.springframework.cloud
- spring-cloud-starter-zookeeper-config
-
-
- org.springframework.boot
- spring-boot-starter-test
- test
-
-
-
-
-
- org.springframework.cloud
- spring-cloud-dependencies
- ${spring-cloud.version}
- pom
- import
-
-
-
-
-
-
- org.springframework.boot
- spring-boot-maven-plugin
-
-
-
-
-----
-
-The following example shows a typical Gradle setup:
-
-[source,groovy,indent=0]
-.build.gradle
-----
-plugins {
- id 'org.springframework.boot' version ${spring-boot-version}
- id 'io.spring.dependency-management' version ${spring-dependency-management-version}
- id 'java'
-}
-
-repositories {
- mavenCentral()
-}
-
-dependencies {
- implementation 'org.springframework.cloud:spring-cloud-starter-zookeeper-config'
- testImplementation 'org.springframework.boot:spring-boot-starter-test'
-}
-dependencyManagement {
- imports {
- mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
- }
-}
-----
-
-WARNING: Depending on the version you are using, you might need to adjust Apache Zookeeper version used in your project.
-You can read more about it in the <>.
-
-Now you can create a standard Spring Boot application, such as the following HTTP server:
-
-----
-@SpringBootApplication
-@RestController
-public class Application {
-
- @GetMapping("/")
- public String home() {
- return "Hello World!";
- }
-
- public static void main(String[] args) {
- SpringApplication.run(Application.class, args);
- }
-
-}
+./mvnw antora
----
-The application retrieves configuration data from Zookeeper.
-
-WARNING: If you use Spring Cloud Zookeeper Config, you need to set the `spring.config.import` property in order to bind to Zookeeper.
-You can read more about it in the <>.
-
-== Zookeeper overview
-
-ZooKeeper is a centralized service for maintaining configuration information, naming, providing distributed synchronization, and providing group services.
-See the
-https://zookeeper.apache.org[Zookeeper site] for more information.
-Spring Cloud Zookeeper also builds on the https://curator.apache.org[Apache Curator] project, which started life at Netflix.
-
-== Spring Cloud Zookeeper Features
-
-Spring Cloud Zookeeper includes the following features:
-
-* Spring Cloud `DiscoveryClient` implementation (supports Spring Cloud LoadBalancer)
-* Zookeeper-based `PropertySource` loaded during the 'bootstrap' phase
-
-== Running the Sample
-
-. https://zookeeper.apache.org/doc/current/zookeeperStarted.html#sc_Download[Install
-zookeeper] (On a mac with homebrew, use `brew install zookeeper`).
-. https://zookeeper.apache.org/doc/current/zookeeperStarted.html#sc_InstallingSingleMode[Start
-zookeeper].
-. https://zookeeper.apache.org/doc/current/zookeeperStarted.html#sc_ConnectingToZooKeeper[Verify
-zookeeper is running].
-. Run `mvn --settings .settings.xml package`.
-Doing so brings in the required Spring Cloud Maven repositories and Build.
-. Run `java -jar spring-cloud-zookeeper-sample/target/spring-cloud-zookeeper-sample-1.2.0.BUILD-SNAPSHOT.jar`.
-. Visit http://localhost:8080 to verify that `{"serviceId":"testZookeeperApp","host":"","port":8080}` works.
-. Run `java -jar spring-cloud-zookeeper-sample/target/spring-cloud-zookeeper-sample-1.2.0.BUILD-SNAPSHOT.jar --server.port=8081`
-. Visit http://localhost:8080 again to verify that `{"serviceId":"testZookeeperApp","host":"","port":8081}` eventually shows up in the results in a round-robin fashion. (It may take a minute or so.)
-
-== Building
-
-:jdkversion: 17
-
-=== Basic Compile and Test
-
-To build the source you will need to install JDK {jdkversion}.
-
-Spring Cloud uses Maven for most build-related activities, and you
-should be able to get off the ground quite quickly by cloning the
-project you are interested in and typing
+== Building a Specific Branch
+[source,bash]
----
-$ ./mvnw install
+./mvnw antora
----
-
-NOTE: You can also install Maven (>=3.3.3) yourself and run the `mvn` command
-in place of `./mvnw` in the examples below. If you do that you also
-might need to add `-P spring` if your local Maven settings do not
-contain repository declarations for spring pre-release artifacts.
-
-NOTE: Be aware that you might need to increase the amount of memory
-available to Maven by setting a `MAVEN_OPTS` environment variable with
-a value like `-Xmx512m -XX:MaxPermSize=128m`. We try to cover this in
-the `.mvn` configuration, so if you find you have to do it to make a
-build succeed, please raise a ticket to get the settings added to
-source control.
-
-The projects that require middleware (i.e. Redis) for testing generally
-require that a local instance of [Docker](https://www.docker.com/get-started) is installed and running.
-
-
-=== Documentation
-
-The spring-cloud-build module has a "docs" profile, and if you switch
-that on it will try to build asciidoc sources from
-`src/main/asciidoc`. As part of that process it will look for a
-`README.adoc` and process it by loading all the includes, but not
-parsing or rendering it, just copying it to `${main.basedir}`
-(defaults to `${basedir}`, i.e. the root of the project). If there are
-any changes in the README it will then show up after a Maven build as
-a modified file in the correct place. Just commit it and push the change.
-
-=== Working with the code
-If you don't have an IDE preference we would recommend that you use
-https://www.springsource.com/developer/sts[Spring Tools Suite] or
-https://eclipse.org[Eclipse] when working with the code. We use the
-https://eclipse.org/m2e/[m2eclipse] eclipse plugin for maven support. Other IDEs and tools
-should also work without issue as long as they use Maven 3.3.3 or better.
-
-==== Activate the Spring Maven profile
-Spring Cloud projects require the 'spring' Maven profile to be activated to resolve
-the spring milestone and snapshot repositories. Use your preferred IDE to set this
-profile to be active, or you may experience build errors.
-
-==== Importing into eclipse with m2eclipse
-We recommend the https://eclipse.org/m2e/[m2eclipse] eclipse plugin when working with
-eclipse. If you don't already have m2eclipse installed it is available from the "eclipse
-marketplace".
-
-NOTE: Older versions of m2e do not support Maven 3.3, so once the
-projects are imported into Eclipse you will also need to tell
-m2eclipse to use the right profile for the projects. If you
-see many different errors related to the POMs in the projects, check
-that you have an up to date installation. If you can't upgrade m2e,
-add the "spring" profile to your `settings.xml`. Alternatively you can
-copy the repository settings from the "spring" profile of the parent
-pom into your `settings.xml`.
-
-==== Importing into eclipse without m2eclipse
-If you prefer not to use m2eclipse you can generate eclipse project metadata using the
-following command:
-
-[indent=0]
-----
- $ ./mvnw eclipse:eclipse
-----
-
-The generated eclipse projects can be imported by selecting `import existing projects`
-from the `file` menu.
-
-
-== Contributing
-
-:spring-cloud-build-branch: master
-
-Spring Cloud is released under the non-restrictive Apache 2.0 license,
-and follows a very standard Github development process, using Github
-tracker for issues and merging pull requests into master. If you want
-to contribute even something trivial please do not hesitate, but
-follow the guidelines below.
-
-=== Sign the Contributor License Agreement
-Before we accept a non-trivial patch or pull request we will need you to sign the
-https://cla.pivotal.io/sign/spring[Contributor License Agreement].
-Signing the contributor's agreement does not grant anyone commit rights to the main
-repository, but it does mean that we can accept your contributions, and you will get an
-author credit if we do. Active contributors might be asked to join the core team, and
-given the ability to merge pull requests.
-
-=== Code of Conduct
-This project adheres to the Contributor Covenant https://github.com/spring-cloud/spring-cloud-build/blob/master/docs/src/main/asciidoc/code-of-conduct.adoc[code of
-conduct]. By participating, you are expected to uphold this code. Please report
-unacceptable behavior to spring-code-of-conduct@pivotal.io.
-
-=== Code Conventions and Housekeeping
-None of these is essential for a pull request, but they will all help. They can also be
-added after the original pull request but before a merge.
-
-* Use the Spring Framework code format conventions. If you use Eclipse
- you can import formatter settings using the
- `eclipse-code-formatter.xml` file from the
- https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-dependencies-parent/eclipse-code-formatter.xml[Spring
- Cloud Build] project. If using IntelliJ, you can use the
- https://plugins.jetbrains.com/plugin/6546[Eclipse Code Formatter
- Plugin] to import the same file.
-* Make sure all new `.java` files to have a simple Javadoc class comment with at least an
- `@author` tag identifying you, and preferably at least a paragraph on what the class is
- for.
-* Add the ASF license header comment to all new `.java` files (copy from existing files
- in the project)
-* Add yourself as an `@author` to the .java files that you modify substantially (more
- than cosmetic changes).
-* Add some Javadocs and, if you change the namespace, some XSD doc elements.
-* A few unit tests would help a lot as well -- someone has to do it.
-* If no-one else is using your branch, please rebase it against the current master (or
- other target branch in the main project).
-* When writing a commit message please follow https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html[these conventions],
- if you are fixing an existing issue please add `Fixes gh-XXXX` at the end of the commit
- message (where XXXX is the issue number).
-
-=== Checkstyle
-
-Spring Cloud Build comes with a set of checkstyle rules. You can find them in the `spring-cloud-build-tools` module. The most notable files under the module are:
-
-.spring-cloud-build-tools/
-----
-└── src
- ├── checkstyle
- │ └── checkstyle-suppressions.xml <3>
- └── main
- └── resources
- ├── checkstyle-header.txt <2>
- └── checkstyle.xml <1>
-----
-<1> Default Checkstyle rules
-<2> File header setup
-<3> Default suppression rules
-
-==== Checkstyle configuration
-
-Checkstyle rules are *disabled by default*. To add checkstyle to your project just define the following properties and plugins.
-
-.pom.xml
-----
-
-true <1>
- true
- <2>
- true
- <3>
-
-
-
-
- <4>
- io.spring.javaformat
- spring-javaformat-maven-plugin
-
- <5>
- org.apache.maven.plugins
- maven-checkstyle-plugin
-
-
-
-
-
- <5>
- org.apache.maven.plugins
- maven-checkstyle-plugin
-
-
-
-
-----
-<1> Fails the build upon Checkstyle errors
-<2> Fails the build upon Checkstyle violations
-<3> Checkstyle analyzes also the test sources
-<4> Add the Spring Java Format plugin that will reformat your code to pass most of the Checkstyle formatting rules
-<5> Add checkstyle plugin to your build and reporting phases
-
-If you need to suppress some rules (e.g. line length needs to be longer), then it's enough for you to define a file under `${project.root}/src/checkstyle/checkstyle-suppressions.xml` with your suppressions. Example:
-
-.projectRoot/src/checkstyle/checkstyle-suppresions.xml
-----
-
-
-
-
-
-
-----
-
-It's advisable to copy the `${spring-cloud-build.rootFolder}/.editorconfig` and `${spring-cloud-build.rootFolder}/.springformat` to your project. That way, some default formatting rules will be applied. You can do so by running this script:
-
-```bash
-$ curl https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/.editorconfig -o .editorconfig
-$ touch .springformat
-```
-
-=== IDE setup
-
-==== Intellij IDEA
-
-In order to setup Intellij you should import our coding conventions, inspection profiles and set up the checkstyle plugin.
-The following files can be found in the https://github.com/spring-cloud/spring-cloud-build/tree/master/spring-cloud-build-tools[Spring Cloud Build] project.
-
-.spring-cloud-build-tools/
-----
-└── src
- ├── checkstyle
- │ └── checkstyle-suppressions.xml <3>
- └── main
- └── resources
- ├── checkstyle-header.txt <2>
- ├── checkstyle.xml <1>
- └── intellij
- ├── Intellij_Project_Defaults.xml <4>
- └── Intellij_Spring_Boot_Java_Conventions.xml <5>
-----
-<1> Default Checkstyle rules
-<2> File header setup
-<3> Default suppression rules
-<4> Project defaults for Intellij that apply most of Checkstyle rules
-<5> Project style conventions for Intellij that apply most of Checkstyle rules
-
-.Code style
-
-image::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/{spring-cloud-build-branch}/docs/src/main/asciidoc/images/intellij-code-style.png[Code style]
-
-Go to `File` -> `Settings` -> `Editor` -> `Code style`. There click on the icon next to the `Scheme` section. There, click on the `Import Scheme` value and pick the `Intellij IDEA code style XML` option. Import the `spring-cloud-build-tools/src/main/resources/intellij/Intellij_Spring_Boot_Java_Conventions.xml` file.
-
-.Inspection profiles
-
-image::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/{spring-cloud-build-branch}/docs/src/main/asciidoc/images/intellij-inspections.png[Code style]
-
-Go to `File` -> `Settings` -> `Editor` -> `Inspections`. There click on the icon next to the `Profile` section. There, click on the `Import Profile` and import the `spring-cloud-build-tools/src/main/resources/intellij/Intellij_Project_Defaults.xml` file.
-
-.Checkstyle
-
-To have Intellij work with Checkstyle, you have to install the `Checkstyle` plugin. It's advisable to also install the `Assertions2Assertj` to automatically convert the JUnit assertions
-
-image::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/{spring-cloud-build-branch}/docs/src/main/asciidoc/images/intellij-checkstyle.png[Checkstyle]
-
-Go to `File` -> `Settings` -> `Other settings` -> `Checkstyle`. There click on the `+` icon in the `Configuration file` section. There, you'll have to define where the checkstyle rules should be picked from. In the image above, we've picked the rules from the cloned Spring Cloud Build repository. However, you can point to the Spring Cloud Build's GitHub repository (e.g. for the `checkstyle.xml` : `https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/main/resources/checkstyle.xml`). We need to provide the following variables:
-
-- `checkstyle.header.file` - please point it to the Spring Cloud Build's, `spring-cloud-build-tools/src/main/resources/checkstyle-header.txt` file either in your cloned repo or via the `https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/main/resources/checkstyle-header.txt` URL.
-- `checkstyle.suppressions.file` - default suppressions. Please point it to the Spring Cloud Build's, `spring-cloud-build-tools/src/checkstyle/checkstyle-suppressions.xml` file either in your cloned repo or via the `https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/checkstyle/checkstyle-suppressions.xml` URL.
-- `checkstyle.additional.suppressions.file` - this variable corresponds to suppressions in your local project. E.g. you're working on `spring-cloud-contract`. Then point to the `project-root/src/checkstyle/checkstyle-suppressions.xml` folder. Example for `spring-cloud-contract` would be: `/home/username/spring-cloud-contract/src/checkstyle/checkstyle-suppressions.xml`.
-
-IMPORTANT: Remember to set the `Scan Scope` to `All sources` since we apply checkstyle rules for production and test sources.
-
-=== Duplicate Finder
-
-Spring Cloud Build brings along the `basepom:duplicate-finder-maven-plugin`, that enables flagging duplicate and conflicting classes and resources on the java classpath.
-
-==== Duplicate Finder configuration
-
-Duplicate finder is *enabled by default* and will run in the `verify` phase of your Maven build, but it will only take effect in your project if you add the `duplicate-finder-maven-plugin` to the `build` section of the projecst's `pom.xml`.
-
-.pom.xml
-[source,xml]
-----
-
-
-
- org.basepom.maven
- duplicate-finder-maven-plugin
-
-
-
-----
-
-For other properties, we have set defaults as listed in the https://github.com/basepom/duplicate-finder-maven-plugin/wiki[plugin documentation].
-
-You can easily override them but setting the value of the selected property prefixed with `duplicate-finder-maven-plugin`. For example, set `duplicate-finder-maven-plugin.skip` to `true` in order to skip duplicates check in your build.
-
-If you need to add `ignoredClassPatterns` or `ignoredResourcePatterns` to your setup, make sure to add them in the plugin configuration section of your project:
-
-[source,xml]
-----
-
-
-
- org.basepom.maven
- duplicate-finder-maven-plugin
-
-
- org.joda.time.base.BaseDateTime
- .*module-info
-
-
- changelog.txt
-
-
-
-
-
-
-
-----
-
diff --git a/SECURITY.md b/SECURITY.md
deleted file mode 100644
index 046859563..000000000
--- a/SECURITY.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# Security Policy
-
-## Reporting a Vulnerability
-
-To report security vulnerabilities, please go to https://pivotal.io/security.
diff --git a/docs/antora-playbook.yml b/antora-playbook.yml
similarity index 61%
rename from docs/antora-playbook.yml
rename to antora-playbook.yml
index 9a70e676c..06396649a 100644
--- a/docs/antora-playbook.yml
+++ b/antora-playbook.yml
@@ -6,38 +6,39 @@ antora:
- '@antora/collector-extension'
- '@antora/atlas-extension'
- require: '@springio/antora-extensions/root-component-extension'
- root_component_name: 'PROJECT_WITHOUT_SPRING'
- # FIXME: Run antora once using this extension to migrate to the Asciidoc Tabs syntax
- # and then remove this extension
- - require: '@springio/antora-extensions/tabs-migration-extension'
- unwrap_example_block: always
- save_result: true
+ root_component_name: 'cloud-zookeeper'
site:
- title: PROJECT_FULL_NAME
- url: https://docs.spring.io/PROJECT_NAME/reference/
+ title: Spring Cloud Zookeeper
+ url: https://docs.spring.io/spring-cloud-zookeeper/reference
+ robots: allow
+git:
+ ensure_git_suffix: false
content:
sources:
- - url: ./..
- branches: HEAD
+ - url: https://github.com/spring-cloud/spring-cloud-zookeeper
+ # Refname matching:
+ # https://docs.antora.org/antora/latest/playbook/content-refname-matching/
+ branches: [ main ]
+ tags: [ '({4..9}).+({1..9}).+({0..9})?(-{RC,M}+({0..9}))', '!4.1.0-M1' ]
start_path: docs
- worktrees: true
asciidoc:
attributes:
page-stackoverflow-url: https://stackoverflow.com/tags/spring-cloud
page-pagination: ''
hide-uri-scheme: '@'
tabs-sync-option: '@'
- chomp: 'all'
extensions:
- '@asciidoctor/tabs'
- '@springio/asciidoctor-extensions'
- sourcemap: true
urls:
+ latest_version_segment_strategy: redirect:to
latest_version_segment: ''
+ redirect_facility: httpd
+ui:
+ bundle:
+ url: https://github.com/spring-io/antora-ui-spring/releases/download/v0.3.5/ui-bundle.zip
+ snapshot: true
runtime:
log:
failure_level: warn
format: pretty
-ui:
- bundle:
- url: https://github.com/spring-io/antora-ui-spring/releases/download/v0.3.5/ui-bundle.zip
diff --git a/docker-compose.yml b/docker-compose.yml
deleted file mode 100644
index 829bce759..000000000
--- a/docker-compose.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-zookeeper:
- image: zookeeper
- ports:
- - "2181:2181"
diff --git a/docs/.flattened-pom.xml b/docs/.flattened-pom.xml
new file mode 100644
index 000000000..ec32b55fe
--- /dev/null
+++ b/docs/.flattened-pom.xml
@@ -0,0 +1,106 @@
+
+
+ 4.0.0
+
+ org.springframework.cloud
+ spring-cloud-zookeeper
+ 4.1.0-SNAPSHOT
+
+ org.springframework.cloud
+ spring-cloud-zookeeper-docs
+ 4.1.0-SNAPSHOT
+ Spring Cloud Zookeeper Docs
+ Spring Cloud Docs
+ https://spring.io/spring-cloud/spring-cloud-zookeeper/spring-cloud-zookeeper-docs
+
+ Pivotal Software, Inc.
+ https://www.spring.io
+
+
+
+ Apache License, Version 2.0
+ https://www.apache.org/licenses/LICENSE-2.0
+ Copyright 2014-2021 the original author or authors.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied.
+
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+
+
+
+ dsyer
+ Dave Syer
+ dsyer at pivotal.io
+ Pivotal Software, Inc.
+ https://www.spring.io
+
+ lead
+
+
+
+ sgibb
+ Spencer Gibb
+ sgibb at pivotal.io
+ Pivotal Software, Inc.
+ https://www.spring.io
+
+ lead
+
+
+
+ mgrzejszczak
+ Marcin Grzejszczak
+ mgrzejszczak at pivotal.io
+ Pivotal Software, Inc.
+ https://www.spring.io
+
+ developer
+
+
+
+ rbaxter
+ Ryan Baxter
+ rbaxter at pivotal.io
+ Pivotal Software, Inc.
+ https://www.spring.io
+
+ developer
+
+
+
+ omaciaszeksharma
+ Olga Maciaszek-Sharma
+ omaciaszeksharma at pivotal.io
+ Pivotal Software, Inc.
+ https://www.spring.io
+
+ developer
+
+
+
+
+ scm:git:git://github.com/spring-cloud/spring-cloud-zookeeper.git/spring-cloud-zookeeper-docs
+ scm:git:ssh://git@github.com/spring-cloud/spring-cloud-zookeeper.git/spring-cloud-zookeeper-docs
+ https://github.com/spring-cloud/spring-cloud-zookeeper/spring-cloud-zookeeper-docs
+
+
+
+ org.springframework.cloud
+ spring-cloud-starter-zookeeper-all
+ 4.1.0-SNAPSHOT
+ compile
+
+
+
diff --git a/docs/.github/workflows/deploy-docs.yml b/docs/.github/workflows/deploy-docs.yml
deleted file mode 100644
index be4b92dfc..000000000
--- a/docs/.github/workflows/deploy-docs.yml
+++ /dev/null
@@ -1,32 +0,0 @@
-name: Deploy Docs
-on:
- push:
- branches-ignore: [ gh-pages ]
- tags: '**'
- repository_dispatch:
- types: request-build-reference # legacy
- #schedule:
- #- cron: '0 10 * * *' # Once per day at 10am UTC
- workflow_dispatch:
-permissions:
- actions: write
-jobs:
- build:
- runs-on: ubuntu-latest
- # if: github.repository_owner == 'spring-cloud'
- steps:
- - name: Checkout
- uses: actions/checkout@v3
- with:
- ref: docs-build
- fetch-depth: 1
- - name: Dispatch (partial build)
- if: github.ref_type == 'branch'
- env:
- GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: gh workflow run deploy-docs.yml -r $(git rev-parse --abbrev-ref HEAD) -f build-refname=${{ github.ref_name }}
- - name: Dispatch (full build)
- if: github.ref_type == 'tag'
- env:
- GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: gh workflow run deploy-docs.yml -r $(git rev-parse --abbrev-ref HEAD)
diff --git a/docs/antora.yml b/docs/antora.yml
deleted file mode 100644
index 15b346da0..000000000
--- a/docs/antora.yml
+++ /dev/null
@@ -1,12 +0,0 @@
-name: PROJECT_WITHOUT_SPRING
-version: true
-title: PROJECT_NAME
-nav:
- - modules/ROOT/nav.adoc
-ext:
- collector:
- run:
- command: ./mvnw --no-transfer-progress -B process-resources -Pdocs -pl docs -Dantora-maven-plugin.phase=none -Dgenerate-docs.phase=none -Dgenerate-readme.phase=none -Dgenerate-cloud-resources.phase=none -Dmaven-dependency-plugin-for-docs.phase=none -Dmaven-dependency-plugin-for-docs-classes.phase=none -DskipTests
- local: true
- scan:
- dir: ./target/classes/antora-resources/
diff --git a/docs/modules/ROOT/assets/images/.gitkeep b/docs/modules/ROOT/assets/images/.gitkeep
deleted file mode 100644
index e69de29bb..000000000
diff --git a/docs/modules/ROOT/nav.adoc b/docs/modules/ROOT/nav.adoc
deleted file mode 100644
index eb712b7d8..000000000
--- a/docs/modules/ROOT/nav.adoc
+++ /dev/null
@@ -1,18 +0,0 @@
-* xref:index.adoc[]
-* xref:spring-cloud-zookeeper.adoc[]
-** xref:spring-cloud-zookeeper/quick-start.adoc[]
-** xref:spring-cloud-zookeeper/install.adoc[]
-** xref:spring-cloud-zookeeper/discovery.adoc[]
-** xref:spring-cloud-zookeeper/other-componentes.adoc[]
-** xref:spring-cloud-zookeeper/service-registry.adoc[]
-** xref:spring-cloud-zookeeper/dependencies.adoc[]
-** xref:spring-cloud-zookeeper/dependency-watcher.adoc[]
-** xref:spring-cloud-zookeeper/config.adoc[]
-* xref:intro.adoc[]
-* xref:_attributes.adoc[]
-* xref:quickstart.adoc[]
-* xref:README.adoc[]
-* xref:_configprops.adoc[]
-* xref:appendix.adoc[]
-* xref:sagan-boot.adoc[]
-* xref:sagan-index.adoc[]
diff --git a/docs/modules/ROOT/pages/README.adoc b/docs/modules/ROOT/pages/README.adoc
deleted file mode 100644
index bc52c72b7..000000000
--- a/docs/modules/ROOT/pages/README.adoc
+++ /dev/null
@@ -1,49 +0,0 @@
-image::https://travis-ci.org/spring-cloud/spring-cloud-zookeeper.svg?branch=master[Build Status, link=https://travis-ci.org/spring-cloud/spring-cloud-zookeeper]
-
-
-
-[[quick-start]]
-= Quick Start
-
-
-[[zookeeper-overview]]
-= Zookeeper overview
-
-ZooKeeper is a centralized service for maintaining configuration information, naming, providing distributed synchronization, and providing group services.
-See the
-https://zookeeper.apache.org[Zookeeper site] for more information.
-Spring Cloud Zookeeper also builds on the https://curator.apache.org[Apache Curator] project, which started life at Netflix.
-
-[[spring-cloud-zookeeper-features]]
-= Spring Cloud Zookeeper Features
-
-Spring Cloud Zookeeper includes the following features:
-
-* Spring Cloud `DiscoveryClient` implementation (supports Spring Cloud LoadBalancer)
-* Zookeeper-based `PropertySource` loaded during the 'bootstrap' phase
-
-[[running-the-sample]]
-= Running the Sample
-
-. https://zookeeper.apache.org/doc/current/zookeeperStarted.html#sc_Download[Install
-zookeeper] (On a mac with homebrew, use `brew install zookeeper`).
-. https://zookeeper.apache.org/doc/current/zookeeperStarted.html#sc_InstallingSingleMode[Start
-zookeeper].
-. https://zookeeper.apache.org/doc/current/zookeeperStarted.html#sc_ConnectingToZooKeeper[Verify
-zookeeper is running].
-. Run `mvn --settings .settings.xml package`.
-Doing so brings in the required Spring Cloud Maven repositories and Build.
-. Run `java -jar spring-cloud-zookeeper-sample/target/spring-cloud-zookeeper-sample-1.2.0.BUILD-SNAPSHOT.jar`.
-. Visit http://localhost:8080 to verify that `{"serviceId":"testZookeeperApp","host":"","port":8080}` works.
-. Run `java -jar spring-cloud-zookeeper-sample/target/spring-cloud-zookeeper-sample-1.2.0.BUILD-SNAPSHOT.jar --server.port=8081`
-. Visit http://localhost:8080 again to verify that `{"serviceId":"testZookeeperApp","host":"","port":8081}` eventually shows up in the results in a round-robin fashion. (It may take a minute or so.)
-
-[[building]]
-= Building
-
-include::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/docs/src/main/asciidoc/building.adoc[]
-
-[[contributing]]
-= Contributing
-
-include::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/docs/src/main/asciidoc/contributing.adoc[]
diff --git a/docs/modules/ROOT/pages/_attributes.adoc b/docs/modules/ROOT/pages/_attributes.adoc
deleted file mode 100644
index c26a2d097..000000000
--- a/docs/modules/ROOT/pages/_attributes.adoc
+++ /dev/null
@@ -1,14 +0,0 @@
-
-:doctype: book
-:idprefix:
-:idseparator: -
-:tabsize: 4
-:numbered:
-:sectanchors:
-:sectnums:
-:icons: font
-:hide-uri-scheme:
-:docinfo: shared,private
-
-:sc-ext: java
-:project-full-name: Spring Cloud Zookeeper
diff --git a/docs/modules/ROOT/pages/_configprops.adoc b/docs/modules/ROOT/pages/_configprops.adoc
deleted file mode 100644
index 451fd2458..000000000
--- a/docs/modules/ROOT/pages/_configprops.adoc
+++ /dev/null
@@ -1,35 +0,0 @@
-|===
-|Name | Default | Description
-
-|spring.cloud.zookeeper.base-sleep-time-ms | `+++50+++` | Initial amount of time to wait between retries.
-|spring.cloud.zookeeper.block-until-connected-unit | | The unit of time related to blocking on connection to Zookeeper.
-|spring.cloud.zookeeper.block-until-connected-wait | `+++10+++` | Wait time to block on connection to Zookeeper.
-|spring.cloud.zookeeper.config.default-context | `+++application+++` | The name of the default context.
-|spring.cloud.zookeeper.config.enabled | `+++true+++` |
-|spring.cloud.zookeeper.config.fail-fast | `+++true+++` | Throw exceptions during config lookup if true, otherwise, log warnings.
-|spring.cloud.zookeeper.config.name | | Alternative to spring.application.name to use in looking up values in zookeeper.
-|spring.cloud.zookeeper.config.profile-separator | `+++,+++` | Separator for profile appended to the application name.
-|spring.cloud.zookeeper.config.root | `+++config+++` | Root folder where the configuration for Zookeeper is kept.
-|spring.cloud.zookeeper.connect-string | `+++localhost:2181+++` | Connection string to the Zookeeper cluster.
-|spring.cloud.zookeeper.connection-timeout | | The configured connection timeout in milliseconds.
-|spring.cloud.zookeeper.dependencies | | Mapping of alias to ZookeeperDependency. From LoadBalancer perspective the alias is actually serviceID since SC LoadBalancer can't accept nested structures in serviceID.
-|spring.cloud.zookeeper.dependency-configurations | |
-|spring.cloud.zookeeper.dependency-names | |
-|spring.cloud.zookeeper.discovery.enabled | `+++true+++` |
-|spring.cloud.zookeeper.discovery.initial-status | | The initial status of this instance (defaults to {@link StatusConstants#STATUS_UP}).
-|spring.cloud.zookeeper.discovery.instance-host | | Predefined host with which a service can register itself in Zookeeper. Corresponds to the {code address} from the URI spec.
-|spring.cloud.zookeeper.discovery.instance-id | | Id used to register with zookeeper. Defaults to a random UUID.
-|spring.cloud.zookeeper.discovery.instance-port | | Port to register the service under (defaults to listening port).
-|spring.cloud.zookeeper.discovery.instance-ssl-port | | Ssl port of the registered service.
-|spring.cloud.zookeeper.discovery.metadata | | Gets the metadata name/value pairs associated with this instance. This information is sent to zookeeper and can be used by other instances.
-|spring.cloud.zookeeper.discovery.order | `+++0+++` | Order of the discovery client used by `CompositeDiscoveryClient` for sorting available clients.
-|spring.cloud.zookeeper.discovery.register | `+++true+++` | Register as a service in zookeeper.
-|spring.cloud.zookeeper.discovery.root | `+++/services+++` | Root Zookeeper folder in which all instances are registered.
-|spring.cloud.zookeeper.discovery.uri-spec | `+++{scheme}://{address}:{port}+++` | The URI specification to resolve during service registration in Zookeeper.
-|spring.cloud.zookeeper.enabled | `+++true+++` | Is Zookeeper enabled.
-|spring.cloud.zookeeper.max-retries | `+++10+++` | Max number of times to retry.
-|spring.cloud.zookeeper.max-sleep-ms | `+++500+++` | Max time in ms to sleep on each retry.
-|spring.cloud.zookeeper.prefix | | Common prefix that will be applied to all Zookeeper dependencies' paths.
-|spring.cloud.zookeeper.session-timeout | | The configured/negotiated session timeout in milliseconds. Please refer to Curator's Tech Note 14 to understand how Curator implements connection sessions. @see Curator's Tech Note 14
-
-|===
diff --git a/docs/modules/ROOT/pages/appendix.adoc b/docs/modules/ROOT/pages/appendix.adoc
deleted file mode 100644
index eef1c9056..000000000
--- a/docs/modules/ROOT/pages/appendix.adoc
+++ /dev/null
@@ -1,13 +0,0 @@
-:numbered!:
-[appendix]
-[[common-application-properties]]
-= Common application properties
-:page-section-summary-toc: 1
-
-
-Various properties can be specified inside your `application.properties` file, inside your `application.yml` file, or as command line switches.
-This appendix provides a list of common {project-full-name} properties and references to the underlying classes that consume them.
-
-NOTE: Property contributions can come from additional jar files on your classpath, so you should not consider this an exhaustive list.
-Also, you can define your own properties.
-
diff --git a/docs/modules/ROOT/pages/index.adoc b/docs/modules/ROOT/pages/index.adoc
deleted file mode 100755
index e69de29bb..000000000
diff --git a/docs/modules/ROOT/pages/intro.adoc b/docs/modules/ROOT/pages/intro.adoc
deleted file mode 100644
index b6e6b4c4b..000000000
--- a/docs/modules/ROOT/pages/intro.adoc
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-This project provides Zookeeper integrations for Spring Boot applications through
-autoconfiguration and binding to the Spring Environment and other Spring programming model
-idioms. With a few annotations, you can quickly enable and configure the common patterns
-inside your application and build large distributed systems with Zookeeper based
-components. The provided patterns include Service Discovery and Configuration. The project
-also provides client-side load-balancing via integration with Spring Cloud LoadBalancer.
diff --git a/docs/modules/ROOT/pages/quickstart.adoc b/docs/modules/ROOT/pages/quickstart.adoc
deleted file mode 100644
index 0ae4f4c9f..000000000
--- a/docs/modules/ROOT/pages/quickstart.adoc
+++ /dev/null
@@ -1,234 +0,0 @@
-This quick start walks through using Spring Cloud Zookeeper for Service Discovery and Distributed Configuration.
-
-First, run Zookeeper on your machine. Then you can access it and use it as a Service Registry and Configuration source with Spring Cloud Zookeeper.
-
-[[discovery-client-usage]]
-= Discovery Client Usage
-
-To use these features in an application, you can build it as a Spring Boot application that depends on `spring-cloud-zookeeper-core` and `spring-cloud-zookeeper-discovery`.
-The most convenient way to add the dependency is with a Spring Boot starter: `org.springframework.cloud:spring-cloud-starter-zookeeper-discovery`.
-We recommend using dependency management and `spring-boot-starter-parent`.
-The following example shows a typical Maven configuration:
-
-[source,xml,indent=0]
-.pom.xml
-----
-
-
- org.springframework.boot
- spring-boot-starter-parent
- {spring-boot-version}
-
-
-
-
-
- org.springframework.cloud
- spring-cloud-starter-zookeeper-discovery
-
-
- org.springframework.boot
- spring-boot-starter-test
- test
-
-
-
-
-
- org.springframework.cloud
- spring-cloud-dependencies
- ${spring-cloud.version}
- pom
- import
-
-
-
-
-
-
- org.springframework.boot
- spring-boot-maven-plugin
-
-
-
-
-----
-
-The following example shows a typical Gradle setup:
-
-[source,groovy,indent=0]
-.build.gradle
-----
-plugins {
- id 'org.springframework.boot' version ${spring-boot-version}
- id 'io.spring.dependency-management' version ${spring-dependency-management-version}
- id 'java'
-}
-
-repositories {
- mavenCentral()
-}
-
-dependencies {
- implementation 'org.springframework.cloud:spring-cloud-starter-zookeeper-discovery'
- testImplementation 'org.springframework.boot:spring-boot-starter-test'
-}
-dependencyManagement {
- imports {
- mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
- }
-}
-----
-
-WARNING: Depending on the version you are using, you might need to adjust Apache Zookeeper version used in your project.
-You can read more about it in the xref:spring-cloud-zookeeper/install.adoc[Install Zookeeper section].
-
-Now you can create a standard Spring Boot application, such as the following HTTP server:
-
-----
-@SpringBootApplication
-@RestController
-public class Application {
-
- @GetMapping("/")
- public String home() {
- return "Hello World!";
- }
-
- public static void main(String[] args) {
- SpringApplication.run(Application.class, args);
- }
-
-}
-----
-
-When this HTTP server runs, it connects to Zookeeper, which runs on the default local port (2181).
-To modify the startup behavior, you can change the location of Zookeeper by using `application.properties`, as shown in the following example:
-
-----
-spring:
- cloud:
- zookeeper:
- connect-string: localhost:2181
-----
-
-You can now use `DiscoveryClient`, `@LoadBalanced RestTemplate`, or `@LoadBalanced WebClient.Builder` to retrieve services and instances data from Zookeeper, as shown in the following example:
-
-[source,java,indent=0]
-----
-@Autowired
-private DiscoveryClient discoveryClient;
-
-public String serviceUrl() {
- List list = discoveryClient.getInstances("STORES");
- if (list != null && list.size() > 0 ) {
- return list.get(0).getUri().toString();
- }
- return null;
-}
-----
-
-[[distributed-configuration-usage]]
-= Distributed Configuration Usage
-
-To use these features in an application, you can build it as a Spring Boot application that depends on `spring-cloud-zookeeper-core` and `spring-cloud-zookeeper-config`.
-The most convenient way to add the dependency is with a Spring Boot starter: `org.springframework.cloud:spring-cloud-starter-zookeeper-config`.
-We recommend using dependency management and `spring-boot-starter-parent`.
-The following example shows a typical Maven configuration:
-
-[source,xml,indent=0]
-.pom.xml
-----
-
-
- org.springframework.boot
- spring-boot-starter-parent
- {spring-boot-version}
-
-
-
-
-
- org.springframework.cloud
- spring-cloud-starter-zookeeper-config
-
-
- org.springframework.boot
- spring-boot-starter-test
- test
-
-
-
-
-
- org.springframework.cloud
- spring-cloud-dependencies
- ${spring-cloud.version}
- pom
- import
-
-
-
-
-
-
- org.springframework.boot
- spring-boot-maven-plugin
-
-
-
-
-----
-
-The following example shows a typical Gradle setup:
-
-[source,groovy,indent=0]
-.build.gradle
-----
-plugins {
- id 'org.springframework.boot' version ${spring-boot-version}
- id 'io.spring.dependency-management' version ${spring-dependency-management-version}
- id 'java'
-}
-
-repositories {
- mavenCentral()
-}
-
-dependencies {
- implementation 'org.springframework.cloud:spring-cloud-starter-zookeeper-config'
- testImplementation 'org.springframework.boot:spring-boot-starter-test'
-}
-dependencyManagement {
- imports {
- mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
- }
-}
-----
-
-WARNING: Depending on the version you are using, you might need to adjust Apache Zookeeper version used in your project.
-You can read more about it in the xref:spring-cloud-zookeeper/install.adoc[Install Zookeeper section].
-
-Now you can create a standard Spring Boot application, such as the following HTTP server:
-
-----
-@SpringBootApplication
-@RestController
-public class Application {
-
- @GetMapping("/")
- public String home() {
- return "Hello World!";
- }
-
- public static void main(String[] args) {
- SpringApplication.run(Application.class, args);
- }
-
-}
-----
-
-The application retrieves configuration data from Zookeeper.
-
-WARNING: If you use Spring Cloud Zookeeper Config, you need to set the `spring.config.import` property in order to bind to Zookeeper.
-You can read more about it in the xref:spring-cloud-zookeeper/config.adoc#config-data-import[Spring Boot Config Data Import section].
diff --git a/docs/modules/ROOT/pages/sagan-boot.adoc b/docs/modules/ROOT/pages/sagan-boot.adoc
deleted file mode 100644
index 8b1378917..000000000
--- a/docs/modules/ROOT/pages/sagan-boot.adoc
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/docs/modules/ROOT/pages/sagan-index.adoc b/docs/modules/ROOT/pages/sagan-index.adoc
deleted file mode 100644
index 1da6a8884..000000000
--- a/docs/modules/ROOT/pages/sagan-index.adoc
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-Spring Cloud Zookeeper provides http://zookeeper.apache.org/[Apache Zookeeper] integrations for Spring Boot apps through autoconfiguration and binding to the Spring Environment and other Spring programming model idioms. With a few simple annotations you can quickly enable and configure the common patterns inside your application and build large distributed systems with Zookeeper. The patterns provided include Service Discovery and Distributed Configuration.
-
-## Features
-
-* Service Discovery: instances can be registered with Zookeeper and clients can discover the instances using Spring-managed beans
- * Supports Spring Cloud LoadBalancer - client-side load-balancing solution
- * Supports Spring Cloud OpenFeign
-* Distributed Configuration: using Zookeeper as a data store
-
-## Quick Start
-
-As long as Spring Cloud Zookeeper, http://curator.apache.org/[Apache Curator] and the Zookeeper Java Client are on the
-classpath any Spring Boot application with `@EnableDiscoveryClient` will try to contact a Zookeeper
-agent on `localhost:2181` (the default value of
-`zookeeper.connectString`).
-
-```java
-@Configuration
-@EnableAutoConfiguration
-@EnableDiscoveryClient
-@RestController
-public class Application {
-
- @RequestMapping("/")
- public String home() {
- return "Hello World";
- }
-
- public static void main(String[] args) {
- SpringApplication.run(Application.class, args);
- }
-
-}
-```
-
-A local Zookeeper server must be running. See the http://zookeeper.apache.org/[Zookeeper documentation] on how to run a Zookeeper server.
diff --git a/docs/modules/ROOT/pages/spring-cloud-zookeeper.adoc b/docs/modules/ROOT/pages/spring-cloud-zookeeper.adoc
deleted file mode 100644
index 7ebf8bafe..000000000
--- a/docs/modules/ROOT/pages/spring-cloud-zookeeper.adoc
+++ /dev/null
@@ -1,7 +0,0 @@
-
-[[spring-cloud-zookeeper]]
-= Spring Cloud Zookeeper
-:page-section-summary-toc: 1
-
-
-
diff --git a/docs/modules/ROOT/pages/spring-cloud-zookeeper/config.adoc b/docs/modules/ROOT/pages/spring-cloud-zookeeper/config.adoc
deleted file mode 100644
index a4f5b4a4d..000000000
--- a/docs/modules/ROOT/pages/spring-cloud-zookeeper/config.adoc
+++ /dev/null
@@ -1,143 +0,0 @@
-[[spring-cloud-zookeeper-config]]
-= Distributed Configuration with Zookeeper
-
-Zookeeper provides a
-https://zookeeper.apache.org/doc/current/zookeeperOver.html#sc_dataModelNameSpace[hierarchical namespace]
-that lets clients store arbitrary data, such as configuration data. Spring Cloud Zookeeper
-Config is an alternative to the
-https://github.com/spring-cloud/spring-cloud-config[Config Server and Client].
-Configuration is loaded into the Spring Environment during the special "`bootstrap`"
-phase. Configuration is stored in the `/config` namespace by default. Multiple
-`PropertySource` instances are created, based on the application's name and the active
-profiles, to mimic the Spring Cloud Config order of resolving properties. For example, an
-application with a name of `testApp` and with the `dev` profile has the following property
-sources created for it:
-
-* `config/testApp,dev`
-* `config/testApp`
-* `config/application,dev`
-* `config/application`
-
-The most specific property source is at the top, with the least specific at the bottom.
-Properties in the `config/application` namespace apply to all applications that use
-zookeeper for configuration. Properties in the `config/testApp` namespace are available
-only to the instances of the service named `testApp`.
-
-Configuration is currently read on startup of the application. Sending a HTTP `POST`
-request to `/refresh` causes the configuration to be reloaded. Watching the configuration
-namespace (which Zookeeper supports) is not currently implemented.
-
-[[activating]]
-== Activating
-
-Including a dependency on
-`org.springframework.cloud:spring-cloud-starter-zookeeper-config` enables
-autoconfiguration that sets up Spring Cloud Zookeeper Config.
-
-CAUTION: When working with version 3.4 of Zookeeper you need to change
-the way you include the dependency as described xref:spring-cloud-zookeeper/install.adoc[here].
-
-[[config-data-import]]
-== Spring Boot Config Data Import
-
-Spring Boot 2.4 introduced a new way to import configuration data via the `spring.config.import` property. This is now the default way to get configuration from Zookeeper.
-
-To optionally connect to Zookeeper for configuration set the following in application.properties:
-
-.application.properties
-[source,properties]
-----
-spring.config.import=optional:zookeeper:
-----
-
-This will connect to Zookeeper at the default location of "localhost:2181". Removing the `optional:` prefix will cause Zookeeper Config to fail if it is unable to connect to Zookeeper. To change the connection properties of Zookeeper Config either set `spring.cloud.zookeeper.connect-string` or add the connect string to the `spring.config.import` statement such as, `spring.config.import=optional:zookeeper:myhost:2818`. The location in the import property has precedence over the `connect-string` property.
-
-Zookeeper Config will try to load values from four automatic contexts based on `spring.cloud.zookeeper.config.name` (which defaults to the value of the `spring.application.name` property) and `spring.cloud.zookeeper.config.default-context` (which defaults to `application`). If you want to specify the contexts rather than using the computed ones, you can add that information to the `spring.config.import` statement.
-
-.application.properties
-[source,properties]
-----
-spring.config.import=optional:zookeeper:myhost:2181/contextone;/context/two
-----
-
-This will optionally load configuration only from `/contextone` and `/context/two`.
-
-NOTE: A `bootstrap` file (properties or yaml) is *not* needed for the Spring Boot Config Data method of import via `spring.config.import`.
-
-[[customizing]]
-== Customizing
-
-Zookeeper Config may be customized by setting the following properties:
-
-[source,yml,indent=0]
-----
-spring:
- cloud:
- zookeeper:
- config:
- enabled: true
- root: configuration
- defaultContext: apps
- profileSeparator: '::'
-----
-
-* `enabled`: Setting this value to `false` disables Zookeeper Config.
-* `root`: Sets the base namespace for configuration values.
-* `defaultContext`: Sets the name used by all applications.
-* `profileSeparator`: Sets the value of the separator used to separate the profile name in
-property sources with profiles.
-
-CAUTION: If you have set `spring.cloud.bootstrap.enabled=true` or `spring.config.use-legacy-processing=true`, or included `spring-cloud-starter-bootstrap`, then the above values will need to be placed in `bootstrap.yml` instead of `application.yml`.
-
-[[access-control-lists-acls]]
-== Access Control Lists (ACLs)
-
-You can add authentication information for Zookeeper ACLs by calling the `addAuthInfo`
-method of a `CuratorFramework` bean. One way to accomplish this is to provide your own
-`CuratorFramework` bean, as shown in the following example:
-
-[source,java,indent=0]
-----
-@BoostrapConfiguration
-public class CustomCuratorFrameworkConfig {
-
- @Bean
- public CuratorFramework curatorFramework() {
- CuratorFramework curator = new CuratorFramework();
- curator.addAuthInfo("digest", "user:password".getBytes());
- return curator;
- }
-
-}
-----
-Consult
-https://github.com/spring-cloud/spring-cloud-zookeeper/blob/master/spring-cloud-zookeeper-core/src/main/java/org/springframework/cloud/zookeeper/ZookeeperAutoConfiguration.java[the ZookeeperAutoConfiguration class]
-to see how the `CuratorFramework` bean's default configuration.
-
-Alternatively, you can add your credentials from a class that depends on the existing
-`CuratorFramework` bean, as shown in the following example:
-
-[source,java,indent=0]
-----
-@BoostrapConfiguration
-public class DefaultCuratorFrameworkConfig {
-
- public ZookeeperConfig(CuratorFramework curator) {
- curator.addAuthInfo("digest", "user:password".getBytes());
- }
-
-}
-----
-
-The creation of this bean must occur during the boostrapping phase. You can register
-configuration classes to run during this phase by annotating them with
-`@BootstrapConfiguration` and including them in a comma-separated list that you set as the
-value of the `org.springframework.cloud.bootstrap.BootstrapConfiguration` property in the
-`resources/META-INF/spring.factories` file, as shown in the following example:
-
-.resources/META-INF/spring.factories
-----
-org.springframework.cloud.bootstrap.BootstrapConfiguration=\
-my.project.CustomCuratorFrameworkConfig,\
-my.project.DefaultCuratorFrameworkConfig
-----
diff --git a/docs/modules/ROOT/pages/spring-cloud-zookeeper/dependencies.adoc b/docs/modules/ROOT/pages/spring-cloud-zookeeper/dependencies.adoc
deleted file mode 100644
index 9c6606b66..000000000
--- a/docs/modules/ROOT/pages/spring-cloud-zookeeper/dependencies.adoc
+++ /dev/null
@@ -1,208 +0,0 @@
-[[spring-cloud-zookeeper-dependencies]]
-= Zookeeper Dependencies
-
-The following topics cover how to work with Spring Cloud Zookeeper dependencies:
-
-* xref:spring-cloud-zookeeper/dependencies.adoc#spring-cloud-zookeeper-dependencies-using[Using the Zookeeper Dependencies]
-* xref:spring-cloud-zookeeper/dependencies.adoc#spring-cloud-zookeeper-dependencies-activating[Activating Zookeeper Dependencies]
-* xref:spring-cloud-zookeeper/dependencies.adoc#spring-cloud-zookeeper-dependencies-setting-up[Setting up Zookeeper Dependencies]
-* xref:spring-cloud-zookeeper/dependencies.adoc#spring-cloud-zookeeper-dependencies-configuring[Configuring Spring Cloud Zookeeper Dependencies]
-
-[[spring-cloud-zookeeper-dependencies-using]]
-== Using the Zookeeper Dependencies
-
-Spring Cloud Zookeeper gives you a possibility to provide dependencies of your application
-as properties. As dependencies, you can understand other applications that are registered
-in Zookeeper and which you would like to call through
-https://github.com/spring-cloud/spring-cloud-netflix/blob/master/docs/src/main/asciidoc/spring-cloud-netflix.adoc#spring-cloud-feign[Feign]
-(a REST client builder),
-https://github.com/spring-cloud/spring-cloud-netflix/blob/master/docs/src/main/ascii[Spring
-`RestTemplate`] and
-https://cloud.spring.io/spring-cloud-commons/reference/html/#loadbalanced-webclient[Spring WebFlux].
-
-You can also use the Zookeeper Dependency Watchers functionality to control and monitor
-the state of your dependencies.
-
-[[spring-cloud-zookeeper-dependencies-activating]]
-== Activating Zookeeper Dependencies
-
-Including a dependency on
-`org.springframework.cloud:spring-cloud-starter-zookeeper-discovery` enables
-autoconfiguration that sets up Spring Cloud Zookeeper Dependencies. Even if you provide
-the dependencies in your properties, you can turn off the dependencies. To do so, set the
-`spring.cloud.zookeeper.dependency.enabled` property to false (it defaults to `true`).
-
-[[spring-cloud-zookeeper-dependencies-setting-up]]
-== Setting up Zookeeper Dependencies
-
-Consider the following example of dependency representation:
-
-[source,yml,indent=0]
-.application.yml
-----
-spring.application.name: yourServiceName
-spring.cloud.zookeeper:
- dependencies:
- newsletter:
- path: /path/where/newsletter/has/registered/in/zookeeper
- loadBalancerType: ROUND_ROBIN
- contentTypeTemplate: application/vnd.newsletter.$version+json
- version: v1
- headers:
- header1:
- - value1
- header2:
- - value2
- required: false
- stubs: org.springframework:foo:stubs
- mailing:
- path: /path/where/mailing/has/registered/in/zookeeper
- loadBalancerType: ROUND_ROBIN
- contentTypeTemplate: application/vnd.mailing.$version+json
- version: v1
- required: true
-----
-
-The next few sections go through each part of the dependency one by one. The root property
-name is `spring.cloud.zookeeper.dependencies`.
-
-[[spring-cloud-zookeeper-dependencies-setting-up-aliases]]
-=== Aliases
-
-Below the root property you have to represent each dependency as an alias.
-This is due to the constraints of Spring Cloud LoadBalancer, which requires that the application ID be placed in the URL.
-Consequently, you cannot pass any complex path, suchas `/myApp/myRoute/name`).
-The alias is the name you use instead of the `serviceId` for `DiscoveryClient`, `Feign`, or
-`RestTemplate`.
-
-In the previous examples, the aliases are `newsletter` and `mailing`.
-The following example shows Feign usage with a `newsletter` alias:
-
-[source,java,indent=0]
-----
-@FeignClient("newsletter")
-public interface NewsletterService {
- @RequestMapping(method = RequestMethod.GET, value = "/newsletter")
- String getNewsletters();
-}
-----
-
-[[path]]
-=== Path
-
-The path is represented by the `path` YAML property and is the path under which the dependency is registered under Zookeeper.
-As described in the
-xref:spring-cloud-zookeeper/dependencies.adoc#spring-cloud-zookeeper-dependencies-setting-up-aliases[previous section], Spring Cloud LoadBalancer operates on URLs.
-As a result, this path is not compliant with its requirement.
-That is why Spring Cloud Zookeeper maps the alias to the proper path.
-
-[[load-balancer-type]]
-=== Load Balancer Type
-
-The load balancer type is represented by `loadBalancerType` YAML property.
-
-If you know what kind of load-balancing strategy has to be applied when calling this particular dependency, you can provide it in the YAML file, and it is automatically applied.
-You can choose one of the following load balancing strategies:
-
-* STICKY: Once chosen, the instance is always called.
-* RANDOM: Picks an instance randomly.
-* ROUND_ROBIN: Iterates over instances over and over again.
-
-[[content-type-template-and-version]]
-=== `Content-Type` Template and Version
-
-The `Content-Type` template and version are represented by the `contentTypeTemplate` and
-`version` YAML properties.
-
-If you version your API in the `Content-Type` header, you do not want to add this header
-to each of your requests. Also, if you want to call a new version of the API, you do not
-want to roam around your code to bump up the API version. That is why you can provide a
-`contentTypeTemplate` with a special `$version` placeholder. That placeholder will be filled by the value of the
-`version` YAML property. Consider the following example of a `contentTypeTemplate`:
-
-----
-application/vnd.newsletter.$version+json
-----
-
-Further consider the following `version`:
-
-----
-v1
-----
-
-The combination of `contentTypeTemplate` and version results in the creation of a
-`Content-Type` header for each request, as follows:
-
-----
-application/vnd.newsletter.v1+json
-----
-
-[[default-headers]]
-=== Default Headers
-
-Default headers are represented by the `headers` map in YAML.
-
-Sometimes, each call to a dependency requires setting up of some default headers. To not
-do that in code, you can set them up in the YAML file, as shown in the following example
-`headers` section:
-
-[source,yml,indent=0]
-----
-headers:
- Accept:
- - text/html
- - application/xhtml+xml
- Cache-Control:
- - no-cache
-----
-
-That `headers` section results in adding the `Accept` and `Cache-Control` headers with
-appropriate list of values in your HTTP request.
-
-[[required-dependencies]]
-=== Required Dependencies
-
-Required dependencies are represented by `required` property in YAML.
-
-If one of your dependencies is required to be up when your application boots, you can set
-the `required: true` property in the YAML file.
-
-If your application cannot localize the required dependency during boot time, it throws an
-exception, and the Spring Context fails to set up. In other words, your application cannot
-start if the required dependency is not registered in Zookeeper.
-
-You can read more about Spring Cloud Zookeeper Presence Checker
-xref:spring-cloud-zookeeper/dependency-watcher.adoc#spring-cloud-zookeeper-dependency-watcher-presence-checker[later in this document].
-
-[[stubs]]
-=== Stubs
-
-You can provide a colon-separated path to the JAR containing stubs of the dependency, as
-shown in the following example:
-
-`stubs: org.springframework:myApp:stubs`
-
-where:
-
-* `org.springframework` is the `groupId`.
-* `myApp` is the `artifactId`.
-* `stubs` is the classifier. (Note that `stubs` is the default value.)
-
-Because `stubs` is the default classifier, the preceding example is equal to the following
-example:
-
-`stubs: org.springframework:myApp`
-
-[[spring-cloud-zookeeper-dependencies-configuring]]
-== Configuring Spring Cloud Zookeeper Dependencies
-
-You can set the following properties to enable or disable parts of Zookeeper Dependencies functionalities:
-
-* `spring.cloud.zookeeper.dependencies`: If you do not set this property, you cannot use Zookeeper Dependencies.
-* `spring.cloud.zookeeper.dependency.loadbalancer.enabled` (enabled by default): Turns on Zookeeper-specific custom load-balancing strategies, including `ZookeeperServiceInstanceListSupplier` and dependency-based load-balanced `RestTemplate` setup.
-* `spring.cloud.zookeeper.dependency.headers.enabled` (enabled by default): This property registers a `FeignBlockingLoadBalancerClient` that automatically appends appropriate headers and content types with their versions, as presented in the Dependency configuration.
-Without this setting, those two parameters do not work.
-* `spring.cloud.zookeeper.dependency.resttemplate.enabled` (enabled by default): When enabled, this property modifies the request headers of a `@LoadBalanced`-annotated
-`RestTemplate` such that it passes headers and content type with the version set in dependency configuration.
-Without this setting, those two parameters do not work.
-
diff --git a/docs/modules/ROOT/pages/spring-cloud-zookeeper/dependency-watcher.adoc b/docs/modules/ROOT/pages/spring-cloud-zookeeper/dependency-watcher.adoc
deleted file mode 100644
index 24017e101..000000000
--- a/docs/modules/ROOT/pages/spring-cloud-zookeeper/dependency-watcher.adoc
+++ /dev/null
@@ -1,53 +0,0 @@
-[[spring-cloud-zookeeper-dependency-watcher]]
-= Spring Cloud Zookeeper Dependency Watcher
-
-The Dependency Watcher mechanism lets you register listeners to your dependencies. The
-functionality is, in fact, an implementation of the `Observator` pattern. When a
-dependency changes, its state (to either UP or DOWN), some custom logic can be applied.
-
-[[activating]]
-== Activating
-
-Spring Cloud Zookeeper Dependencies functionality needs to be enabled for you to use the
-Dependency Watcher mechanism.
-// TODO: How can the reader do that?
-
-[[registering-a-listener]]
-== Registering a Listener
-
-To register a listener, you must implement an interface called
-`org.springframework.cloud.zookeeper.discovery.watcher.DependencyWatcherListener` and
-register it as a bean. The interface gives you one method:
-
-[source,java,indent=0]
-----
-void stateChanged(String dependencyName, DependencyState newState);
-----
-
-If you want to register a listener for a particular dependency, the `dependencyName` would
-be the discriminator for your concrete implementation. `newState` provides you with
-information about whether your dependency has changed to `CONNECTED` or `DISCONNECTED`.
-
-[[spring-cloud-zookeeper-dependency-watcher-presence-checker]]
-== Using the Presence Checker
-
-Bound with the Dependency Watcher is the functionality called Presence Checker. It lets
-you provide custom behavior when your application boots, to react according to the state
-of your dependencies.
-
-The default implementation of the abstract
-`org.springframework.cloud.zookeeper.discovery.watcher.presence.DependencyPresenceOnStartupVerifier`
-class is the
-`org.springframework.cloud.zookeeper.discovery.watcher.presence.DefaultDependencyPresenceOnStartupVerifier`,
-which works in the following way.
-
-. If the dependency is marked us `required` and is not in Zookeeper, when your application
-boots, it throws an exception and shuts down.
-. If the dependency is not `required`, the
-`org.springframework.cloud.zookeeper.discovery.watcher.presence.LogMissingDependencyChecker`
-logs that the dependency is missing at the `WARN` level.
-
-Because the `DefaultDependencyPresenceOnStartupVerifier` is registered only when there is
-no bean of type `DependencyPresenceOnStartupVerifier`, this functionality can be
-overridden.
-
diff --git a/docs/modules/ROOT/pages/spring-cloud-zookeeper/discovery.adoc b/docs/modules/ROOT/pages/spring-cloud-zookeeper/discovery.adoc
deleted file mode 100644
index 47d3a51b3..000000000
--- a/docs/modules/ROOT/pages/spring-cloud-zookeeper/discovery.adoc
+++ /dev/null
@@ -1,105 +0,0 @@
-[[spring-cloud-zookeeper-discovery]]
-= Service Discovery with Zookeeper
-
-Service Discovery is one of the key tenets of a microservice based architecture. Trying to
-hand-configure each client or some form of convention can be difficult to do and can be
-brittle. https://curator.apache.org[Curator](A Java library for Zookeeper) provides Service
-Discovery through a https://curator.apache.org/curator-x-discovery/[Service Discovery
-Extension]. Spring Cloud Zookeeper uses this extension for service registration and
-discovery.
-
-[[activating]]
-== Activating
-
-Including a dependency on
-`org.springframework.cloud:spring-cloud-starter-zookeeper-discovery` enables
-autoconfiguration that sets up Spring Cloud Zookeeper Discovery.
-
-NOTE: For web functionality, you still need to include
-`org.springframework.boot:spring-boot-starter-web`.
-
-CAUTION: When working with version 3.4 of Zookeeper you need to change
-the way you include the dependency as described xref:spring-cloud-zookeeper/install.adoc[here].
-
-[[registering-with-zookeeper]]
-== Registering with Zookeeper
-
-When a client registers with Zookeeper, it provides metadata (such as host and port, ID,
-and name) about itself.
-
-The following example shows a Zookeeper client:
-
-[source,java,indent=0]
-----
-@SpringBootApplication
-@RestController
-public class Application {
-
- @RequestMapping("/")
- public String home() {
- return "Hello world";
- }
-
- public static void main(String[] args) {
- new SpringApplicationBuilder(Application.class).web(true).run(args);
- }
-
-}
-----
-
-NOTE: The preceding example is a normal Spring Boot application.
-
-If Zookeeper is located somewhere other than `localhost:2181`, the configuration must
-provide the location of the server, as shown in the following example:
-
-[source,yml,indent=0]
-.application.yml
-----
-spring:
- cloud:
- zookeeper:
- connect-string: localhost:2181
-----
-
-CAUTION: If you use xref:spring-cloud-zookeeper/config.adoc[Spring Cloud Zookeeper Config], the
-values shown in the preceding example need to be in `bootstrap.yml` instead of
-`application.yml`.
-
-The default service name, instance ID, and port (taken from the `Environment`) are
-`${spring.application.name}`, the Spring Context ID, and `${server.port}`, respectively.
-
-Having `spring-cloud-starter-zookeeper-discovery` on the classpath makes the app into both
-a Zookeeper "`service`" (that is, it registers itself) and a "`client`" (that is, it can
-query Zookeeper to locate other services).
-
-If you would like to disable the Zookeeper Discovery Client, you can set
-`spring.cloud.zookeeper.discovery.enabled` to `false`.
-
-[[using-the-discoveryclient]]
-== Using the DiscoveryClient
-
-Spring Cloud has support for
-https://github.com/spring-cloud/spring-cloud-netflix/blob/master/docs/src/main/asciidoc/spring-cloud-netflix.adoc#spring-cloud-feign[Feign]
-(a REST client builder),
-https://github.com/spring-cloud/spring-cloud-netflix/blob/master/docs/src/main/ascii[Spring
-`RestTemplate`] and
-https://cloud.spring.io/spring-cloud-commons/reference/html/#loadbalanced-webclient[Spring WebFlux], using logical service names instead of physical URLs.
-
-You can also use the `org.springframework.cloud.client.discovery.DiscoveryClient`, which
-provides a simple API for discovery clients that is not specific to Netflix, as shown in
-the following example:
-
-[source,java,indent=0]
-----
-@Autowired
-private DiscoveryClient discoveryClient;
-
-public String serviceUrl() {
- List list = discoveryClient.getInstances("STORES");
- if (list != null && list.size() > 0 ) {
- return list.get(0).getUri().toString();
- }
- return null;
-}
-----
-
diff --git a/docs/modules/ROOT/pages/spring-cloud-zookeeper/install.adoc b/docs/modules/ROOT/pages/spring-cloud-zookeeper/install.adoc
deleted file mode 100644
index d34003d75..000000000
--- a/docs/modules/ROOT/pages/spring-cloud-zookeeper/install.adoc
+++ /dev/null
@@ -1,54 +0,0 @@
-[[spring-cloud-zookeeper-install]]
-= Install Zookeeper
-
-See the https://zookeeper.apache.org/doc/current/zookeeperStarted.html[installation
-documentation] for instructions on how to install Zookeeper.
-
-Spring Cloud Zookeeper uses Apache Curator behind the scenes.
-While Zookeeper 3.5.x is still considered "beta" by the Zookeeper development team,
-the reality is that it is used in production by many users.
-However, Zookeeper 3.4.x is also used in production.
-Prior to Apache Curator 4.0, both versions of Zookeeper were supported via two versions of Apache Curator.
-Starting with Curator 4.0 both versions of Zookeeper are supported via the same Curator libraries.
-
-In case you are integrating with version 3.4 you need to change the Zookeeper dependency
-that comes shipped with `curator`, and thus `spring-cloud-zookeeper`.
-To do so simply exclude that dependency and add the 3.4.x version like shown below.
-
-.maven
-[source,xml,indent=0]
-----
-
- org.springframework.cloud
- spring-cloud-starter-zookeeper-all
-
-
- org.apache.zookeeper
- zookeeper
-
-
-
-
- org.apache.zookeeper
- zookeeper
- 3.4.12
-
-
- org.slf4j
- slf4j-log4j12
-
-
-
-----
-
-.gradle
-[source,groovy,indent=0]
-----
-compile('org.springframework.cloud:spring-cloud-starter-zookeeper-all') {
- exclude group: 'org.apache.zookeeper', module: 'zookeeper'
-}
-compile('org.apache.zookeeper:zookeeper:3.4.12') {
- exclude group: 'org.slf4j', module: 'slf4j-log4j12'
-}
-----
-
diff --git a/docs/modules/ROOT/pages/spring-cloud-zookeeper/other-componentes.adoc b/docs/modules/ROOT/pages/spring-cloud-zookeeper/other-componentes.adoc
deleted file mode 100644
index 5de6f8c2e..000000000
--- a/docs/modules/ROOT/pages/spring-cloud-zookeeper/other-componentes.adoc
+++ /dev/null
@@ -1,16 +0,0 @@
-[[spring-cloud-zookeeper-other-componentes]]
-= Using Spring Cloud Zookeeper with Spring Cloud Components
-:page-section-summary-toc: 1
-
-Feign, Spring Cloud Gateway and Spring Cloud LoadBalancer all work with Spring Cloud Zookeeper.
-
-[[spring-cloud-loadbalancer-with-zookeeper]]
-== Spring Cloud LoadBalancer with Zookeeper
-
-Spring Cloud Zookeeper provides an implementation of Spring Cloud LoadBalancer `ServiceInstanceListSupplier`.
-When you use the `spring-cloud-starter-zookeeper-discovery`, Spring Cloud LoadBalancer is autoconfigured to use the
-`ZookeeperServiceInstanceListSupplier` by default.
-
-TIP: If you were previously using the StickyRule in Zookeeper, its replacement in the current stack
-is the `SameInstancePreferenceServiceInstanceListSupplier` in SC LoadBalancer. You can read on how to set it up in the https://docs.spring.io/spring-cloud-commons/docs/current/reference/html/#spring-cloud-loadbalancer[Spring Cloud Commons documentation].
-
diff --git a/docs/modules/ROOT/pages/spring-cloud-zookeeper/quick-start.adoc b/docs/modules/ROOT/pages/spring-cloud-zookeeper/quick-start.adoc
deleted file mode 100644
index 59e051393..000000000
--- a/docs/modules/ROOT/pages/spring-cloud-zookeeper/quick-start.adoc
+++ /dev/null
@@ -1,6 +0,0 @@
-[[quick-start]]
-= Quick Start
-:page-section-summary-toc: 1
-
-include:../:quickstart.adoc[]
-
diff --git a/docs/modules/ROOT/pages/spring-cloud-zookeeper/service-registry.adoc b/docs/modules/ROOT/pages/spring-cloud-zookeeper/service-registry.adoc
deleted file mode 100644
index 88e56c060..000000000
--- a/docs/modules/ROOT/pages/spring-cloud-zookeeper/service-registry.adoc
+++ /dev/null
@@ -1,45 +0,0 @@
-[[spring-cloud-zookeeper-service-registry]]
-= Spring Cloud Zookeeper and Service Registry
-
-Spring Cloud Zookeeper implements the `ServiceRegistry` interface, letting developers
-register arbitrary services in a programmatic way.
-
-The `ServiceInstanceRegistration` class offers a `builder()` method to create a
-`Registration` object that can be used by the `ServiceRegistry`, as shown in the following
-example:
-
-[source,java,indent=0]
-----
-@Autowired
-private ZookeeperServiceRegistry serviceRegistry;
-
-public void registerThings() {
- ZookeeperRegistration registration = ServiceInstanceRegistration.builder()
- .defaultUriSpec()
- .address("anyUrl")
- .port(10)
- .name("/a/b/c/d/anotherservice")
- .build();
- this.serviceRegistry.register(registration);
-}
-----
-
-[[instance-status]]
-== Instance Status
-
-Netflix Eureka supports having instances that are `OUT_OF_SERVICE` registered with the server.
-These instances are not returned as active service instances.
-This is useful for behaviors such as blue/green deployments.
-(Note that the Curator Service Discovery recipe does not support this behavior.) Taking advantage of the flexible payload has let Spring Cloud Zookeeper implement `OUT_OF_SERVICE` by updating some specific metadata and then filtering on that metadata in the Spring Cloud LoadBalancer `ZookeeperServiceInstanceListSupplier`.
-The `ZookeeperServiceInstanceListSupplier` filters out all non-null instance statuses that do not equal `UP`.
-If the instance status field is empty, it is considered to be `UP` for backwards compatibility.
-To change the status of an instance, make a `POST` with `OUT_OF_SERVICE` to the `ServiceRegistry`
-instance status actuator endpoint, as shown in the following example:
-
-[source,sh,indent=0]
-----
-$ http POST http://localhost:8081/service-registry status=OUT_OF_SERVICE
-----
-
-NOTE: The preceding example uses the `http` command from https://httpie.org.
-
diff --git a/docs/pom.xml b/docs/pom.xml
deleted file mode 100644
index ebceb1862..000000000
--- a/docs/pom.xml
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
- 4.0.0
-
- org.springframework.cloud
- spring-cloud-zookeeper
- 4.1.0-SNAPSHOT
-
- spring-cloud-zookeeper-docs
- jar
- Spring Cloud Zookeeper Docs
- Spring Cloud Docs
-
- spring-cloud-zookeeper
- ${basedir}/..
- spring.cloud.zookeeper.*|
-
- deploy
-
- none
-
-
-
- ${project.groupId}
- spring-cloud-starter-zookeeper-all
-
-
-
- src/main/asciidoc
-
-
-
- docs
-
-
-
- pl.project13.maven
- git-commit-id-plugin
-
-
- maven-dependency-plugin
-
-
- maven-resources-plugin
-
-
- org.codehaus.mojo
- exec-maven-plugin
-
-
- org.asciidoctor
- asciidoctor-maven-plugin
-
-
- maven-antrun-plugin
-
-
- maven-deploy-plugin
-
-
-
-
-
-
diff --git a/docs/src/main/asciidoc/ghpages.sh b/docs/src/main/asciidoc/ghpages.sh
deleted file mode 100755
index d18aa88d3..000000000
--- a/docs/src/main/asciidoc/ghpages.sh
+++ /dev/null
@@ -1,330 +0,0 @@
-#!/bin/bash -x
-
-set -e
-
-# Set default props like MAVEN_PATH, ROOT_FOLDER etc.
-function set_default_props() {
- # The script should be run from the root folder
- ROOT_FOLDER=`pwd`
- echo "Current folder is ${ROOT_FOLDER}"
-
- if [[ ! -e "${ROOT_FOLDER}/.git" ]]; then
- echo "You're not in the root folder of the project!"
- exit 1
- fi
-
- # Prop that will let commit the changes
- COMMIT_CHANGES="no"
- MAVEN_PATH=${MAVEN_PATH:-}
- echo "Path to Maven is [${MAVEN_PATH}]"
- REPO_NAME=${PWD##*/}
- echo "Repo name is [${REPO_NAME}]"
- SPRING_CLOUD_STATIC_REPO=${SPRING_CLOUD_STATIC_REPO:-git@github.com:spring-cloud/spring-cloud-static.git}
- echo "Spring Cloud Static repo is [${SPRING_CLOUD_STATIC_REPO}"
-}
-
-# Check if gh-pages exists and docs have been built
-function check_if_anything_to_sync() {
- git remote set-url --push origin `git config remote.origin.url | sed -e 's/^git:/https:/'`
-
- if ! (git remote set-branches --add origin gh-pages && git fetch -q); then
- echo "No gh-pages, so not syncing"
- exit 0
- fi
-
- if ! [ -d docs/target/generated-docs ] && ! [ "${BUILD}" == "yes" ]; then
- echo "No gh-pages sources in docs/target/generated-docs, so not syncing"
- exit 0
- fi
-}
-
-function retrieve_current_branch() {
- # Code getting the name of the current branch. For master we want to publish as we did until now
- # https://stackoverflow.com/questions/1593051/how-to-programmatically-determine-the-current-checked-out-git-branch
- # If there is a branch already passed will reuse it - otherwise will try to find it
- CURRENT_BRANCH=${BRANCH}
- if [[ -z "${CURRENT_BRANCH}" ]] ; then
- CURRENT_BRANCH=$(git symbolic-ref -q HEAD)
- CURRENT_BRANCH=${CURRENT_BRANCH##refs/heads/}
- CURRENT_BRANCH=${CURRENT_BRANCH:-HEAD}
- fi
- echo "Current branch is [${CURRENT_BRANCH}]"
- git checkout ${CURRENT_BRANCH} || echo "Failed to check the branch... continuing with the script"
-}
-
-# Switches to the provided value of the release version. We always prefix it with `v`
-function switch_to_tag() {
- git checkout v${VERSION}
-}
-
-# Build the docs if switch is on
-function build_docs_if_applicable() {
- if [[ "${BUILD}" == "yes" ]] ; then
- ./mvnw clean install -P docs -pl docs -DskipTests
- fi
-}
-
-# Get the name of the `docs.main` property
-# Get allowed branches - assumes that a `docs` module is available under `docs` profile
-function retrieve_doc_properties() {
- MAIN_ADOC_VALUE=$("${MAVEN_PATH}"mvn -q \
- -Dexec.executable="echo" \
- -Dexec.args='${docs.main}' \
- --non-recursive \
- org.codehaus.mojo:exec-maven-plugin:1.3.1:exec)
- echo "Extracted 'main.adoc' from Maven build [${MAIN_ADOC_VALUE}]"
-
-
- ALLOW_PROPERTY=${ALLOW_PROPERTY:-"docs.allowed.branches"}
- ALLOWED_BRANCHES_VALUE=$("${MAVEN_PATH}"mvn -q \
- -Dexec.executable="echo" \
- -Dexec.args="\${${ALLOW_PROPERTY}}" \
- org.codehaus.mojo:exec-maven-plugin:1.3.1:exec \
- -P docs \
- -pl docs)
- echo "Extracted '${ALLOW_PROPERTY}' from Maven build [${ALLOWED_BRANCHES_VALUE}]"
-}
-
-# Stash any outstanding changes
-function stash_changes() {
- git diff-index --quiet HEAD && dirty=$? || (echo "Failed to check if the current repo is dirty. Assuming that it is." && dirty="1")
- if [ "$dirty" != "0" ]; then git stash; fi
-}
-
-# Switch to gh-pages branch to sync it with current branch
-function add_docs_from_target() {
- local DESTINATION_REPO_FOLDER
- if [[ -z "${DESTINATION}" && -z "${CLONE}" ]] ; then
- DESTINATION_REPO_FOLDER=${ROOT_FOLDER}
- elif [[ "${CLONE}" == "yes" ]]; then
- mkdir -p ${ROOT_FOLDER}/target
- local clonedStatic=${ROOT_FOLDER}/target/spring-cloud-static
- if [[ ! -e "${clonedStatic}/.git" ]]; then
- echo "Cloning Spring Cloud Static to target"
- git clone ${SPRING_CLOUD_STATIC_REPO} ${clonedStatic} && git checkout gh-pages
- else
- echo "Spring Cloud Static already cloned - will pull changes"
- cd ${clonedStatic} && git checkout gh-pages && git pull origin gh-pages
- fi
- DESTINATION_REPO_FOLDER=${clonedStatic}/${REPO_NAME}
- mkdir -p ${DESTINATION_REPO_FOLDER}
- else
- if [[ ! -e "${DESTINATION}/.git" ]]; then
- echo "[${DESTINATION}] is not a git repository"
- exit 1
- fi
- DESTINATION_REPO_FOLDER=${DESTINATION}/${REPO_NAME}
- mkdir -p ${DESTINATION_REPO_FOLDER}
- echo "Destination was provided [${DESTINATION}]"
- fi
- cd ${DESTINATION_REPO_FOLDER}
- git checkout gh-pages
- git pull origin gh-pages
-
- # Add git branches
- ###################################################################
- if [[ -z "${VERSION}" ]] ; then
- copy_docs_for_current_version
- else
- copy_docs_for_provided_version
- fi
- commit_changes_if_applicable
-}
-
-
-# Copies the docs by using the retrieved properties from Maven build
-function copy_docs_for_current_version() {
- if [[ "${CURRENT_BRANCH}" == "master" ]] ; then
- echo -e "Current branch is master - will copy the current docs only to the root folder"
- for f in docs/target/generated-docs/*; do
- file=${f#docs/target/generated-docs/*}
- if ! git ls-files -i -o --exclude-standard --directory | grep -q ^$file$; then
- # Not ignored...
- cp -rf $f ${ROOT_FOLDER}/
- git add -A ${ROOT_FOLDER}/$file
- fi
- done
- COMMIT_CHANGES="yes"
- else
- echo -e "Current branch is [${CURRENT_BRANCH}]"
- # https://stackoverflow.com/questions/29300806/a-bash-script-to-check-if-a-string-is-present-in-a-comma-separated-list-of-strin
- if [[ ",${ALLOWED_BRANCHES_VALUE}," = *",${CURRENT_BRANCH},"* ]] ; then
- mkdir -p ${ROOT_FOLDER}/${CURRENT_BRANCH}
- echo -e "Branch [${CURRENT_BRANCH}] is allowed! Will copy the current docs to the [${CURRENT_BRANCH}] folder"
- for f in docs/target/generated-docs/*; do
- file=${f#docs/target/generated-docs/*}
- if ! git ls-files -i -o --exclude-standard --directory | grep -q ^$file$; then
- # Not ignored...
- # We want users to access 1.0.0.RELEASE/ instead of 1.0.0.RELEASE/spring-cloud.sleuth.html
- if [[ "${file}" == "${MAIN_ADOC_VALUE}.html" ]] ; then
- # We don't want to copy the spring-cloud-sleuth.html
- # we want it to be converted to index.html
- cp -rf $f ${ROOT_FOLDER}/${CURRENT_BRANCH}/index.html
- git add -A ${ROOT_FOLDER}/${CURRENT_BRANCH}/index.html
- else
- cp -rf $f ${ROOT_FOLDER}/${CURRENT_BRANCH}
- git add -A ${ROOT_FOLDER}/${CURRENT_BRANCH}/$file
- fi
- fi
- done
- COMMIT_CHANGES="yes"
- else
- echo -e "Branch [${CURRENT_BRANCH}] is not on the allow list! Check out the Maven [${ALLOW_PROPERTY}] property in
- [docs] module available under [docs] profile. Won't commit any changes to gh-pages for this branch."
- fi
- fi
-}
-
-# Copies the docs by using the explicitly provided version
-function copy_docs_for_provided_version() {
- local FOLDER=${DESTINATION_REPO_FOLDER}/${VERSION}
- mkdir -p ${FOLDER}
- echo -e "Current tag is [v${VERSION}] Will copy the current docs to the [${FOLDER}] folder"
- for f in ${ROOT_FOLDER}/docs/target/generated-docs/*; do
- file=${f#${ROOT_FOLDER}/docs/target/generated-docs/*}
- copy_docs_for_branch ${file} ${FOLDER}
- done
- COMMIT_CHANGES="yes"
- CURRENT_BRANCH="v${VERSION}"
-}
-
-# Copies the docs from target to the provided destination
-# Params:
-# $1 - file from target
-# $2 - destination to which copy the files
-function copy_docs_for_branch() {
- local file=$1
- local destination=$2
- if ! git ls-files -i -o --exclude-standard --directory | grep -q ^${file}$; then
- # Not ignored...
- # We want users to access 1.0.0.RELEASE/ instead of 1.0.0.RELEASE/spring-cloud.sleuth.html
- if [[ ("${file}" == "${MAIN_ADOC_VALUE}.html") || ("${file}" == "${REPO_NAME}.html") ]] ; then
- # We don't want to copy the spring-cloud-sleuth.html
- # we want it to be converted to index.html
- cp -rf $f ${destination}/index.html
- git add -A ${destination}/index.html
- else
- cp -rf $f ${destination}
- git add -A ${destination}/$file
- fi
- fi
-}
-
-function commit_changes_if_applicable() {
- if [[ "${COMMIT_CHANGES}" == "yes" ]] ; then
- COMMIT_SUCCESSFUL="no"
- git commit -a -m "Sync docs from ${CURRENT_BRANCH} to gh-pages" && COMMIT_SUCCESSFUL="yes" || echo "Failed to commit changes"
-
- # Uncomment the following push if you want to auto push to
- # the gh-pages branch whenever you commit to master locally.
- # This is a little extreme. Use with care!
- ###################################################################
- if [[ "${COMMIT_SUCCESSFUL}" == "yes" ]] ; then
- git push origin gh-pages
- fi
- fi
-}
-
-# Switch back to the previous branch and exit block
-function checkout_previous_branch() {
- # If -version was provided we need to come back to root project
- cd ${ROOT_FOLDER}
- git checkout ${CURRENT_BRANCH} || echo "Failed to check the branch... continuing with the script"
- if [ "$dirty" != "0" ]; then git stash pop; fi
- exit 0
-}
-
-# Assert if properties have been properly passed
-function assert_properties() {
-echo "VERSION [${VERSION}], DESTINATION [${DESTINATION}], CLONE [${CLONE}]"
-if [[ "${VERSION}" != "" && (-z "${DESTINATION}" && -z "${CLONE}") ]] ; then echo "Version was set but destination / clone was not!"; exit 1;fi
-if [[ ("${DESTINATION}" != "" && "${CLONE}" != "") && -z "${VERSION}" ]] ; then echo "Destination / clone was set but version was not!"; exit 1;fi
-if [[ "${DESTINATION}" != "" && "${CLONE}" == "yes" ]] ; then echo "Destination and clone was set. Pick one!"; exit 1;fi
-}
-
-# Prints the usage
-function print_usage() {
-cat </`
-- if the destination switch is passed (-d) then the script will check if the provided dir is a git repo and then will
- switch to gh-pages of that repo and copy the generated docs to `docs//`
-
-USAGE:
-
-You can use the following options:
-
--v|--version - the script will apply the whole procedure for a particular library version
--d|--destination - the root of destination folder where the docs should be copied. You have to use the full path.
- E.g. point to spring-cloud-static folder. Can't be used with (-c)
--b|--build - will run the standard build process after checking out the branch
--c|--clone - will automatically clone the spring-cloud-static repo instead of providing the destination.
- Obviously can't be used with (-d)
-
-EOF
-}
-
-
-# ==========================================
-# ____ ____ _____ _____ _____ _______
-# / ____|/ ____| __ \|_ _| __ \__ __|
-# | (___ | | | |__) | | | | |__) | | |
-# \___ \| | | _ / | | | ___/ | |
-# ____) | |____| | \ \ _| |_| | | |
-# |_____/ \_____|_| \_\_____|_| |_|
-#
-# ==========================================
-
-while [[ $# > 0 ]]
-do
-key="$1"
-case ${key} in
- -v|--version)
- VERSION="$2"
- shift # past argument
- ;;
- -d|--destination)
- DESTINATION="$2"
- shift # past argument
- ;;
- -b|--build)
- BUILD="yes"
- ;;
- -c|--clone)
- CLONE="yes"
- ;;
- -h|--help)
- print_usage
- exit 0
- ;;
- *)
- echo "Invalid option: [$1]"
- print_usage
- exit 1
- ;;
-esac
-shift # past argument or value
-done
-
-assert_properties
-set_default_props
-check_if_anything_to_sync
-if [[ -z "${VERSION}" ]] ; then
- retrieve_current_branch
-else
- switch_to_tag
-fi
-build_docs_if_applicable
-retrieve_doc_properties
-stash_changes
-add_docs_from_target
-checkout_previous_branch
diff --git a/docs/src/main/asciidoc/images/.gitkeep b/docs/src/main/asciidoc/images/.gitkeep
deleted file mode 100644
index e69de29bb..000000000
diff --git a/mvnw b/mvnw
index a08b219e3..41c0f0c23 100755
--- a/mvnw
+++ b/mvnw
@@ -8,7 +8,7 @@
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
-# https://www.apache.org/licenses/LICENSE-2.0
+# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
@@ -19,7 +19,7 @@
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
-# Maven2 Start Up Batch script
+# Maven Start Up Batch script
#
# Required ENV vars:
# ------------------
@@ -54,38 +54,16 @@ case "`uname`" in
CYGWIN*) cygwin=true ;;
MINGW*) mingw=true;;
Darwin*) darwin=true
- #
- # Look for the Apple JDKs first to preserve the existing behaviour, and then look
- # for the new JDKs provided by Oracle.
- #
- if [ -z "$JAVA_HOME" ] && [ -L /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK ] ; then
- #
- # Apple JDKs
- #
- export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home
- fi
-
- if [ -z "$JAVA_HOME" ] && [ -L /System/Library/Java/JavaVirtualMachines/CurrentJDK ] ; then
- #
- # Apple JDKs
- #
- export JAVA_HOME=/System/Library/Java/JavaVirtualMachines/CurrentJDK/Contents/Home
- fi
-
- if [ -z "$JAVA_HOME" ] && [ -L "/Library/Java/JavaVirtualMachines/CurrentJDK" ] ; then
- #
- # Oracle JDKs
- #
- export JAVA_HOME=/Library/Java/JavaVirtualMachines/CurrentJDK/Contents/Home
- fi
-
- if [ -z "$JAVA_HOME" ] && [ -x "/usr/libexec/java_home" ]; then
- #
- # Apple JDKs
- #
- export JAVA_HOME=`/usr/libexec/java_home`
- fi
- ;;
+ # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
+ # See https://developer.apple.com/library/mac/qa/qa1170/_index.html
+ if [ -z "$JAVA_HOME" ]; then
+ if [ -x "/usr/libexec/java_home" ]; then
+ export JAVA_HOME="`/usr/libexec/java_home`"
+ else
+ export JAVA_HOME="/Library/Java/Home"
+ fi
+ fi
+ ;;
esac
if [ -z "$JAVA_HOME" ] ; then
@@ -130,13 +108,12 @@ if $cygwin ; then
CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
fi
-# For Migwn, ensure paths are in UNIX format before anything is touched
+# For Mingw, ensure paths are in UNIX format before anything is touched
if $mingw ; then
[ -n "$M2_HOME" ] &&
M2_HOME="`(cd "$M2_HOME"; pwd)`"
[ -n "$JAVA_HOME" ] &&
JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
- # TODO classpath?
fi
if [ -z "$JAVA_HOME" ]; then
@@ -184,27 +161,28 @@ fi
CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
-# For Cygwin, switch paths to Windows format before running java
-if $cygwin; then
- [ -n "$M2_HOME" ] &&
- M2_HOME=`cygpath --path --windows "$M2_HOME"`
- [ -n "$JAVA_HOME" ] &&
- JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
- [ -n "$CLASSPATH" ] &&
- CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
-fi
-
# traverses directory structure from process work directory to filesystem root
# first directory with .mvn subdirectory is considered project base directory
find_maven_basedir() {
- local basedir=$(pwd)
- local wdir=$(pwd)
+
+ if [ -z "$1" ]
+ then
+ echo "Path not specified to find_maven_basedir"
+ return 1
+ fi
+
+ basedir="$1"
+ wdir="$1"
while [ "$wdir" != '/' ] ; do
if [ -d "$wdir"/.mvn ] ; then
basedir=$wdir
break
fi
- wdir=$(cd "$wdir/.."; pwd)
+ # workaround for JBEAP-8937 (on Solaris 10/Sparc)
+ if [ -d "${wdir}" ]; then
+ wdir=`cd "$wdir/.."; pwd`
+ fi
+ # end of workaround
done
echo "${basedir}"
}
@@ -216,9 +194,108 @@ concat_lines() {
fi
}
-export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-$(find_maven_basedir)}
+BASE_DIR=`find_maven_basedir "$(pwd)"`
+if [ -z "$BASE_DIR" ]; then
+ exit 1;
+fi
+
+##########################################################################################
+# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
+# This allows using the maven wrapper in projects that prohibit checking in binary data.
+##########################################################################################
+if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo "Found .mvn/wrapper/maven-wrapper.jar"
+ fi
+else
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
+ fi
+ if [ -n "$MVNW_REPOURL" ]; then
+ jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
+ else
+ jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
+ fi
+ while IFS="=" read key value; do
+ case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
+ esac
+ done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo "Downloading from: $jarUrl"
+ fi
+ wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
+ if $cygwin; then
+ wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"`
+ fi
+
+ if command -v wget > /dev/null; then
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo "Found wget ... using wget"
+ fi
+ if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
+ wget "$jarUrl" -O "$wrapperJarPath"
+ else
+ wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath"
+ fi
+ elif command -v curl > /dev/null; then
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo "Found curl ... using curl"
+ fi
+ if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
+ curl -o "$wrapperJarPath" "$jarUrl" -f
+ else
+ curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
+ fi
+
+ else
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo "Falling back to using Java to download"
+ fi
+ javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
+ # For Cygwin, switch paths to Windows format before running javac
+ if $cygwin; then
+ javaClass=`cygpath --path --windows "$javaClass"`
+ fi
+ if [ -e "$javaClass" ]; then
+ if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo " - Compiling MavenWrapperDownloader.java ..."
+ fi
+ # Compiling the Java class
+ ("$JAVA_HOME/bin/javac" "$javaClass")
+ fi
+ if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
+ # Running the downloader
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo " - Running MavenWrapperDownloader.java ..."
+ fi
+ ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
+ fi
+ fi
+ fi
+fi
+##########################################################################################
+# End of extension
+##########################################################################################
+
+export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
+if [ "$MVNW_VERBOSE" = true ]; then
+ echo $MAVEN_PROJECTBASEDIR
+fi
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin; then
+ [ -n "$M2_HOME" ] &&
+ M2_HOME=`cygpath --path --windows "$M2_HOME"`
+ [ -n "$JAVA_HOME" ] &&
+ JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
+ [ -n "$CLASSPATH" ] &&
+ CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
+ [ -n "$MAVEN_PROJECTBASEDIR" ] &&
+ MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
+fi
+
# Provide a "standardized" way to retrieve the CLI args that will
# work with both Windows and non-Windows executions.
MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
@@ -226,28 +303,8 @@ export MAVEN_CMD_LINE_ARGS
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
-echo "Running version check"
-VERSION=$( sed '\!//' -e 's!.*$!!' )
-echo "The found version is [${VERSION}]"
-
-if echo $VERSION | egrep -q 'M|RC'; then
- echo Activating \"milestone\" profile for version=\"$VERSION\"
- echo $MAVEN_ARGS | grep -q milestone || MAVEN_ARGS="$MAVEN_ARGS -Pmilestone"
-else
- echo Deactivating \"milestone\" profile for version=\"$VERSION\"
- echo $MAVEN_ARGS | grep -q milestone && MAVEN_ARGS=$(echo $MAVEN_ARGS | sed -e 's/-Pmilestone//')
-fi
-
-if echo $VERSION | egrep -q 'RELEASE'; then
- echo Activating \"central\" profile for version=\"$VERSION\"
- echo $MAVEN_ARGS | grep -q milestone || MAVEN_ARGS="$MAVEN_ARGS -Pcentral"
-else
- echo Deactivating \"central\" profile for version=\"$VERSION\"
- echo $MAVEN_ARGS | grep -q central && MAVEN_ARGS=$(echo $MAVEN_ARGS | sed -e 's/-Pcentral//')
-fi
-
exec "$JAVACMD" \
$MAVEN_OPTS \
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
"-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
- ${WRAPPER_LAUNCHER} ${MAVEN_ARGS} "$@"
+ ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
diff --git a/mvnw.cmd b/mvnw.cmd
index 7ecd01d80..86115719e 100644
--- a/mvnw.cmd
+++ b/mvnw.cmd
@@ -7,7 +7,7 @@
@REM "License"); you may not use this file except in compliance
@REM with the License. You may obtain a copy of the License at
@REM
-@REM https://www.apache.org/licenses/LICENSE-2.0
+@REM http://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
@@ -18,7 +18,7 @@
@REM ----------------------------------------------------------------------------
@REM ----------------------------------------------------------------------------
-@REM Maven2 Start Up Batch script
+@REM Maven Start Up Batch script
@REM
@REM Required ENV vars:
@REM JAVA_HOME - location of a JDK home dir
@@ -26,7 +26,7 @@
@REM Optional ENV vars
@REM M2_HOME - location of maven2's installed home dir
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
-@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending
+@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
@REM e.g. to debug Maven itself, use
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
@@ -35,7 +35,9 @@
@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
@echo off
-@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on'
+@REM set title of command window
+title %0
+@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
@REM set %HOME% to equivalent of $HOME
@@ -80,8 +82,6 @@ goto error
:init
-set MAVEN_CMD_LINE_ARGS=%*
-
@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
@REM Fallback to current working directory if not found.
@@ -117,11 +117,48 @@ for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do s
:endReadAdditionalConfig
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
-
-set WRAPPER_JAR="".\.mvn\wrapper\maven-wrapper.jar""
+set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
-%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CMD_LINE_ARGS%
+set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
+
+FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
+ IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
+)
+
+@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
+@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
+if exist %WRAPPER_JAR% (
+ if "%MVNW_VERBOSE%" == "true" (
+ echo Found %WRAPPER_JAR%
+ )
+) else (
+ if not "%MVNW_REPOURL%" == "" (
+ SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
+ )
+ if "%MVNW_VERBOSE%" == "true" (
+ echo Couldn't find %WRAPPER_JAR%, downloading it ...
+ echo Downloading from: %DOWNLOAD_URL%
+ )
+
+ powershell -Command "&{"^
+ "$webclient = new-object System.Net.WebClient;"^
+ "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
+ "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
+ "}"^
+ "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
+ "}"
+ if "%MVNW_VERBOSE%" == "true" (
+ echo Finished downloading %WRAPPER_JAR%
+ )
+)
+@REM End of extension
+
+@REM Provide a "standardized" way to retrieve the CLI args that will
+@REM work with both Windows and non-Windows executions.
+set MAVEN_CMD_LINE_ARGS=%*
+
+%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
if ERRORLEVEL 1 goto error
goto end
diff --git a/pom.xml b/pom.xml
index 46a35adda..809d30022 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,225 +1,70 @@
-
-
- 4.0.0
+
+
- spring-cloud-zookeeper
- 4.1.0-SNAPSHOT
- pom
- Spring Cloud Zookeeper
- Spring Cloud Zookeeper
+ 4.0.0
-
- org.springframework.cloud
- spring-cloud-build
- 4.1.0-SNAPSHOT
-
-
-
+ org.springframework.cloud
+ spring-cloud-zookeeper-docs-build
+ 0.0.1-SNAPSHOT
+ Spring Cloud Zookeeper Docs Build
+ Builds Spring Cloud Zookeeper Docs.
+ https://spring.io/projects/spring-cloud-zookeeper
- https://github.com/spring-cloud/spring-cloud-zookeeper
-
- scm:git:git://github.com/spring-cloud/spring-cloud-zookeeper.git
+ scm:git:https://github.com/spring-cloud/spring-cloud-zookeeper.git
- scm:git:ssh://git@github.com/spring-cloud/spring-cloud-zookeeper.git
+ scm:git:git@github.com:spring-cloud/spring-cloud-zookeeper.git
- HEAD
+ https://github.com/spring-cloud/spring-cloud-zookeeper
+
+ https://github.com/spring-cloud/spring-cloud-zookeeper/issues
+
+
+
+ 0.0.3
+
-
- spring-cloud-zookeeper-dependencies
- spring-cloud-zookeeper-core
- spring-cloud-zookeeper-config
- spring-cloud-zookeeper-discovery
- spring-cloud-starter-zookeeper
- spring-cloud-starter-zookeeper-config
- spring-cloud-starter-zookeeper-discovery
- spring-cloud-starter-zookeeper-all
- spring-cloud-zookeeper-sample
- docs
-
-
-
-
- maven-surefire-plugin
-
- false
-
- **/*Spec.*
- **/*Tests.*
- **/*Test.*
-
-
- **/Abstract*Spec.*
- **/Abstract*Tests.*
- **/Abstract*Test.*
-
-
-
-
- org.apache.maven.plugins
- maven-checkstyle-plugin
-
-
-
- org.codehaus.mojo
- flatten-maven-plugin
-
-
- org.apache.maven.plugins
- maven-checkstyle-plugin
+ io.spring.maven.antora
+ antora-maven-plugin
+ ${io.spring.maven.antora-version}
+ true
+
+
+
+
+
+
+
+ 9d489079e5ec46dbb238909fee5c9c29
+ WB1FQYI187
+ springcloudzookeeper
+
+
-
-
-
- org.springframework.cloud
- spring-cloud-zookeeper-dependencies
- ${project.version}
- pom
- import
-
-
- com.jayway.awaitility
- awaitility
- 1.7.0
- test
-
-
- com.toomuchcoding.jsonassert
- jsonassert
- 0.4.14
- test
-
-
- org.springframework.cloud
- spring-cloud-commons-dependencies
- ${spring-cloud-commons.version}
- pom
- import
-
-
- org.springframework.cloud
- spring-cloud-config-dependencies
- ${spring-cloud-config.version}
- pom
- import
-
-
- org.springframework.cloud
- spring-cloud-openfeign-dependencies
- ${spring-cloud-openfeign.version}
- pom
- import
-
-
- org.springframework.cloud
- spring-cloud-test-support
- ${spring-cloud-commons.version}
-
-
- org.testcontainers
- testcontainers
- ${testcontainers.version}
-
-
- org.testcontainers
- mockserver
- ${testcontainers.version}
-
-
- org.testcontainers
- junit-jupiter
- ${testcontainers.version}
-
-
- org.mock-server
- mockserver-client-java
- ${mockserverclient.version}
-
-
-
-
-
- 4.1.0-SNAPSHOT
- 4.1.0-SNAPSHOT
- 4.1.0-SNAPSHOT
- 4.1.0-SNAPSHOT
- 1.17.6
- 5.15.0
-
-
-
-
- spring
-
-
- spring-snapshots
- Spring Snapshots
- https://repo.spring.io/snapshot
-
- true
-
-
- false
-
-
-
- spring-milestones
- Spring Milestones
- https://repo.spring.io/milestone
-
- false
-
-
-
- spring-releases
- Spring Releases
- https://repo.spring.io/release
-
- false
-
-
-
-
-
- spring-snapshots
- Spring Snapshots
- https://repo.spring.io/snapshot
-
- true
-
-
- false
-
-
-
- spring-milestones
- Spring Milestones
- https://repo.spring.io/milestone
-
- false
-
-
-
- spring-releases
- Spring Releases
- https://repo.spring.io/release
-
- false
-
-
-
-
-
+
+
+ spring-snapshot
+ https://repo.spring.io/snapshot
+
+ true
+
+
+ false
+
+
+
+ spring-milestone
+ https://repo.spring.io/milestone
+
+
diff --git a/scripts/runAcceptanceTests.sh b/scripts/runAcceptanceTests.sh
deleted file mode 100755
index ee0dbc701..000000000
--- a/scripts/runAcceptanceTests.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/bash
-
-set -o errexit
-
-SCRIPT_URL="https://raw.githubusercontent.com/spring-cloud-samples/brewery/2021.0.x/runAcceptanceTests.sh"
-AT_WHAT_TO_TEST="ZOOKEEPER"
-
-curl "${SCRIPT_URL}" --output runAcceptanceTests.sh
-
-chmod +x runAcceptanceTests.sh
-
-./runAcceptanceTests.sh --whattotest "${AT_WHAT_TO_TEST}" --killattheend
diff --git a/spring-cloud-starter-zookeeper-all/.flattened-pom.xml b/spring-cloud-starter-zookeeper-all/.flattened-pom.xml
new file mode 100644
index 000000000..ae2f8fc41
--- /dev/null
+++ b/spring-cloud-starter-zookeeper-all/.flattened-pom.xml
@@ -0,0 +1,113 @@
+
+
+ 4.0.0
+
+ org.springframework.cloud
+ spring-cloud-zookeeper
+ 4.1.0-SNAPSHOT
+ ..
+
+ org.springframework.cloud
+ spring-cloud-starter-zookeeper-all
+ 4.1.0-SNAPSHOT
+ Spring Cloud Starter Zookeeper All
+ Spring Cloud Starter Zookeeper All
+ https://projects.spring.io/spring-cloud
+
+ Pivotal Software, Inc.
+ https://www.spring.io
+
+
+
+ Apache License, Version 2.0
+ https://www.apache.org/licenses/LICENSE-2.0
+ Copyright 2014-2021 the original author or authors.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied.
+
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+
+
+
+ dsyer
+ Dave Syer
+ dsyer at pivotal.io
+ Pivotal Software, Inc.
+ https://www.spring.io
+
+ lead
+
+
+
+ sgibb
+ Spencer Gibb
+ sgibb at pivotal.io
+ Pivotal Software, Inc.
+ https://www.spring.io
+
+ lead
+
+
+
+ mgrzejszczak
+ Marcin Grzejszczak
+ mgrzejszczak at pivotal.io
+ Pivotal Software, Inc.
+ https://www.spring.io
+
+ developer
+
+
+
+ rbaxter
+ Ryan Baxter
+ rbaxter at pivotal.io
+ Pivotal Software, Inc.
+ https://www.spring.io
+
+ developer
+
+
+
+ omaciaszeksharma
+ Olga Maciaszek-Sharma
+ omaciaszeksharma at pivotal.io
+ Pivotal Software, Inc.
+ https://www.spring.io
+
+ developer
+
+
+
+
+ scm:git:git://github.com/spring-cloud/spring-cloud-zookeeper.git/spring-cloud-starter-zookeeper-all
+ scm:git:ssh://git@github.com/spring-cloud/spring-cloud-zookeeper.git/spring-cloud-starter-zookeeper-all
+ https://github.com/spring-cloud/spring-cloud-zookeeper/spring-cloud-starter-zookeeper-all
+
+
+
+ org.springframework.cloud
+ spring-cloud-starter-zookeeper-config
+ 4.1.0-SNAPSHOT
+ compile
+
+
+ org.springframework.cloud
+ spring-cloud-starter-zookeeper-discovery
+ 4.1.0-SNAPSHOT
+ compile
+
+
+
diff --git a/spring-cloud-starter-zookeeper-all/pom.xml b/spring-cloud-starter-zookeeper-all/pom.xml
deleted file mode 100644
index 1454d676c..000000000
--- a/spring-cloud-starter-zookeeper-all/pom.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
- 4.0.0
-
- org.springframework.cloud
- spring-cloud-zookeeper
- 4.1.0-SNAPSHOT
- ..
-
- spring-cloud-starter-zookeeper-all
- Spring Cloud Starter Zookeeper All
- Spring Cloud Starter Zookeeper All
- https://projects.spring.io/spring-cloud
-
- Pivotal Software, Inc.
- https://www.spring.io
-
-
- ${basedir}/../..
-
-
-
- org.springframework.cloud
- spring-cloud-starter-zookeeper-config
-
-
- org.springframework.cloud
- spring-cloud-starter-zookeeper-discovery
-
-
-
diff --git a/spring-cloud-starter-zookeeper-config/.flattened-pom.xml b/spring-cloud-starter-zookeeper-config/.flattened-pom.xml
new file mode 100644
index 000000000..124ebf4a4
--- /dev/null
+++ b/spring-cloud-starter-zookeeper-config/.flattened-pom.xml
@@ -0,0 +1,129 @@
+
+
+ 4.0.0
+
+ org.springframework.cloud
+ spring-cloud-zookeeper
+ 4.1.0-SNAPSHOT
+ ..
+
+ org.springframework.cloud
+ spring-cloud-starter-zookeeper-config
+ 4.1.0-SNAPSHOT
+ Spring Cloud Starter Zookeeper Config
+ Spring Cloud Starter Zookeeper Config
+ https://projects.spring.io/spring-cloud
+
+ Pivotal Software, Inc.
+ https://www.spring.io
+
+
+
+ Apache License, Version 2.0
+ https://www.apache.org/licenses/LICENSE-2.0
+ Copyright 2014-2021 the original author or authors.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied.
+
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+
+
+
+ dsyer
+ Dave Syer
+ dsyer at pivotal.io
+ Pivotal Software, Inc.
+ https://www.spring.io
+
+ lead
+
+
+
+ sgibb
+ Spencer Gibb
+ sgibb at pivotal.io
+ Pivotal Software, Inc.
+ https://www.spring.io
+
+ lead
+
+
+
+ mgrzejszczak
+ Marcin Grzejszczak
+ mgrzejszczak at pivotal.io
+ Pivotal Software, Inc.
+ https://www.spring.io
+
+ developer
+
+
+
+ rbaxter
+ Ryan Baxter
+ rbaxter at pivotal.io
+ Pivotal Software, Inc.
+ https://www.spring.io
+
+ developer
+
+
+
+ omaciaszeksharma
+ Olga Maciaszek-Sharma
+ omaciaszeksharma at pivotal.io
+ Pivotal Software, Inc.
+ https://www.spring.io
+
+ developer
+
+
+
+
+ scm:git:git://github.com/spring-cloud/spring-cloud-zookeeper.git/spring-cloud-starter-zookeeper-config
+ scm:git:ssh://git@github.com/spring-cloud/spring-cloud-zookeeper.git/spring-cloud-starter-zookeeper-config
+ https://github.com/spring-cloud/spring-cloud-zookeeper/spring-cloud-starter-zookeeper-config
+
+
+
+ org.springframework.cloud
+ spring-cloud-starter-zookeeper
+ 4.1.0-SNAPSHOT
+ compile
+
+
+ org.springframework.cloud
+ spring-cloud-zookeeper-config
+ 4.1.0-SNAPSHOT
+ compile
+
+
+ org.apache.curator
+ curator-recipes
+ 5.1.0
+ compile
+
+
+ log4j
+ log4j
+
+
+ io.netty
+ netty
+
+
+
+
+
diff --git a/spring-cloud-starter-zookeeper-config/pom.xml b/spring-cloud-starter-zookeeper-config/pom.xml
deleted file mode 100644
index 35ed72dd4..000000000
--- a/spring-cloud-starter-zookeeper-config/pom.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
- 4.0.0
-
- org.springframework.cloud
- spring-cloud-zookeeper
- 4.1.0-SNAPSHOT
- ..
-
- spring-cloud-starter-zookeeper-config
- Spring Cloud Starter Zookeeper Config
- Spring Cloud Starter Zookeeper Config
- https://projects.spring.io/spring-cloud
-
- Pivotal Software, Inc.
- https://www.spring.io
-
-
- ${basedir}/../..
-
-
-
- org.springframework.cloud
- spring-cloud-starter-zookeeper
-
-
- org.springframework.cloud
- spring-cloud-zookeeper-config
-
-
- org.apache.curator
- curator-recipes
-
-
-
diff --git a/spring-cloud-starter-zookeeper-discovery/.flattened-pom.xml b/spring-cloud-starter-zookeeper-discovery/.flattened-pom.xml
new file mode 100644
index 000000000..92ec9af1b
--- /dev/null
+++ b/spring-cloud-starter-zookeeper-discovery/.flattened-pom.xml
@@ -0,0 +1,135 @@
+
+
+ 4.0.0
+
+ org.springframework.cloud
+ spring-cloud-zookeeper
+ 4.1.0-SNAPSHOT
+ ..
+
+ org.springframework.cloud
+ spring-cloud-starter-zookeeper-discovery
+ 4.1.0-SNAPSHOT
+ Spring Cloud Starter Zookeeper Discovery
+ Spring Cloud Starter Zookeeper Discovery
+ https://projects.spring.io/spring-cloud
+
+ Pivotal Software, Inc.
+ https://www.spring.io
+
+
+
+ Apache License, Version 2.0
+ https://www.apache.org/licenses/LICENSE-2.0
+ Copyright 2014-2021 the original author or authors.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied.
+
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+
+
+
+ dsyer
+ Dave Syer
+ dsyer at pivotal.io
+ Pivotal Software, Inc.
+ https://www.spring.io
+
+ lead
+
+
+
+ sgibb
+ Spencer Gibb
+ sgibb at pivotal.io
+ Pivotal Software, Inc.
+ https://www.spring.io
+
+ lead
+
+
+
+ mgrzejszczak
+ Marcin Grzejszczak
+ mgrzejszczak at pivotal.io
+ Pivotal Software, Inc.
+ https://www.spring.io
+
+ developer
+
+
+
+ rbaxter
+ Ryan Baxter
+ rbaxter at pivotal.io
+ Pivotal Software, Inc.
+ https://www.spring.io
+
+ developer
+
+
+
+ omaciaszeksharma
+ Olga Maciaszek-Sharma
+ omaciaszeksharma at pivotal.io
+ Pivotal Software, Inc.
+ https://www.spring.io
+
+ developer
+
+
+
+
+ scm:git:git://github.com/spring-cloud/spring-cloud-zookeeper.git/spring-cloud-starter-zookeeper-discovery
+ scm:git:ssh://git@github.com/spring-cloud/spring-cloud-zookeeper.git/spring-cloud-starter-zookeeper-discovery
+ https://github.com/spring-cloud/spring-cloud-zookeeper/spring-cloud-starter-zookeeper-discovery
+
+
+
+ org.springframework.cloud
+ spring-cloud-starter-zookeeper
+ 4.1.0-SNAPSHOT
+ compile
+
+
+ org.springframework.cloud
+ spring-cloud-zookeeper-discovery
+ 4.1.0-SNAPSHOT
+ compile
+
+
+ org.apache.curator
+ curator-x-discovery
+ 5.1.0
+ compile
+
+
+ log4j
+ log4j
+
+
+ io.netty
+ netty
+
+
+
+
+ org.springframework.cloud
+ spring-cloud-starter-loadbalancer
+ 4.1.0-SNAPSHOT
+ compile
+
+
+
diff --git a/spring-cloud-starter-zookeeper-discovery/pom.xml b/spring-cloud-starter-zookeeper-discovery/pom.xml
deleted file mode 100644
index 8ed4e382d..000000000
--- a/spring-cloud-starter-zookeeper-discovery/pom.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
- 4.0.0
-
- org.springframework.cloud
- spring-cloud-zookeeper
- 4.1.0-SNAPSHOT
- ..
-
- spring-cloud-starter-zookeeper-discovery
- Spring Cloud Starter Zookeeper Discovery
- Spring Cloud Starter Zookeeper Discovery
- https://projects.spring.io/spring-cloud
-
- Pivotal Software, Inc.
- https://www.spring.io
-
-
- ${basedir}/../..
-
-
-
- org.springframework.cloud
- spring-cloud-starter-zookeeper
-
-
- org.springframework.cloud
- spring-cloud-zookeeper-discovery
-
-
- org.apache.curator
- curator-x-discovery
-
-
- org.springframework.cloud
- spring-cloud-starter-loadbalancer
-
-
-
diff --git a/spring-cloud-starter-zookeeper/.flattened-pom.xml b/spring-cloud-starter-zookeeper/.flattened-pom.xml
new file mode 100644
index 000000000..6aed6ac91
--- /dev/null
+++ b/spring-cloud-starter-zookeeper/.flattened-pom.xml
@@ -0,0 +1,113 @@
+
+
+ 4.0.0
+
+ org.springframework.cloud
+ spring-cloud-zookeeper
+ 4.1.0-SNAPSHOT
+ ..
+
+ org.springframework.cloud
+ spring-cloud-starter-zookeeper
+ 4.1.0-SNAPSHOT
+ Spring Cloud Starter Zookeeper
+ Spring Cloud Starter Zookeeper
+ https://projects.spring.io/spring-cloud
+
+ Pivotal Software, Inc.
+ https://www.spring.io
+
+
+
+ Apache License, Version 2.0
+ https://www.apache.org/licenses/LICENSE-2.0
+ Copyright 2014-2021 the original author or authors.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied.
+
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+
+
+
+ dsyer
+ Dave Syer
+ dsyer at pivotal.io
+ Pivotal Software, Inc.
+ https://www.spring.io
+
+ lead
+
+
+
+ sgibb
+ Spencer Gibb
+ sgibb at pivotal.io
+ Pivotal Software, Inc.
+ https://www.spring.io
+
+ lead
+
+
+
+ mgrzejszczak
+ Marcin Grzejszczak
+ mgrzejszczak at pivotal.io
+ Pivotal Software, Inc.
+ https://www.spring.io
+
+ developer
+
+
+
+ rbaxter
+ Ryan Baxter
+ rbaxter at pivotal.io
+ Pivotal Software, Inc.
+ https://www.spring.io
+
+ developer
+
+
+
+ omaciaszeksharma
+ Olga Maciaszek-Sharma
+ omaciaszeksharma at pivotal.io
+ Pivotal Software, Inc.
+ https://www.spring.io
+
+ developer
+
+
+
+
+ scm:git:git://github.com/spring-cloud/spring-cloud-zookeeper.git/spring-cloud-starter-zookeeper
+ scm:git:ssh://git@github.com/spring-cloud/spring-cloud-zookeeper.git/spring-cloud-starter-zookeeper
+ https://github.com/spring-cloud/spring-cloud-zookeeper/spring-cloud-starter-zookeeper
+
+
+
+ org.springframework.cloud
+ spring-cloud-starter
+ 4.1.0-SNAPSHOT
+ compile
+
+
+ org.springframework.cloud
+ spring-cloud-zookeeper-core
+ 4.1.0-SNAPSHOT
+ compile
+
+
+
diff --git a/spring-cloud-starter-zookeeper/pom.xml b/spring-cloud-starter-zookeeper/pom.xml
deleted file mode 100644
index aee3ec6a7..000000000
--- a/spring-cloud-starter-zookeeper/pom.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
- 4.0.0
-
- org.springframework.cloud
- spring-cloud-zookeeper
- 4.1.0-SNAPSHOT
- ..
-
- spring-cloud-starter-zookeeper
- Spring Cloud Starter Zookeeper
- Spring Cloud Starter Zookeeper
- https://projects.spring.io/spring-cloud
-
- Pivotal Software, Inc.
- https://www.spring.io
-
-
- ${basedir}/../..
-
-
-
- org.springframework.cloud
- spring-cloud-starter
-
-
- org.springframework.cloud
- spring-cloud-zookeeper-core
-
-
-
diff --git a/spring-cloud-zookeeper-config/.flattened-pom.xml b/spring-cloud-zookeeper-config/.flattened-pom.xml
new file mode 100644
index 000000000..18d1c6050
--- /dev/null
+++ b/spring-cloud-zookeeper-config/.flattened-pom.xml
@@ -0,0 +1,181 @@
+
+
+ 4.0.0
+
+ org.springframework.cloud
+ spring-cloud-zookeeper
+ 4.1.0-SNAPSHOT
+ ..
+
+ org.springframework.cloud
+ spring-cloud-zookeeper-config
+ 4.1.0-SNAPSHOT
+ Spring Cloud Zookeeper Config
+ Spring Cloud Zookeeper Config
+ https://spring.io/spring-cloud/spring-cloud-zookeeper/spring-cloud-zookeeper-config
+
+ Pivotal Software, Inc.
+ https://www.spring.io
+
+
+
+ Apache License, Version 2.0
+ https://www.apache.org/licenses/LICENSE-2.0
+ Copyright 2014-2021 the original author or authors.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied.
+
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+
+
+
+ dsyer
+ Dave Syer
+ dsyer at pivotal.io
+ Pivotal Software, Inc.
+ https://www.spring.io
+
+ lead
+
+
+
+ sgibb
+ Spencer Gibb
+ sgibb at pivotal.io
+ Pivotal Software, Inc.
+ https://www.spring.io
+
+ lead
+
+
+
+ mgrzejszczak
+ Marcin Grzejszczak
+ mgrzejszczak at pivotal.io
+ Pivotal Software, Inc.
+ https://www.spring.io
+
+ developer
+
+
+
+ rbaxter
+ Ryan Baxter
+ rbaxter at pivotal.io
+ Pivotal Software, Inc.
+ https://www.spring.io
+
+ developer
+
+
+
+ omaciaszeksharma
+ Olga Maciaszek-Sharma
+ omaciaszeksharma at pivotal.io
+ Pivotal Software, Inc.
+ https://www.spring.io
+
+ developer
+
+
+
+
+ scm:git:git://github.com/spring-cloud/spring-cloud-zookeeper.git/spring-cloud-zookeeper-config
+ scm:git:ssh://git@github.com/spring-cloud/spring-cloud-zookeeper.git/spring-cloud-zookeeper-config
+ https://github.com/spring-cloud/spring-cloud-zookeeper/spring-cloud-zookeeper-config
+
+
+
+ org.springframework.cloud
+ spring-cloud-zookeeper-core
+ 4.1.0-SNAPSHOT
+ compile
+
+
+ org.apache.curator
+ curator-x-discovery
+ 5.1.0
+ compile
+
+
+ log4j
+ log4j
+
+
+ io.netty
+ netty
+
+
+
+
+ org.springframework.cloud
+ spring-cloud-commons
+ 4.1.0-SNAPSHOT
+ compile
+
+
+ org.springframework.cloud
+ spring-cloud-context
+ 4.1.0-SNAPSHOT
+ compile
+ true
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+ 3.2.0-SNAPSHOT
+ compile
+ true
+
+
+ org.springframework.boot
+ spring-boot-starter-actuator
+ 3.2.0-SNAPSHOT
+ compile
+ true
+
+
+ org.apache.curator
+ curator-recipes
+ 5.1.0
+ compile
+
+
+ log4j
+ log4j
+
+
+ io.netty
+ netty
+
+
+ true
+
+
+ org.springframework.boot
+ spring-boot-autoconfigure-processor
+ 3.2.0-SNAPSHOT
+ compile
+ true
+
+
+ org.springframework.boot
+ spring-boot-configuration-processor
+ 3.2.0-SNAPSHOT
+ compile
+ true
+
+
+
diff --git a/spring-cloud-zookeeper-config/pom.xml b/spring-cloud-zookeeper-config/pom.xml
deleted file mode 100644
index f8e3274fc..000000000
--- a/spring-cloud-zookeeper-config/pom.xml
+++ /dev/null
@@ -1,95 +0,0 @@
-
-
- 4.0.0
-
- spring-cloud-zookeeper-config
- jar
- Spring Cloud Zookeeper Config
- Spring Cloud Zookeeper Config
-
-
- org.springframework.cloud
- spring-cloud-zookeeper
- 4.1.0-SNAPSHOT
- ..
-
-
-
-
-
- org.apache.maven.plugins
- maven-compiler-plugin
-
-
-
-
-
-
- org.springframework.cloud
- spring-cloud-zookeeper-core
-
-
- org.apache.curator
- curator-x-discovery
-
-
- org.springframework.cloud
- spring-cloud-commons
-
-
- org.springframework.cloud
- spring-cloud-context
- true
-
-
- org.springframework.boot
- spring-boot-starter-web
- true
-
-
- org.springframework.boot
- spring-boot-starter-actuator
- true
-
-
- org.apache.curator
- curator-recipes
- true
-
-
- org.springframework.boot
- spring-boot-autoconfigure-processor
- true
-
-
- org.springframework.boot
- spring-boot-configuration-processor
- true
-
-
- org.springframework.boot
- spring-boot-starter-test
- test
-
-
- org.junit.vintage
- junit-vintage-engine
- test
-
-
- org.springframework.cloud
- spring-cloud-zookeeper-core
- ${project.version}
- test-jar
- test
-
-
- org.apache.curator
- curator-test
- test
-
-
-
-
diff --git a/spring-cloud-zookeeper-config/src/main/java/org/springframework/cloud/zookeeper/config/AbstractZookeeperPropertySource.java b/spring-cloud-zookeeper-config/src/main/java/org/springframework/cloud/zookeeper/config/AbstractZookeeperPropertySource.java
deleted file mode 100644
index 10b3bf699..000000000
--- a/spring-cloud-zookeeper-config/src/main/java/org/springframework/cloud/zookeeper/config/AbstractZookeeperPropertySource.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright 2015-2019 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.zookeeper.config;
-
-import org.apache.curator.framework.CuratorFramework;
-
-import org.springframework.core.env.EnumerablePropertySource;
-
-/**
- * A {@link EnumerablePropertySource} that has a notion of a context which is the root
- * folder in Zookeeper.
- *
- * @author Spencer Gibb
- * @since 1.0.0
- */
-public abstract class AbstractZookeeperPropertySource
- extends EnumerablePropertySource {
-
- private String context;
-
- public AbstractZookeeperPropertySource(String context, CuratorFramework source) {
- super(context, source);
- this.context = context;
- if (!this.context.startsWith("/")) {
- this.context = "/" + this.context;
- }
- }
-
- protected String sanitizeKey(String path) {
- return path.replace(this.context + "/", "").replace('/', '.');
- }
-
- public String getContext() {
- return this.context;
- }
-
-}
diff --git a/spring-cloud-zookeeper-config/src/main/java/org/springframework/cloud/zookeeper/config/ConfigWatcher.java b/spring-cloud-zookeeper-config/src/main/java/org/springframework/cloud/zookeeper/config/ConfigWatcher.java
deleted file mode 100644
index f9411ee6d..000000000
--- a/spring-cloud-zookeeper-config/src/main/java/org/springframework/cloud/zookeeper/config/ConfigWatcher.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * Copyright 2015-2019 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.zookeeper.config;
-
-import java.io.Closeable;
-import java.nio.charset.Charset;
-import java.util.HashMap;
-import java.util.List;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import jakarta.annotation.PostConstruct;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.curator.framework.CuratorFramework;
-import org.apache.curator.framework.recipes.cache.TreeCache;
-import org.apache.curator.framework.recipes.cache.TreeCacheEvent;
-import org.apache.curator.framework.recipes.cache.TreeCacheListener;
-import org.apache.zookeeper.KeeperException;
-
-import org.springframework.cloud.endpoint.event.RefreshEvent;
-import org.springframework.context.ApplicationEventPublisher;
-import org.springframework.context.ApplicationEventPublisherAware;
-
-import static org.apache.curator.framework.recipes.cache.TreeCacheEvent.Type.NODE_ADDED;
-import static org.apache.curator.framework.recipes.cache.TreeCacheEvent.Type.NODE_REMOVED;
-import static org.apache.curator.framework.recipes.cache.TreeCacheEvent.Type.NODE_UPDATED;
-
-/**
- * Class that registers a {@link TreeCache} for each context. It publishes events upon
- * element change in Zookeeper.
- *
- * @author Spencer Gibb
- * @since 1.0.0
- */
-public class ConfigWatcher
- implements Closeable, TreeCacheListener, ApplicationEventPublisherAware {
-
- private static final Log log = LogFactory.getLog(ConfigWatcher.class);
-
- private AtomicBoolean running = new AtomicBoolean(false);
-
- private List contexts;
-
- private CuratorFramework source;
-
- private ApplicationEventPublisher publisher;
-
- private HashMap caches;
-
- public ConfigWatcher(List contexts, CuratorFramework source) {
- this.contexts = contexts;
- this.source = source;
- }
-
- @Override
- public void setApplicationEventPublisher(ApplicationEventPublisher publisher) {
- this.publisher = publisher;
- }
-
- @PostConstruct
- public void start() {
- if (this.running.compareAndSet(false, true)) {
- this.caches = new HashMap<>();
- for (String context : this.contexts) {
- if (!context.startsWith("/")) {
- context = "/" + context;
- }
- try {
- TreeCache cache = TreeCache.newBuilder(this.source, context).build();
- cache.getListenable().addListener(this);
- cache.start();
- this.caches.put(context, cache);
- // no race condition since ZookeeperAutoConfiguration.curatorFramework
- // calls curator.blockUntilConnected
- }
- catch (KeeperException.NoNodeException e) {
- // no node, ignore
- }
- catch (Exception e) {
- log.error("Error initializing listener for context " + context, e);
- }
- }
- }
- }
-
- @Override
- public void close() {
- if (this.running.compareAndSet(true, false)) {
- for (TreeCache cache : this.caches.values()) {
- cache.close();
- }
- this.caches = null;
- }
- }
-
- @Override
- public void childEvent(CuratorFramework client, TreeCacheEvent event)
- throws Exception {
- TreeCacheEvent.Type eventType = event.getType();
- if (eventType == NODE_ADDED || eventType == NODE_REMOVED
- || eventType == NODE_UPDATED) {
- this.publisher
- .publishEvent(new RefreshEvent(this, event, getEventDesc(event)));
- }
- }
-
- public String getEventDesc(TreeCacheEvent event) {
- StringBuilder out = new StringBuilder();
- out.append("type=").append(event.getType());
- out.append(", path=").append(event.getData().getPath());
- byte[] data = event.getData().getData();
- if (data != null && data.length > 0) {
- out.append(", data=").append(new String(data, Charset.forName("UTF-8")));
- }
- return out.toString();
- }
-
-}
diff --git a/spring-cloud-zookeeper-config/src/main/java/org/springframework/cloud/zookeeper/config/ZookeeperBootstrapper.java b/spring-cloud-zookeeper-config/src/main/java/org/springframework/cloud/zookeeper/config/ZookeeperBootstrapper.java
deleted file mode 100644
index a92211b93..000000000
--- a/spring-cloud-zookeeper-config/src/main/java/org/springframework/cloud/zookeeper/config/ZookeeperBootstrapper.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright 2015-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.zookeeper.config;
-
-import java.util.function.Function;
-
-import org.apache.curator.RetryPolicy;
-import org.apache.curator.drivers.TracerDriver;
-import org.apache.curator.ensemble.EnsembleProvider;
-import org.apache.curator.framework.CuratorFramework;
-
-import org.springframework.boot.BootstrapContext;
-import org.springframework.boot.BootstrapRegistry;
-import org.springframework.boot.BootstrapRegistryInitializer;
-import org.springframework.cloud.zookeeper.CuratorFrameworkCustomizer;
-
-public class ZookeeperBootstrapper implements BootstrapRegistryInitializer {
-
- private Function retryPolicy;
-
- private Function ensembleProvider;
-
- private Function tracerDriver;
-
- private Function curatorFrameworkCustomizer;
-
- static BootstrapRegistryInitializer fromBootstrapContext(Function factory) {
- return registry -> registry.register(CuratorFramework.class, factory::apply);
- }
-
- static ZookeeperBootstrapper create() {
- return new ZookeeperBootstrapper();
- }
-
- public ZookeeperBootstrapper retryPolicy(Function retryPolicy) {
- this.retryPolicy = retryPolicy;
- return this;
- }
-
- public ZookeeperBootstrapper ensembleProvider(Function ensembleProvider) {
- this.ensembleProvider = ensembleProvider;
- return this;
- }
-
- public ZookeeperBootstrapper tracerDriver(Function tracerDriver) {
- this.tracerDriver = tracerDriver;
- return this;
- }
-
- public ZookeeperBootstrapper curatorFrameworkCustomizer(Function curatorFrameworkCustomizer) {
- this.curatorFrameworkCustomizer = curatorFrameworkCustomizer;
- return this;
- }
-
- @Override
- public void initialize(BootstrapRegistry registry) {
- register(registry, RetryPolicy.class, retryPolicy);
- register(registry, EnsembleProvider.class, ensembleProvider);
- register(registry, TracerDriver.class, tracerDriver);
- register(registry, CuratorFrameworkCustomizer.class, curatorFrameworkCustomizer);
- }
-
- private void register(BootstrapRegistry registry, Class type, Function factory) {
- if (this.retryPolicy != null) {
- registry.register(type, factory::apply);
- }
- }
-}
diff --git a/spring-cloud-zookeeper-config/src/main/java/org/springframework/cloud/zookeeper/config/ZookeeperConfigAutoConfiguration.java b/spring-cloud-zookeeper-config/src/main/java/org/springframework/cloud/zookeeper/config/ZookeeperConfigAutoConfiguration.java
deleted file mode 100644
index 38b33d510..000000000
--- a/spring-cloud-zookeeper-config/src/main/java/org/springframework/cloud/zookeeper/config/ZookeeperConfigAutoConfiguration.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright 2015-2019 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.zookeeper.config;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.apache.curator.framework.CuratorFramework;
-
-import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.cloud.endpoint.RefreshEndpoint;
-import org.springframework.cloud.zookeeper.ConditionalOnZookeeperEnabled;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.core.env.Environment;
-
-/**
- * {@link org.springframework.boot.autoconfigure.EnableAutoConfiguration
- * Auto-configuration} that registers a Zookeeper configuration watcher.
- *
- * @author Spencer Gibb
- * @since 1.0.0
- */
-@Configuration(proxyBeanMethods = false)
-@ConditionalOnZookeeperEnabled
-@ConditionalOnProperty(value = "spring.cloud.zookeeper.config.enabled", matchIfMissing = true)
-public class ZookeeperConfigAutoConfiguration {
-
- @Configuration(proxyBeanMethods = false)
- @ConditionalOnClass(RefreshEndpoint.class)
- @ConditionalOnProperty(name = "spring.cloud.zookeeper.config.watcher.enabled", matchIfMissing = true)
- protected static class ZkRefreshConfiguration {
-
- @Bean
- @ConditionalOnBean(ZookeeperPropertySourceLocator.class)
- public ConfigWatcher propertySourceLocatorConfigWatcher(ZookeeperPropertySourceLocator locator,
- CuratorFramework curator) {
- return new ConfigWatcher(locator.getContexts(), curator);
- }
-
- @Bean
- @ConditionalOnMissingBean(ZookeeperPropertySourceLocator.class)
- public ConfigWatcher configDataConfigWatcher(CuratorFramework curator, Environment env) {
- List contexts = env.getProperty("spring.cloud.zookeeper.config.property-source-contexts",
- List.class, Collections.emptyList());
- return new ConfigWatcher(contexts, curator);
- }
-
- }
-
-}
diff --git a/spring-cloud-zookeeper-config/src/main/java/org/springframework/cloud/zookeeper/config/ZookeeperConfigBootstrapConfiguration.java b/spring-cloud-zookeeper-config/src/main/java/org/springframework/cloud/zookeeper/config/ZookeeperConfigBootstrapConfiguration.java
deleted file mode 100644
index b50fb5bce..000000000
--- a/spring-cloud-zookeeper-config/src/main/java/org/springframework/cloud/zookeeper/config/ZookeeperConfigBootstrapConfiguration.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright 2015-2019 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.zookeeper.config;
-
-import org.apache.curator.framework.CuratorFramework;
-
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.cloud.zookeeper.ConditionalOnZookeeperEnabled;
-import org.springframework.cloud.zookeeper.ZookeeperAutoConfiguration;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Import;
-import org.springframework.core.env.Environment;
-import org.springframework.util.StringUtils;
-
-/**
- * Bootstrap Configuration for Zookeeper Configuration.
- *
- * @author Spencer Gibb
- * @since 1.0.0
- */
-@Configuration(proxyBeanMethods = false)
-@ConditionalOnZookeeperEnabled
-@Import(ZookeeperAutoConfiguration.class)
-public class ZookeeperConfigBootstrapConfiguration {
-
- @Bean
- @ConditionalOnMissingBean
- public ZookeeperPropertySourceLocator zookeeperPropertySourceLocator(
- CuratorFramework curator, ZookeeperConfigProperties properties) {
- return new ZookeeperPropertySourceLocator(curator, properties);
- }
-
- @Bean
- @ConditionalOnMissingBean
- public ZookeeperConfigProperties zookeeperConfigProperties(Environment env) {
- ZookeeperConfigProperties properties = new ZookeeperConfigProperties();
- if (!StringUtils.hasLength(properties.getName())) {
- properties.setName(env.getProperty("spring.application.name", "application"));
- }
- return properties;
- }
-
-}
diff --git a/spring-cloud-zookeeper-config/src/main/java/org/springframework/cloud/zookeeper/config/ZookeeperConfigDataLoader.java b/spring-cloud-zookeeper-config/src/main/java/org/springframework/cloud/zookeeper/config/ZookeeperConfigDataLoader.java
deleted file mode 100644
index 06501a809..000000000
--- a/spring-cloud-zookeeper-config/src/main/java/org/springframework/cloud/zookeeper/config/ZookeeperConfigDataLoader.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright 2015-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.zookeeper.config;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.apache.commons.logging.Log;
-import org.apache.curator.framework.CuratorFramework;
-
-import org.springframework.boot.context.config.ConfigData;
-import org.springframework.boot.context.config.ConfigDataLoader;
-import org.springframework.boot.context.config.ConfigDataLoaderContext;
-import org.springframework.boot.context.config.ConfigDataResourceNotFoundException;
-import org.springframework.boot.logging.DeferredLogFactory;
-import org.springframework.util.StringUtils;
-
-public class ZookeeperConfigDataLoader implements ConfigDataLoader {
-
- private final Log log;
-
- public ZookeeperConfigDataLoader(DeferredLogFactory logFactory) {
- this.log = logFactory.getLog(ZookeeperConfigDataLoader.class);
- }
-
- @Override
- public ConfigData load(ConfigDataLoaderContext context, ZookeeperConfigDataResource resource) {
- try {
- CuratorFramework curator = context.getBootstrapContext().get(CuratorFramework.class);
- if (curator == null) {
- // this can happen if certain conditions are met
- return null;
- }
- ZookeeperPropertySource propertySource = new ZookeeperPropertySource(resource.getContext(),
- curator);
- List propertySources = Collections.singletonList(propertySource);
-
- return new ConfigData(propertySources, source -> {
- List options = new ArrayList<>();
- options.add(ConfigData.Option.IGNORE_IMPORTS);
- options.add(ConfigData.Option.IGNORE_PROFILES);
- if (StringUtils.hasText(resource.getProfile())) {
- options.add(ConfigData.Option.PROFILE_SPECIFIC);
- }
- return ConfigData.Options.of(options.toArray(new ConfigData.Option[0]));
- });
-
- }
- catch (Exception e) {
- if (log.isDebugEnabled()) {
- log.debug("Error getting properties from zookeeper: " + resource, e);
- }
- throw new ConfigDataResourceNotFoundException(resource, e);
- }
- }
-
-}
diff --git a/spring-cloud-zookeeper-config/src/main/java/org/springframework/cloud/zookeeper/config/ZookeeperConfigDataLocationResolver.java b/spring-cloud-zookeeper-config/src/main/java/org/springframework/cloud/zookeeper/config/ZookeeperConfigDataLocationResolver.java
deleted file mode 100644
index 2c4a119ab..000000000
--- a/spring-cloud-zookeeper-config/src/main/java/org/springframework/cloud/zookeeper/config/ZookeeperConfigDataLocationResolver.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * Copyright 2015-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.zookeeper.config;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.stream.Collectors;
-
-import org.apache.commons.logging.Log;
-
-import org.springframework.boot.BootstrapRegistry.InstanceSupplier;
-import org.springframework.boot.context.config.ConfigDataLocation;
-import org.springframework.boot.context.config.ConfigDataLocationNotFoundException;
-import org.springframework.boot.context.config.ConfigDataLocationResolver;
-import org.springframework.boot.context.config.ConfigDataLocationResolverContext;
-import org.springframework.boot.context.config.Profiles;
-import org.springframework.boot.context.properties.bind.BindHandler;
-import org.springframework.boot.context.properties.bind.Bindable;
-import org.springframework.boot.context.properties.bind.Binder;
-import org.springframework.boot.logging.DeferredLogFactory;
-import org.springframework.cloud.zookeeper.CuratorFactory;
-import org.springframework.cloud.zookeeper.ZookeeperProperties;
-import org.springframework.cloud.zookeeper.config.ZookeeperPropertySources.Context;
-import org.springframework.core.env.MapPropertySource;
-import org.springframework.lang.Nullable;
-import org.springframework.util.CollectionUtils;
-import org.springframework.util.StringUtils;
-import org.springframework.web.util.UriComponents;
-import org.springframework.web.util.UriComponentsBuilder;
-
-public class ZookeeperConfigDataLocationResolver implements ConfigDataLocationResolver {
-
- /**
- * Zookeeper Config Data prefix.
- */
- public static final String PREFIX = "zookeeper:";
-
- private final Log log;
-
- public ZookeeperConfigDataLocationResolver(DeferredLogFactory logFactory) {
- this.log = logFactory.getLog(ZookeeperConfigDataLocationResolver.class);
- }
-
- @Override
- public boolean isResolvable(ConfigDataLocationResolverContext context, ConfigDataLocation location) {
- if (!location.hasPrefix(PREFIX)) {
- return false;
- }
- // only bind on correct prefix
- boolean zkEnabled = context.getBinder().bind(ZookeeperProperties.PREFIX + ".enabled", Boolean.class)
- .orElse(true);
- boolean zkConfigEnabled = context.getBinder().bind(ZookeeperConfigProperties.PREFIX + ".enabled", Boolean.class)
- .orElse(true);
- return zkConfigEnabled && zkEnabled;
- }
-
- @Override
- public List resolve(ConfigDataLocationResolverContext context, ConfigDataLocation location)
- throws ConfigDataLocationNotFoundException {
- return Collections.emptyList();
- }
-
- @Override
- public List resolveProfileSpecific(ConfigDataLocationResolverContext context,
- ConfigDataLocation location, Profiles profiles) throws ConfigDataLocationNotFoundException {
- UriComponents locationUri = parseLocation(location);
-
- // create curator
- CuratorFactory.registerCurator(context.getBootstrapContext(), locationUri, location.isOptional());
-
- // create locations
- ZookeeperConfigProperties properties = loadConfigProperties(context);
- context.getBootstrapContext().register(ZookeeperConfigProperties.class, InstanceSupplier.of(properties));
-
- ZookeeperPropertySources sources = new ZookeeperPropertySources(properties, log);
-
- List contexts = (locationUri == null || CollectionUtils.isEmpty(locationUri.getPathSegments()))
- ? sources.generateAutomaticContexts(profiles.getAccepted(), false) : getCustomContexts(locationUri);
-
- // promote beans to context
- context.getBootstrapContext().addCloseListener(event -> {
- HashMap source = new HashMap<>();
- source.put("spring.cloud.zookeeper.config.property-source-contexts", contexts.stream().map(Context::getPath).collect(Collectors.toList()));
- MapPropertySource propertySource = new MapPropertySource("zookeeperConfigData", source);
- event.getApplicationContext().getEnvironment().getPropertySources().addFirst(propertySource);
- });
-
- ArrayList locations = new ArrayList<>();
- contexts.forEach(propertySourceContext -> locations
- .add(new ZookeeperConfigDataResource(propertySourceContext.getPath(), location.isOptional(), propertySourceContext
- .getProfile())));
-
- return locations;
- }
-
- private BindHandler getBindHandler(ConfigDataLocationResolverContext context) {
- return context.getBootstrapContext().getOrElse(BindHandler.class, null);
- }
-
- protected List getCustomContexts(UriComponents uriComponents) {
- if (!StringUtils.hasLength(uriComponents.getPath())) {
- return Collections.emptyList();
- }
-
- return Arrays.stream(uriComponents.getPath().split(";")).map(Context::new).collect(Collectors.toList());
- }
-
- @Nullable
- protected UriComponents parseLocation(ConfigDataLocation location) {
- String originalUri = location.getNonPrefixedValue(PREFIX);
- if (!StringUtils.hasText(originalUri)) {
- return null;
- }
- String uri;
- if (!originalUri.startsWith("//")) {
- uri = PREFIX + "//" + originalUri;
- }
- else {
- uri = originalUri;
- }
- return UriComponentsBuilder.fromUriString(uri).build();
- }
-
- protected ZookeeperConfigProperties loadConfigProperties(ConfigDataLocationResolverContext context) {
- Binder binder = context.getBinder();
- BindHandler bindHandler = getBindHandler(context);
- ZookeeperConfigProperties properties = binder
- .bind(ZookeeperConfigProperties.PREFIX, Bindable.of(ZookeeperConfigProperties.class), bindHandler)
- .orElseGet(ZookeeperConfigProperties::new);
-
- if (!StringUtils.hasLength(properties.getName())) {
- properties.setName(binder.bind("spring.application.name", Bindable.of(String.class), bindHandler).orElse("application"));
- }
-
- return properties;
- }
-
-}
diff --git a/spring-cloud-zookeeper-config/src/main/java/org/springframework/cloud/zookeeper/config/ZookeeperConfigDataMissingEnvironmentPostProcessor.java b/spring-cloud-zookeeper-config/src/main/java/org/springframework/cloud/zookeeper/config/ZookeeperConfigDataMissingEnvironmentPostProcessor.java
deleted file mode 100644
index afe0a8c5a..000000000
--- a/spring-cloud-zookeeper-config/src/main/java/org/springframework/cloud/zookeeper/config/ZookeeperConfigDataMissingEnvironmentPostProcessor.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright 2015-2021 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.zookeeper.config;
-
-import org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor;
-import org.springframework.boot.diagnostics.AbstractFailureAnalyzer;
-import org.springframework.boot.diagnostics.FailureAnalysis;
-import org.springframework.cloud.commons.ConfigDataMissingEnvironmentPostProcessor;
-import org.springframework.cloud.zookeeper.ZookeeperProperties;
-import org.springframework.core.env.Environment;
-
-import static org.springframework.cloud.util.PropertyUtils.bootstrapEnabled;
-import static org.springframework.cloud.util.PropertyUtils.useLegacyProcessing;
-import static org.springframework.cloud.zookeeper.config.ZookeeperConfigDataLocationResolver.PREFIX;
-
-public class ZookeeperConfigDataMissingEnvironmentPostProcessor extends ConfigDataMissingEnvironmentPostProcessor {
-
- /**
- * Order of post processor, set to run after
- * {@link ConfigDataEnvironmentPostProcessor}.
- */
- public static final int ORDER = ConfigDataEnvironmentPostProcessor.ORDER + 1000;
-
- @Override
- public int getOrder() {
- return ORDER;
- }
-
- @Override
- protected boolean shouldProcessEnvironment(Environment environment) {
- // don't run if using bootstrap or legacy processing
- if (bootstrapEnabled(environment) || useLegacyProcessing(environment)) {
- return false;
- }
- boolean coreEnabled = environment.getProperty(ZookeeperProperties.PREFIX + ".enabled", Boolean.class,
- true);
- boolean configEnabled = environment.getProperty(ZookeeperConfigProperties.PREFIX + ".enabled", Boolean.class,
- true);
- boolean importCheckEnabled = environment.getProperty(ZookeeperConfigProperties.PREFIX + ".import-check.enabled",
- Boolean.class, true);
- if (!coreEnabled || !configEnabled || !importCheckEnabled) {
- return false;
- }
- return true;
- }
-
- @Override
- protected String getPrefix() {
- return PREFIX;
- }
-
- static class ImportExceptionFailureAnalyzer extends AbstractFailureAnalyzer {
-
- @Override
- protected FailureAnalysis analyze(Throwable rootFailure, ImportException cause) {
- String description;
- if (cause.missingPrefix) {
- description = "The spring.config.import property is missing a " + PREFIX + " entry";
- }
- else {
- description = "No spring.config.import property has been defined";
- }
- String action = "Add a spring.config.import=zookeeper: property to your configuration.\n"
- + "\tIf configuration is not required add spring.config.import=optional:zookeeper: instead.\n"
- + "\tTo disable this check, set spring.cloud.zookeeper.config.enabled=false or \n"
- + "\tspring.cloud.zookeeper.config.import-check.enabled=false.";
- return new FailureAnalysis(description, action, cause);
- }
-
- }
-
-}
diff --git a/spring-cloud-zookeeper-config/src/main/java/org/springframework/cloud/zookeeper/config/ZookeeperConfigDataResource.java b/spring-cloud-zookeeper-config/src/main/java/org/springframework/cloud/zookeeper/config/ZookeeperConfigDataResource.java
deleted file mode 100644
index abb58500e..000000000
--- a/spring-cloud-zookeeper-config/src/main/java/org/springframework/cloud/zookeeper/config/ZookeeperConfigDataResource.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright 2015-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.zookeeper.config;
-
-import java.util.Objects;
-
-import org.springframework.boot.context.config.ConfigDataResource;
-import org.springframework.core.style.ToStringCreator;
-
-public class ZookeeperConfigDataResource extends ConfigDataResource {
-
- private final String context;
- private final boolean optional;
- private final String profile;
-
- public ZookeeperConfigDataResource(String context, boolean optional, String profile) {
- this.context = context;
- this.optional = optional;
- this.profile = profile;
- }
-
- @Deprecated
- public ZookeeperConfigDataResource(String context, boolean optional) {
- this(context, optional, null);
- }
-
- public String getContext() {
- return this.context;
- }
-
- public boolean isOptional() {
- return this.optional;
- }
-
- public String getProfile() {
- return this.profile;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- ZookeeperConfigDataResource that = (ZookeeperConfigDataResource) o;
- return this.optional == that.optional && this.context.equals(that.context) && Objects.equals(this.profile, that.profile);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(this.optional, this.context, this.profile);
- }
-
- @Override
- public String toString() {
- return new ToStringCreator(this)
- .append("context", context)
- .append("optional", optional)
- .append("profile", profile)
- .toString();
-
- }
-}
diff --git a/spring-cloud-zookeeper-config/src/main/java/org/springframework/cloud/zookeeper/config/ZookeeperConfigProperties.java b/spring-cloud-zookeeper-config/src/main/java/org/springframework/cloud/zookeeper/config/ZookeeperConfigProperties.java
deleted file mode 100644
index ae55f1c1e..000000000
--- a/spring-cloud-zookeeper-config/src/main/java/org/springframework/cloud/zookeeper/config/ZookeeperConfigProperties.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Copyright 2015-2019 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.zookeeper.config;
-
-import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.core.style.ToStringCreator;
-import org.springframework.util.Assert;
-
-/**
- * Properties related to keeping configuration in Zookeeper.
- *
- * @author Spencer Gibb
- * @since 1.0.0
- * @see ZookeeperPropertySourceLocator
- */
-@ConfigurationProperties(ZookeeperConfigProperties.PREFIX)
-public class ZookeeperConfigProperties {
-
- /**
- * Configuration prefix for config properties.
- */
- public static final String PREFIX = "spring.cloud.zookeeper.config";
-
- private boolean enabled = true;
-
- /**
- * Root folder where the configuration for Zookeeper is kept.
- */
- private String root = "config";
-
- /**
- * Alternative to spring.application.name to use in looking up values in zookeeper.
- */
- private String name;
-
- /**
- * The name of the default context.
- */
- private String defaultContext = "application";
-
- /**
- * Separator for profile appended to the application name.
- */
- private String profileSeparator = ",";
-
- /**
- * Throw exceptions during config lookup if true, otherwise, log warnings.
- */
- private boolean failFast = true;
-
- public boolean isEnabled() {
- return this.enabled;
- }
-
- public void setEnabled(boolean enabled) {
- this.enabled = enabled;
- }
-
- public String getRoot() {
- return this.root;
- }
-
- public void setRoot(String root) {
- this.root = root;
- }
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getDefaultContext() {
- return this.defaultContext;
- }
-
- public void setDefaultContext(String defaultContext) {
- Assert.hasText(defaultContext, "spring.cloud.zookeeper.config.default-context may not be empty");
- this.defaultContext = defaultContext;
- }
-
- public String getProfileSeparator() {
- return this.profileSeparator;
- }
-
- public void setProfileSeparator(String profileSeparator) {
- Assert.hasText(profileSeparator, "spring.cloud.zookeeper.config.profile-separator may not be empty");
- this.profileSeparator = profileSeparator;
- }
-
- public boolean isFailFast() {
- return this.failFast;
- }
-
- public void setFailFast(boolean failFast) {
- this.failFast = failFast;
- }
-
- @Override
- public String toString() {
- return new ToStringCreator(this)
- .append("enabled", enabled)
- .append("root", root)
- .append("name", name)
- .append("defaultContext", defaultContext)
- .append("profileSeparator", profileSeparator)
- .append("failFast", failFast)
- .toString();
-
- }
-}
diff --git a/spring-cloud-zookeeper-config/src/main/java/org/springframework/cloud/zookeeper/config/ZookeeperPropertySource.java b/spring-cloud-zookeeper-config/src/main/java/org/springframework/cloud/zookeeper/config/ZookeeperPropertySource.java
deleted file mode 100644
index 4cd6c03a7..000000000
--- a/spring-cloud-zookeeper-config/src/main/java/org/springframework/cloud/zookeeper/config/ZookeeperPropertySource.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * Copyright 2015-2019 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.zookeeper.config;
-
-import java.nio.charset.Charset;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.curator.framework.CuratorFramework;
-import org.apache.zookeeper.KeeperException;
-
-import org.springframework.util.ReflectionUtils;
-
-/**
- * {@link org.springframework.core.env.PropertySource} that stores properties from
- * Zookeeper inside a map. Properties are loaded upon class initialization.
- *
- * @author Spencer Gibb
- * @since 1.0.0
- */
-public class ZookeeperPropertySource extends AbstractZookeeperPropertySource {
-
- private static final Log log = LogFactory.getLog(ZookeeperPropertySource.class);
-
- private Map properties = new LinkedHashMap<>();
-
- public ZookeeperPropertySource(String context, CuratorFramework source) {
- super(context, source);
- findProperties(this.getContext(), null);
- }
-
- @Override
- public Object getProperty(String name) {
- return this.properties.get(name);
- }
-
- private byte[] getPropertyBytes(String fullPath) {
- try {
- byte[] bytes = null;
- try {
- bytes = this.getSource().getData().forPath(fullPath);
- }
- catch (KeeperException e) {
- if (e.code() != KeeperException.Code.NONODE) { // not found
- throw e;
- }
- }
- return bytes;
- }
- catch (Exception exception) {
- ReflectionUtils.rethrowRuntimeException(exception);
- }
- return null;
- }
-
- @Override
- public String[] getPropertyNames() {
- Set strings = this.properties.keySet();
- return strings.toArray(new String[strings.size()]);
- }
-
- private void findProperties(String path, List children) {
- try {
- log.trace("entering findProperties for path: " + path);
- if (children == null) {
- children = getChildren(path);
- }
- if (children == null || children.isEmpty()) {
- return;
- }
- for (String child : children) {
- String childPath = path + "/" + child;
- List childPathChildren = getChildren(childPath);
-
- byte[] bytes = getPropertyBytes(childPath);
- if (bytes == null || bytes.length == 0) {
- if (childPathChildren == null || childPathChildren.isEmpty()) {
- registerKeyValue(childPath, "");
- }
- }
- else {
- registerKeyValue(childPath,
- new String(bytes, Charset.forName("UTF-8")));
- }
-
- // Check children even if we have found a value for the current znode
- findProperties(childPath, childPathChildren);
- }
- log.trace("leaving findProperties for path: " + path);
- }
- catch (Exception exception) {
- ReflectionUtils.rethrowRuntimeException(exception);
- }
- }
-
- private void registerKeyValue(String path, String value) {
- String key = sanitizeKey(path);
- this.properties.put(key, value);
- }
-
- private List getChildren(String path) throws Exception {
- List children = null;
- try {
- children = this.getSource().getChildren().forPath(path);
- }
- catch (KeeperException e) {
- if (e.code() != KeeperException.Code.NONODE) { // not found
- throw e;
- }
- }
- return children;
- }
-
-}
diff --git a/spring-cloud-zookeeper-config/src/main/java/org/springframework/cloud/zookeeper/config/ZookeeperPropertySourceLocator.java b/spring-cloud-zookeeper-config/src/main/java/org/springframework/cloud/zookeeper/config/ZookeeperPropertySourceLocator.java
deleted file mode 100644
index 8c184acd8..000000000
--- a/spring-cloud-zookeeper-config/src/main/java/org/springframework/cloud/zookeeper/config/ZookeeperPropertySourceLocator.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Copyright 2015-2019 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.zookeeper.config;
-
-import java.util.Arrays;
-import java.util.List;
-
-import jakarta.annotation.PreDestroy;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.curator.framework.CuratorFramework;
-
-import org.springframework.cloud.bootstrap.config.PropertySourceLocator;
-import org.springframework.core.env.CompositePropertySource;
-import org.springframework.core.env.ConfigurableEnvironment;
-import org.springframework.core.env.Environment;
-import org.springframework.core.env.PropertySource;
-import org.springframework.util.Assert;
-
-/**
- * Zookeeper provides a hierarchical
- * namespace that allows clients to store arbitrary data, such as configuration data.
- * Spring Cloud Zookeeper Config is an alternative to the
- * Config Server and
- * Client. Configuration is loaded into the Spring Environment during the special
- * "bootstrap" phase. Configuration is stored in the {@code /config} namespace by default.
- * Multiple {@code PropertySource} instances are created based on the application's name
- * and the active profiles that mimicks the Spring Cloud Config order of resolving
- * properties. For example, an application with the name "testApp" and with the "dev"
- * profile will have the following property sources created:
- *
- *